tufanv Expert Licensed User Longtime User Jul 20, 2013 #1 Hello, I have 3 records in my sql file. When i use cursor1.position = 0 i can get the values from fields of record 1 but when i use cursor1.position = 1 i can not get the values of fields of record 2. it gives outofbounds error. What is the problem with my code any ideas ? TY
Hello, I have 3 records in my sql file. When i use cursor1.position = 0 i can get the values from fields of record 1 but when i use cursor1.position = 1 i can not get the values of fields of record 2. it gives outofbounds error. What is the problem with my code any ideas ? TY
NJDude Expert Licensed User Longtime User Jul 20, 2013 #2 Having 3 records is not the issue, the issue here is how many records does your query return? maybe is just returning 1 record. Upvote 0
Having 3 records is not the issue, the issue here is how many records does your query return? maybe is just returning 1 record.
tufanv Expert Licensed User Longtime User Jul 20, 2013 #3 I have 3 different products and each of the product have their own specifications under the fields of weight size price and id. when I click on priduct 1 in my app I want ti get the field values of priduct 1 and I can get it when cursor position is 0. But I can not get the values of product 2 and 3 when I click on them. Hope I explained clearly Upvote 0
I have 3 different products and each of the product have their own specifications under the fields of weight size price and id. when I click on priduct 1 in my app I want ti get the field values of priduct 1 and I can get it when cursor position is 0. But I can not get the values of product 2 and 3 when I click on them. Hope I explained clearly
klaus Expert Licensed User Longtime User Jul 20, 2013 #4 Without seeing your code and an example of your database almost impossible to help you. Post your project as a zip file so we could have a look at. After the Query what value does Cursor.Size have ? Best regards. Upvote 0
Without seeing your code and an example of your database almost impossible to help you. Post your project as a zip file so we could have a look at. After the Query what value does Cursor.Size have ? Best regards.
tufanv Expert Licensed User Longtime User Jul 20, 2013 #5 I will post it here when I got home. Thank you Upvote 0
tufanv Expert Licensed User Longtime User Jul 20, 2013 #6 By the way cursor1 size is 1 if I am not mistaken Upvote 0
klaus Expert Licensed User Longtime User Jul 20, 2013 #7 If Cursor.Size = 1 that means you have only 1 record as an answer to the query. So only Cursor.Position = 0 is valid ! Best regards. Upvote 0
If Cursor.Size = 1 that means you have only 1 record as an answer to the query. So only Cursor.Position = 0 is valid ! Best regards.
tufanv Expert Licensed User Longtime User Jul 20, 2013 #8 oh. got the problem. the sql file is not updated via application installs because it exists and the file is not overwrittenm. When i uninstall the app and reinstall problem resolved. (the older version had only 1 record and was not updated ) TY ! Upvote 0
oh. got the problem. the sql file is not updated via application installs because it exists and the file is not overwrittenm. When i uninstall the app and reinstall problem resolved. (the older version had only 1 record and was not updated ) TY !
Wien.Mart Member Licensed User Longtime User Nov 28, 2013 #9 I have the same problem. I query one record and want to populate text boxes with the query result. I issue the same sql on the sqlite using sqlite database browser and it returns one set of records with about thirty fields. qcur=sql1.execquery("select * from table where id = 10") there is no error. when i do lname.text = qcur.getstring("last_name") i get the error "lastexception android.database.cursorindexoutofboundsexception: index-1 requested. with size of 1" What could i be doing wrong? Please help. Upvote 0
I have the same problem. I query one record and want to populate text boxes with the query result. I issue the same sql on the sqlite using sqlite database browser and it returns one set of records with about thirty fields. qcur=sql1.execquery("select * from table where id = 10") there is no error. when i do lname.text = qcur.getstring("last_name") i get the error "lastexception android.database.cursorindexoutofboundsexception: index-1 requested. with size of 1" What could i be doing wrong? Please help.
klaus Expert Licensed User Longtime User Nov 28, 2013 #10 Did you set the cursor position ? Code: qcur=sql1.execquery("select * from table where id = 10") qcur.Position = 0 lname.text = qcur.getstring("last_name") Upvote 0
Did you set the cursor position ? Code: qcur=sql1.execquery("select * from table where id = 10") qcur.Position = 0 lname.text = qcur.getstring("last_name")
Wien.Mart Member Licensed User Longtime User Nov 28, 2013 #11 Thank you Klaus. Is this the equivalent of movefirst in vb6? Upvote 0
klaus Expert Licensed User Longtime User Nov 28, 2013 #12 SORRY, I don't know. I've never worked with datbases in VB6. Upvote 0