Error opening a recordset

Results 1 to 3 of 3

Thread: Error opening a recordset

  1. #1
    Join Date
    Dec 1969

    Default Error opening a recordset

    I am having a problem opening an recordset. I am creating one dynamically. The problem is that if the recordset, when opened, is empty, an error will generate. The recordset is not opening at all. I need to catch this. The code is below. I don&#039t know if the recordset is null before I open it, but if it is an error is generated. <BR><BR>Thanks. The codeis below<BR><BR>set rsOrderInfo = Server.CreateObject("ADODB.Recordset")<BR> rsOrderInfo.ActiveConnection = "dsn=kc_writedb1;uid=maintenance;pwd=eatfish;" <BR> rsOrderInfo.Source = rsOrderInfosql<BR> rsOrderInfo.CursorType = 0<BR> rsOrderInfo.CursorLocation = 2<BR> rsOrderInfo.LockType = 3<BR> rsOrderInfo.Open<BR> rsOrderInfo_numRows = 0

  2. #2
    Join Date
    Dec 1969

    Default RE: Error opening a recordset

    If rs.BOF And rs.EOF Then<BR>Response.Write("No records found.")<BR>Else<BR>Work with recordset<BR>End If

  3. #3
    E! Guest

    Default RE: Error opening a recordset

    rsOrderInfo.Source = rsOrderInfosql - ???<BR><BR>Where is your select statement... JJ is correct with determining the state of the recordset, but where is your select statement??? rsOrderInfosql? hhhmmmmm....???<BR>

Posting Permissions

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