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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Wont Work in ASP

Status
Not open for further replies.

JohnBoy2005

Programmer
Jul 12, 2005
117
GB
I've got an SQL Query

SQL ="SELECT tblUsers.User_ID, tblUsers.Assets FROM tblUsers WHERE tblUsers.User_ID = 9 AND tblUsers.Assets Like '*;10;*'"

This Query is straight out of MS Access and returns a result of 1 which is correct,

Run the same SQL in my ASP script and it returns a recordcount of 0

SET rstCheck = Server.Createobject("ADODB.Recordset")
SQL = "SELECT tblUsers.User_ID, tblUsers.Assets FROM tblUsers WHERE tblUsers.User_ID = 9 AND tblUsers.Assets Like '*;10;*'"
rstCheck.Open SQL,Conn,3,3

Response.Write(SQL & " - " & RstCheck.RecordCount)

Can't understand why

Cheers

John
 
Sorry, just realised you use % and not *

Works fine now

Cheers

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top