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.