#1
|
|||
|
|||
How can I use CDaoRecordset update SQL Server database?
How can I use CDaoRecordset update SQL Server database?
I connect SQL Server database with CDaoDatabase and CDaoRecordset but I can't Update or Edit record This is my program CDaoDatabase* pdaoDB = new CDaoDatabase; CDaoRecordset* pdaoRS = new CDaoRecordset(pdaoDB); pdaoDB->Open("", 0, 0, "ODBC;DRIVER={SQL Server};SERVER=TestServer;UID=sa;PWD=TestPwd;Datab ase=TestDatabase"); pdaoRS->Open(AFX_DAO_USE_DEFAULT_TYPE, "SELECT * FROM test", 0); pdaoRS->AddNew(); pdaoRS->SetFieldValue("F1", "Data"); pdaoRS->Update(); <-- Error this line ???? This source code can use with Microsoft Access Database, dBase but I don't know why it can't update SQL server database. Thak you for your help. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Datarescue IDA pirated .idb database | arlequim | General Discussion | 22 | 03-21-2009 01:15 |
Database programming in C++ | hmora | General Discussion | 1 | 07-12-2004 09:48 |