Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Nottingham, Nottinghamshire, England
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asp + sybase v11.5 + adodb recorset and ie 5.5

    I'm using the folling bit of code in an asp page. It queries a sybase sql server 11.5 database via a stored procedure. The record that is returned is from a field that is varchar(100). Originally I was using and ABODB.Command to do this, but for some reason it returns eof when the combined length of the records exceeded 255 characters. The recordset doesn't return eof, but when I try to movenext it errors with the message "Row handles must be released before new ones can be obtained". Microsoft reckon this error occurs when you try to update a record more than once, but I'm not updating the record...

    '#######
    Set oData = Server.CreateObject("ADODB.Recordset")
    SQLQuery = "usp_n2_options_sel @Section_Name = 'Reminder eMail message.'"
    'Open Recordset oData
    Set oData = Server.CreateObject("ADODB.Recordset")
    oData.Open SQLQuery, oConn
    if not oData.eof then
    do until oData.eof
    strRemMsg = strRemMsg & cstr(oData("OPTION_VALUE_TEXT"))
    oData.moveNext
    loop
    else
    strRemMsg = "No Data,"
    end if
    '#######

    any suggestions?

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: asp + sybase v11.5 + adodb recorset and ie 5.5

    I'm not very familiar with using a Sybase back-end, but I do have a few ideas.

    (I noticed that you have set oData twice in your posted code. I'm guessing that was just a typo in the post - not in the actual code. You probably meant to set and open oConn??)

    Although you can use the ADO objects to connect to any data source that supports OLEDB, keep in mind that each OLEDB provider has its own properties and requirements to talk to the ADO objects. My guess is that there is a record locking violation with the way you've opened the recordset. Try specifying the cursor lock type as adLockReadOnly (as the final argument in the recordset Open statment - see ADO help for more details on Cursor Lock Type).

    The error message about row handles being released just sounds like the record is being locked for editing. Changing the lock type to ReadOnly could possibly fix that.

    Another thought that may or may not have any bearing on the current situation is how to start the loop. I always move to the first record in my recordsets before starting a loop process. This is not always necessary, but I try to do it for clarity. Maybe you can try "oData.MoveFirst" before your "Do until..." line.

    Otherwise, your code looks fine. (Be sure to close and destroy your objects down the line somewhere.)

    Hope this helps!

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Nottingham, Nottinghamshire, England
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: asp + sybase v11.5 + adodb recorset and ie 5.5

    Cheers Mark,
    I solved the problem by upgrading mdac_typ to 2.5 from 2.2, I wasn't sure about the later versions as they all said "doesn't include jet" and we use access 97 a lot...

    Alan

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: asp + sybase v11.5 + adodb recorset and ie 5.5

    Alan,

    Great! I'm glad to hear that you got it working. I wouldn't worry about the MDAC package not having Jet. There is a separate package for Jet that you can still download and install - I think they just released a new update not long ago.

    Best,

Posting Permissions

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