SQL query in C++

K

karol1208

I have problem with sending query (form C++ MFC program) to data base.
When i send query with "SELECT" everything is ok. But when I send the
one with "UPDATE" or "INSERT" I get exeption.
I use:

CDatabase::OpenEx

"DRIVER={SQL
Server};DATABASE=database;SERVER=server;UID=login;PWD=password"

OpenEx(pszDest, CDatabase::noOdbcDialog );

CMyRecordset.Open(CRecordset::dynaset,strQuery1,NULL ))

When I use SQL Manager with this same connection parameters (login,
password, server...) everything is ok.
 
O

Obnoxious User

karol1208 skrev:
I have problem with sending query (form C++ MFC program) to data base.
When i send query with "SELECT" everything is ok. But when I send the
one with "UPDATE" or "INSERT" I get exeption.
I use:

CDatabase::OpenEx

"DRIVER={SQL
Server};DATABASE=database;SERVER=server;UID=login;PWD=password"

OpenEx(pszDest, CDatabase::noOdbcDialog );

CMyRecordset.Open(CRecordset::dynaset,strQuery1,NULL ))

When I use SQL Manager with this same connection parameters (login,
password, server...) everything is ok.

Ever bothered checking what the exception is telling you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top