Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server VS MSDE

Author  Topic 

goblyn27
Starting Member

39 Posts

Posted - 2002-05-11 : 12:23:06
Is there a way to determine programmatically what an end user is running on their system. I am writing a program that I intend to used MSDE for the back end, but in those rare occasions where someone has SQL Server installed, I'd like for the program to connect tot he SQL Server instead. I need a way to determine which driver I should be specifying in the ADO Connection String on any given client.



"DuuuDe!! I suck!"

Doug G
Constraint Violating Yak Guru

331 Posts

Posted - 2002-05-11 : 12:42:57
You can use identical connection strings for MSDE or SQL Server connections afaik.


======
Doug G
======
Go to Top of Page

goblyn27
Starting Member

39 Posts

Posted - 2002-05-11 : 15:03:43
See all the examples I've seen used a different connection string so I never thought of simply trying the SQL Server connection string. I shall have to give that a try later on tonight and see what happens. Thanx.



"DuuuDe!! I suck!"
Go to Top of Page

Doug G
Constraint Violating Yak Guru

331 Posts

Posted - 2002-05-11 : 19:46:09
sConn = "Provider=SQLOLEDB.1;User ID=username;Password=password;Data Source=servername;Initial Catalog=databse"

This works for me to connect to SQL Server 7, 2000 and MSDE1.0 from the same VB project.


======
Doug G
======
Go to Top of Page

goblyn27
Starting Member

39 Posts

Posted - 2002-05-12 : 00:43:35
A-ha. Specifying the Provider seems to do the job. After your last post, I tried and I was getting errors but the connection string I was using was "DRIVER={SQL SERVER};SERVER=.;UID=userid;PWD=password;Database=database" So when I came here to update the boards with my lack of success, I saw and tried the string you provided and it worked like a charm.

On an interesting note, I can't get my system to create a DSN for the MSDE Server either (I also tried that when my string wasnt working). Methinks, the ODBC Control Panel uses a connection string more like my original string than like yours.

"DuuuDe!! I suck!"
Go to Top of Page
   

- Advertisement -