Common SQL connection help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone share with me code for the following task please?
1) User clicks a button(button1), to bring up a file location window for the
user to select the SQL Server 2000 and Pub database on the network(not
onhis/her current machine so the user needs to create the correct path).
2)That user selction will then create the SQL connection.
3) ListBox1 on Form1 will then show the authors in the Pubs database.

Thank you for any help with this, I think once I get past this point I will
break thru this wall I have hit for connecting to a SQL server that is not my
workstation.

Mike
 
Hi Mike,

The answer's really pretty simple: put the app on a shared network drive;
then structure the connectionstring calling the server by name (eg,
ASCCOSVR), etc.

I do this with all of the apps I build for clients on servers; the
workstations connect to the server without any difficulty.

HTH,

Bernie Yaeger
 
What do you mean about file location. Do you need to see all of the Sql
Servers running on the network - or do you need to point to the mdf file?
 
I want the user to be prompted with a directory window to select the server
on the network, I have more than one SQL server. With this example I am
using the Pubs database, and the authors table. So the user can run the
program once to select Server1, and the next time they can select Server2,
but then use the Pubs database no matter which server they select. The
listbox1 will display authors.

Thanks
 
Back
Top