D daveinhull Active Member Licensed User Longtime User Oct 1, 2016 #1 Hi all, I'm having real problems with a select query not working. The table is created Code: Copy sql1.ExecNonQuery("CREATE TABLE table1 (auto1 INTEGER PRIMARY KEY, col1 TEXT , col2 TEXT , col3 INTEGER, col4 INTEGER)") And I'm trying to use this select query Code: Copy myCursor = sql1.ExecQuery("SELECT Col2, Col3, Col4 FROM table1 WHERE auto1 = 7") The actual table has an entry with auto1 = 7, but the query doesn't return any records. I just can't see what I'm doing wrong, any thoughts anyone? Thanks
Hi all, I'm having real problems with a select query not working. The table is created Code: Copy sql1.ExecNonQuery("CREATE TABLE table1 (auto1 INTEGER PRIMARY KEY, col1 TEXT , col2 TEXT , col3 INTEGER, col4 INTEGER)") And I'm trying to use this select query Code: Copy myCursor = sql1.ExecQuery("SELECT Col2, Col3, Col4 FROM table1 WHERE auto1 = 7") The actual table has an entry with auto1 = 7, but the query doesn't return any records. I just can't see what I'm doing wrong, any thoughts anyone? Thanks
klaus Expert Licensed User Longtime User Oct 1, 2016 #2 Are you sure that auto1 = 7 in your database ? Where, when and how did you add the entry. The easiest way for us to help would be if you posted a small project showing the problem. Upvote 0
Are you sure that auto1 = 7 in your database ? Where, when and how did you add the entry. The easiest way for us to help would be if you posted a small project showing the problem.
D daveinhull Active Member Licensed User Longtime User Oct 1, 2016 #3 Hi Klaus, Thanks for the reply, but I've just worked out what I was doing wrong. I wasn't setting the cursor position before trying to access the data. Habit of MS Access where the returned pointer is at the first record. All sorted now. Thanks Upvote 0
Hi Klaus, Thanks for the reply, but I've just worked out what I was doing wrong. I wasn't setting the cursor position before trying to access the data. Habit of MS Access where the returned pointer is at the first record. All sorted now. Thanks