ADO - SQL Server Recordset Cursor Changes

  • Hello All,

    I have one of the most perplexing problems that I've ever seen!  I have an application that simply wants to add a record to a recordset.  My setup for this is as follows: (using MDAC 2.8)

    set rsu=server.createobject("adodb.recordset")

    rsu.CursorType = 3

    SQLString = "SELECT * FROM TASDISTRICTS ORDER BY TDID"

    rsu.open SQLString, cn, 1, 3

     
    Here's the scoop - when this code is executed - the CursorType turns back to 0.  I use this code for all of my hookups and have never had any problems.  It is currently running fine against a different SQL database.  So that is how I have funnelled this problem down to the differences in databases and permissions.  However, I see no differences between the two.
     
    Has anyone been through this hell before?  And if so - How do I get out???!!!
     
    Thanx,
    Chris
  • Something is strange about your code: in the second line you say that you want a static cursor, but when you open the recordset you say that you want a keyset cursor. Which one do you want ? If you want to use a keyset cursor, the most probable cause of the problem is that you don't have a primary key in the table. Another possible cause would be the CursorLocation.

    Razvan

  • Also, if you are using OLEDB drivers for the connection, the 'ORDER BY' in the SQL can sometimes convert the cursor to be read only. Don't ask me why. Its a 'feature' of the OLEDB drivers (at least in MDAC 2.7)

    Peter

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply