Problem getting information from a database. [modified]
-
Edit: Bah. problem has been fixed. -- Hi, I have a slight problem with getting records from a database. The problem is simply when I use the following SQL string, it throws me up an error message. Problem string: "SELECT * FROM IDs WHERE id='2'" However when I use this SQL string, it works. Working SQL string: "SELECT * FROM IDs WHERE name='bob'" I have no idea why one is working and the other isn't. The only thing I could think of is a type mismatch (The id field is set to AutoNumber). I get the same error when trying to use both Strings and Integers. Anyone have any ideas? - Munty -- modified at 10:20 Thursday 26th July, 2007
-
Edit: Bah. problem has been fixed. -- Hi, I have a slight problem with getting records from a database. The problem is simply when I use the following SQL string, it throws me up an error message. Problem string: "SELECT * FROM IDs WHERE id='2'" However when I use this SQL string, it works. Working SQL string: "SELECT * FROM IDs WHERE name='bob'" I have no idea why one is working and the other isn't. The only thing I could think of is a type mismatch (The id field is set to AutoNumber). I get the same error when trying to use both Strings and Integers. Anyone have any ideas? - Munty -- modified at 10:20 Thursday 26th July, 2007
-
Muntyness wrote:
it throws me up an error message
What error message it return?
I Love SQL
-
Edit: Bah. problem has been fixed. -- Hi, I have a slight problem with getting records from a database. The problem is simply when I use the following SQL string, it throws me up an error message. Problem string: "SELECT * FROM IDs WHERE id='2'" However when I use this SQL string, it works. Working SQL string: "SELECT * FROM IDs WHERE name='bob'" I have no idea why one is working and the other isn't. The only thing I could think of is a type mismatch (The id field is set to AutoNumber). I get the same error when trying to use both Strings and Integers. Anyone have any ideas? - Munty -- modified at 10:20 Thursday 26th July, 2007
Have you tried:
"SELECT * FROM IDs WHERE id=2"