Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002

    Unanswered: SQL Server, OLE DB problem

    I am currently porting a c++ application from using Microsoft Jet (mdb file) to using MS SQL Server 2000.

    The current application takes advantage of MS Jet dynaset recordsets which are bookmarkable and updateable even if there is no primary key in the result set. How it does this, i am unsure.

    I am having difficulty obtaining this same functionality using OLE DB connected to SQL Server 2000. The SQL Server documentation lists several cursor types, of which i deduced the one i would need is a keyset, however because some of the recordsets do not have a unique identifier i get errors when i try to execute the query.

    I would like to be able to mimic the behaviour of the Microsoft Jet engines dynaset recordsets and be able to to open ANY recordset and be able to bookmark and update it.

    Any suggestions/help would be much appreciated.



  2. #2
    Join Date
    May 2002
    Well, it's been a couple of days since you posted, and no one has offered a better answer, so here's what little I can think of...

    A database that works with records has to be able to internally identify each row, whether they have a primary key or not, such as with Oracle's RowID. Apparently, Jet provides some functionality to programmers that relies on this. I don't know that OLE DB provides the same ability.

    If you can't find someone to tell you OLE DB does provide such functionality, and how you implement it, it looks to me like you'll have to create a column to serve as a primary key. If so, you can make it an integer datatype with Identity on, so you don't have to insert primary key data. Perhaps someone will provide a better answer, but in the meantime, you might want to try this.

    John Lambert
    Team Database
    The International Association Of Database Professionals

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts