iannorthwood
Technical User
I have a query which returns 2 records when executed in Access but, when run from my ASP page, I get -1 for RecordCount or, if I loop through the RS incrementing a counter, the counter is 0. In either case, it's basically saying that there were no records.
The ASP page uses the following settings:
strSQL = "SELECT DISTINCT T_Request.RequestID, T_Request.RequestAppID, T_Request.RequestedBy, T_Request.RequestedOn, T_Request.RequestRequiredBy, T_Request.RequestStatusID, T_Request.RequestPackagerID, T_Request.RequestSignedOffOn, T_Request.RequestSignedOffBy, T_Request.RequestTypeID, T_Request.RequestPriorityID, T_Request.RequestReleaseLocation FROM T_Request, T_App WHERE RequestAppID IN (SELECT AppID FROM T_App WHERE AppVendorID = (SELECT VendorID FROM T_Vendor WHERE VendorName LIKE 'Aspect*'))"
'// The connection dbConn is open already at this point.
'// Trust me, it is. Also, the standard ADOVBS.INC
'// is also included (for defining adUseClient, etc)
Set RS = dbConn.Execute(strSQL)
response.write strSQL & "<BR><BR>"
Dim intCount
intCount = 0
With RS
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.MoveFirst
response.write "Count=" & .RecordCount
While NOT .EOF AND NOT .BOF
intCount = intCount + 1
.MoveNext()
Wend
response.write "<BR>Count=" & intCount
End With
The ASP page uses the following settings:
strSQL = "SELECT DISTINCT T_Request.RequestID, T_Request.RequestAppID, T_Request.RequestedBy, T_Request.RequestedOn, T_Request.RequestRequiredBy, T_Request.RequestStatusID, T_Request.RequestPackagerID, T_Request.RequestSignedOffOn, T_Request.RequestSignedOffBy, T_Request.RequestTypeID, T_Request.RequestPriorityID, T_Request.RequestReleaseLocation FROM T_Request, T_App WHERE RequestAppID IN (SELECT AppID FROM T_App WHERE AppVendorID = (SELECT VendorID FROM T_Vendor WHERE VendorName LIKE 'Aspect*'))"
'// The connection dbConn is open already at this point.
'// Trust me, it is. Also, the standard ADOVBS.INC
'// is also included (for defining adUseClient, etc)
Set RS = dbConn.Execute(strSQL)
response.write strSQL & "<BR><BR>"
Dim intCount
intCount = 0
With RS
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.MoveFirst
response.write "Count=" & .RecordCount
While NOT .EOF AND NOT .BOF
intCount = intCount + 1
.MoveNext()
Wend
response.write "<BR>Count=" & intCount
End With