Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL server Cursor

Posted on 2003-03-20
4
Medium Priority
?
513 Views
Last Modified: 2012-06-27
Hi,

I use the following code to connect to SQL Server. but when I use edit() function of CRecordset to update a record in databse, it reports error.

//connect to DB
m_Database.OpenEx( ConnectionString, CDatabase::noOdbcDialog )

//update records
m_pRecordset->Edit(); <-- report a "DBCore.cpp line 66 assertion"
m_pRecordset->Update();
 
later, I change the connection as:
m_Database.OpenEx( ConnectionString, CDatabase::noOdbcDialog | CDatabase::useCursorLib))

then it works fine.

My question is:
1> Does the edit() function use a cursor?
2>SQL server Driver itself supports cursor ability, why I have to use other cursor library?
3> how do I use the SQL server driver's cursor ability?

Could you give some code example? I am using vc++

Thanks,

Gossip


0
Comment
Question by:Gossip
3 Comments
 
LVL 9

Accepted Solution

by:
xenon_je earned 80 total points
ID: 8180398
Just a sugestion (maybe a stupidity): try this

//connect to DB
m_Database.OpenEx( ConnectionString, CDatabase::noOdbcDialog )

m_pRecordset->Open();

//update records
m_pRecordset->Edit(); <-- report a "DBCore.cpp line 66 assertion"
m_pRecordset->Update();

0
 

Expert Comment

by:CleanupPing
ID: 9275685
Gossip:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 12

Expert Comment

by:monosodiumg
ID: 11183561
No comment has been added to this question in more than 268 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: xenon_je http:#8180398

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

monosodiumg
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question