PDA

View Full Version : SQL error - query


scroots
12-25-2002, 07:52 PM
i have the line
strSQL = "SELECT * FROM tblstuff WHERE tblstuff.ID = '" & freddy & "' AND tblstuff.thready = '1'"

and it produces the following error

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

any ideas of the solution/problem?

scroots

The Wizzard
12-26-2002, 01:21 AM
Are you sure your table name is tblstuff, and not stuff?

Make sure your data is all correct.

Sounds like your trying to pull something that isnt there.

NinjaTurtle
12-26-2002, 01:22 AM
strSQL = "SELECT * FROM tblstuff WHERE tblstuff.ID = '" & freddy & "' AND tblstuff.thready = '1'"

1. check ur database structure.
2. or your variable "Freddy" is null or blank.
3. tblstuff.thready ='1', try this --> tblstuff.thready =1, without the quo marks.

scroots
12-26-2002, 09:07 PM
i will try out your suggestions.

thanks

scroots