Guest cegger Posted October 17, 2005 Share Posted October 17, 2005 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 comment Share on other sites More sharing options...
Jerome Posted October 19, 2005 Share Posted October 19, 2005 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 comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now