cannot change CursorType

Results 1 to 4 of 4

Thread: cannot change CursorType

  1. #1
    Jannik Hendriksen Guest

    Default cannot change CursorType

    I try to change the cursortype to static.<BR>To do this I wrote:<BR>beskeder = Conn.Execute(mySQLString);<BR>beskeder.CursorType = 3;<BR><BR>I get an errormessage telling me that I cannot do this operation on an open object.<BR>Then I tried to close it(beskeder.Close();), and I got an errormessage telling me that I cannot do this operation on a closed object!?!<BR><BR>What wrong here??<BR><BR>As you can see I use javascript, but any answers in VBScript is greatly appreciated too.<BR><BR>-thanx

  2. #2
    Jannik Hendriksen Guest

    Default GOT IT! - but cursortype wont STAY static

    I did it with this:<BR>beskeder = Server.CreateObject("ADODB.Recordset");<BR>beskede r.CursorType = 3;<BR><BR>but now if I do:<BR>beskeder = Conn.Execute(mySQLString);<BR><BR>the cursortype returns to forward-only (0). I check for the cursortype before and after the Execute, and it changes from 3 to 0 after the Execute.<BR><BR>Can anyone help, please?<BR><BR>-thanx

  3. #3
    Solution Guest

    Default RE: cannot change CursorType

    I think you have to set the cursor type before you open the recordset. You can use either a command Object and then open your recordSet with the help of the command object<BR><BR>eg. Set recordSet = Server.CreateObject("ADODB.REcordSet")<BR> Set comm = Server.CreateObject("ADODB.Command")<BR> recordSet.Open comm,,3,1<BR>Note: You do have to setup the active Connection to Conn.<BR>Hope this helps

  4. #4
    Solution Guest

    Default RE: GOT IT! - but cursortype wont STAY static

    Try using a command Object with the recordset and connection Object <BR>with this method you can use the recordSet open method which has cursor type as one of the options.<BR>Actually, I sent this message yesterday, but was never posted.(no Idea why)<BR>This may or may not help but worth trying<BR>1. You already have a connection object ...right<BR>2. Create a commad object<BR> Set active connection to the connection object <BR> set you commandType to 1 ( which is SQL stmt)<BR> then set you commandText to the SQL stmt<BR>3. Create a recordSet object<BR> USe recordSet.Open commandObject,activeConnection,CursorType,other options<BR>This way you can try the cursor type.<BR>Good Luck

Posting Permissions

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