Here is a string I use in one of my projects which connects to SQL Server, Tested with SQL Server 6.5 - 2008 using ADO.
Code:
Code:
Provider=MSDASQL; DRIVER=Sql Server; SERVER=p42800; DATABASE=myDatabase; UID=MyUserID; PWD=MyPassword
Here is another which uses a DSN created by odbc manager
Code:
Code:
PROVIDER=MSDASQL;dsn=myDSNName;uid=MyUserID;pwd=MyPassword;
I have used both of these in several projects and never had an issue. I would recommend the top one as it does not require you to create a DSN.
btw in my Case the PC Named p42800 is running SQL Server 2000 and by using the PC name rather than local host that string works both on that pc and from any other pc on the network as well.