Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP RecordSet and Access result different??

Status
Not open for further replies.

RoppieEpcor

Programmer
Jan 5, 2007
1
NL
Hi,

i'm trying to get some results from my Access database through SQL. I've generated the following SQL statement from my ASP script:

SELECT * FROM tblReports WHERE ((reportName LIKE '*parts*') AND (reportCategory Is not null) AND (reportOwner Is not null) AND (reportStatus = 1)) ORDER BY reportName ASC

If I run this query in the Access database I get 7 result records with all fields. But if I create a recordset in ASP then nothing is returned. How is this possible?

(ALL reportStatus are 1, NONE of the reportCategory or reportOwner are Null)

ASP CODE:
<%
Set rsReports = Server.CreateObject("ADODB.RecordSet")
'strSql = sqlString mentioned above
rsReports.Open strSql, dbConn, 3, 3
Response.Write Cstr(rsReports.recordcount)
%>

OUTPUT: 0
 
You need to use % rather than * in ASP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top