Click to See Complete Forum and Search --> : What's wrong with the sql ?


Robert Chu
01-16-2006, 09:51 AM
Hello,

When I use the following sql, there is error an error.
SelectCmd = "select * from table1 where id = 'test'"
But if I use
SelectCmd = "select * from table1", it can run. What's the problem ?

Cstick
01-16-2006, 09:37 PM
Well, you could start by providing us with the error you are receiving. First guess would be that "id" is not an existing column in the table you are attempting to access, else I am not certain but I would guess that "id" is a keyword in the SQL language, perhaps you should try "[id]".

sirpelidor
01-17-2006, 03:57 PM
SelectCmd = "select * from table1 where id = 'test'"

am I safe to assume id is an integer, not a string?

juicemousezero
01-17-2006, 04:05 PM
Seems a bit too obvious... but who knows?