Thread: MSSQL and C++
View Single Post
Old 08-19-2004, 03:23 AM   #2 (permalink)
sllabres
Registered User
 
Join Date: Aug 2004
Posts: 3
sllabres is on a distinguished road
SQLAPI++

Well iv come accross SQLAPI++ which looks like itll solve all my problems. Iv downloaded it and my app compiles ok except it seems to stop working. I cant seem to connect to the MSSQL database. My code is as follows:

SAConnection con;
SACommand cmd(
&con,
"Select * from nhssms");

con.setOption( "UseAPI" ) = "DB-Library";

try
{
con.Connect(
"SMSTEST@nhssms", // database name
"sa", // user name
"", // password
SA_SQLServer_Client);

con.Disconnect();
}
catch(SAException &x)
{
ShowErr((const char*)x.ErrText());
}

I must be doing something wrong, any suggestions?

Thanks,

Seb
sllabres is offline   Reply With Quote