SQL server Cursor

Posted on 2003-03-20
Medium Priority
Last Modified: 2012-06-27

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"
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++



Question by:Gossip
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

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 )


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


Expert Comment

ID: 9275685
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 
Post your closing recommendations!  No comment means you don't care.
LVL 12

Expert Comment

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.

EE Cleanup Volunteer

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

764 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