Click to See Complete Forum and Search --> : ConnectionString question


celtics
November 26th, 2003, 11:39 PM
this C++ (vc++) code works for local connectivity:
spCON->ConnectionString = L"DSN=MQIS;UID=sa;PWD=";
But, my database now is on remote server. How to revise this line of code to connect to remote server "MyRemoteServer"?.
MSSQL-SQL2000.
Celtics

hspc
November 27th, 2003, 04:14 AM
L"Provider=sqloledb;Data Source=myServerName;Initial Catalog=myDatabaseName;User Id=myUsername;Password=myPassword"

from : http://www.able-consulting.com/ADO_Conn.htm
also check www.connectionstrings.com

raghupathys
December 2nd, 2003, 06:40 AM
alternatively, instead of changing your code, you could just change the dsn settings and make it point to the new server.
Thats the whole point of having dsn's!