Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   How can I use CDaoRecordset update SQL Server database? (https://forum.exetools.com/showthread.php?t=3050)

tumtum 12-07-2003 21:29

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. :)


All times are GMT +8. The time now is 21:06.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX