Connecting to a server?

  • Hi, I have an application in visual basic.  I'm going to use two laptops at the moment to do a demonstration.  What i need to know is how to let my program know where the database is.  I had SQL Server running on my laptop. What i want to do is set up the application on another computer using a simple network (using crossover cables?) to connect to another laptop to create a client/server environment for the demo.

    Right now I'm using the following connection string:

    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=FAE;Data Source=KMSServer

    But if the server is on another computer i don't see how it will know to go there on its own.  Previously in MS Access, i had to provide a path.

    The above connection string works fine as long as the app and server are stored locally on the same machine.

    Thanks!

  • That connection string should also work on your network. (assuming KMSServer is the name of the other machine) If it doesn't, there's a number of things that may be wrong, eg server protocol settings, allowing network connections to the server, even Windows firewall. Some of these depend on which version of SQL server (2000, MSDE, 2005, Express) you have, as each of these installs with different defaults and different tools eg the 'surface area configuration' with Express will enable network access. . . .

    Oh, and that integrated security can be an issue too, but if you aren't connecting, you haven't reached that hurdle yet . .

    (Re Access, you need to provide a path for that as it's just a file that you're connecting to, whereas with SQL Server, it's another running application with its own network connection.) 

     

  • "(assuming KMSServer is the name of the other machine) If it doesn't, there's a number of things that may be wrong, eg server protocol settings, allowing network connections to the server, even Windows firewall. "

    The machine? Do you mean the laptop or the SQL Server 2000 running on the laptop?  In my connection string KMSServer is the name of the SQL Server 2000.  It runs locally on my laptop for development purposes.

    Server protocol settings?  The physical server or the SQL Server 2000?

    There are no firewalls on the laptops.

    "Oh, and that integrated security can be an issue too, but if you aren't connecting, you haven't reached that hurdle yet . . "

    that's a good point too. But i'm going to leave my server on my current laptop and install the application i created on a different laptop. I wonder if this will create problems with Integrated security?

    Thanks. I hope someone can clear these up for me.

  • If it's SQL 2000, then by default network connections will be enabled, the server name and machine name will be the same, and it will be the default instance, so no instance name to worry about.

    Check out the 'client network utility' and 'server network utility' on client and server respectively.

     I'm assuming TCP/IP protocol and that you can see shares on each machine from the other ie networking is ok.

    How far are you actually getting?

  • Thanks man! Its going to be the weekend before I get to test it out. I know nothing about networking. it was the one thing my school taught only sporadically. I wish i did know a little.

  • Jacob -

    Before you go banging your head on this thing for too long...  If you intend to use a cross-connect cable you're going to have to go manual for a lot of your settings - name resolution, etc. won't be available short of messing with hosts/lmhosts.

    (2)  Set up your SQL Server machine to use a specific/static IP address (e.g. 192.168.0.1, 255.255.255.0)

    (3) Set up your 2nd machine with the next IP number on your chosen subnet (e.g. 192.168.0.2, 255.255.255.0)

    (4) Test that you can ping between machines using the IP address (e.g. ping 192.168.0.1 from the 2nd machine)

    (3) replace "KMSServer" in your connection string with the IP address of the SQL Server machine (e.g. 192.168.0.1).

    Joe

  • GREAT AMOUNT OF THANKS!

  • Forgot one thing in my previous post, integrated security will most likely not work w/ a cross-connect cable, you'll need to use standard/SQL security (e.g. UID=X,PWD=Y in your connection string, remove "Integrated Security=SSPI")

     

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply