Jump to content

BOF, EOF error


Guest cegger

Recommended Posts

I am trying to use the EOF, BOF statement as a conditional to see if one recordset returns empty and if so move to the next one. If there is a Market value in the usage_code field it works fine. But if there is not, it won't move to the next select statement. It just gives me the ADO error that the record might have been deleted. I am not sure if I am closing in the wrong place or what. I just thought someone might be able to look at the code and give me an idea of what I'm doing wrong.Set rsBuilderInfo = Server.CreateObject("ADODB.Recordset")rsBuilderInfo.ActiveConnection = MM_RCCWebInformation_STRINGrsBuilderInfo.Source = "SELECT BUILDER_INFORMATION.BILL_TO_ADDRESS1, BUILDER_INFORMATION.BILL_TO_CITY, BUILDER_INFORMATION.BILL_TO_POSTAL_CODE, BUILDER_INFORMATION.BILL_TO_STATE, BUILDER_INFORMATION.CUSTOMER_NAME, BUILDER_INFORMATION.CUSTOMER_NUMBER, BUILDER_INFORMATION.DAY_PHONE_AREA_CODE, BUILDER_INFORMATION.DAY_PHONE_NUMBER, BUILDER_INFORMATION.DAY_PHONE_EXTENSION, BUILDER_INFORMATION.FAX_AREA_CODE, BUILDER_INFORMATION.FAX_EXTENSION, BUILDER_INFORMATION.FAX_NUMBER, BUILDER_INFORMATION.WEBSITE, CONTACTS.EMAIL_ADDRESS, CONTACTS.FIRST_NAME, CONTACTS.LAST_NAME, CONTACTS.USAGE_CODE FROM BUILDER_INFORMATION, CONTACTS WHERE (CONTACTS.CUSTOMER_NUMBER = '"&varIDnum&"' ) AND (CONTACTS.USAGE_CODE = 'MARKET') AND (CONTACTS.CUSTOMER_NUMBER = BUILDER_INFORMATION.CUSTOMER_NUMBER)"rsBuilderInfo.CursorType = 0rsBuilderInfo.CursorLocation = 2rsBuilderInfo.LockType = 1rsBuilderInfo.Open()If (rsBuilderInfo.BOF = TRUE) AND (rsBuilderInfo.EOF = TRUE) Then set rsBuilderInfo = conn.execute ("SELECT BUILDER_INFORMATION.BILL_TO_ADDRESS1, BUILDER_INFORMATION.BILL_TO_CITY, BUILDER_INFORMATION.BILL_TO_POSTAL_CODE, BUILDER_INFORMATION.BILL_TO_STATE, BUILDER_INFORMATION.CUSTOMER_NAME, BUILDER_INFORMATION.CUSTOMER_NUMBER, BUILDER_INFORMATION.DAY_PHONE_AREA_CODE, BUILDER_INFORMATION.DAY_PHONE_NUMBER, BUILDER_INFORMATION.DAY_PHONE_EXTENSION, BUILDER_INFORMATION.FAX_AREA_CODE, BUILDER_INFORMATION.FAX_EXTENSION, BUILDER_INFORMATION.FAX_NUMBER, BUILDER_INFORMATION.WEBSITE, CONTACTS.EMAIL_ADDRESS, CONTACTS.FIRST_NAME, CONTACTS.LAST_NAME, CONTACTS.USAGE_CODE FROM BUILDER_INFORMATION, CONTACTS WHERE (((CONTACTS.CUSTOMER_NUMBER) = '"& varIDnum &"') AND (CONTACTS.USAGE.CODE = 'AUTH_SIGNATURE'))") End IfrsBuilderInfo.Close()rsBuilderInfo_numRows = 0%>

Link to post
Share on other sites

Hi cegger,I'm maybe wrong but you should change your condition from :

<% If (rsBuilderInfo.BOF = TRUE) AND (rsBuilderInfo.EOF = TRUE) Then ... %>

to

<% If (rsBuilderInfo.BOF = FALSE) AND (rsBuilderInfo.EOF = FALSE) Then ... %>

If it's false that you are at the beginning of the file (BOF) and at the end of the file (EOF), then you execute your select.Jerome

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...