Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2003, 21:29
tumtum
 
Posts: n/a
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 16:59.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )