F fanfalveto Active Member Licensed User Longtime User Nov 20, 2012 #1 I have a database with several fields. To row 250 the program reads well, but ignores 251 onwards. please if you can help? thanks
I have a database with several fields. To row 250 the program reads well, but ignores 251 onwards. please if you can help? thanks
margret Well-Known Member Licensed User Longtime User Nov 20, 2012 #2 How many fields are in each row? You say you can read up to 250, how are you doing that, can you post the code that reads the rows? Upvote 0
How many fields are in each row? You say you can read up to 250, how are you doing that, can you post the code that reads the rows?
F fanfalveto Active Member Licensed User Longtime User Nov 20, 2012 #3 in globlals Code: Copy dim preg as int=1 In activity_create Code: Copy If FirstTime = True AND File.Exists(File.DirInternal, "base.db") = False Then File.Copy(File.DirAssets, "base.db", File.DirInternal, "base.db") End If SQL1.Initialize(File.DirInternal, "base.db", True) then Code: Copy Sub juego Label8.Text=preg Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i la1=(Cursor1.GetString("pregunta")) r1=(Cursor1.GetString("r1")) r2=(Cursor1.GetString("r2")) r3=(Cursor1.GetString("r3")) r4=(Cursor1.GetString("r4")) If pos=1 Then Label1.Text=la1 Label2.Text=r1 Label3.Text=r2 Label4.Text=r3 Label5.text=r4 Else If pos =2 Then Label1.Text=la1 Label3.Text=r1 Label4.Text=r2 Label5.Text=r3 Label2.text=r4 Else If pos =3 Then Label1.Text=la1 Label4.Text=r1 Label5.Text=r2 Label2.Text=r3 Label3.text=r4 Else If pos =4 Then Label1.Text=la1 Label5.Text=r1 Label2.Text=r2 Label3.Text=r3 Label4.text=r4 End If Next Cursor1.Close Label7.Text="Nivel: "&nive Label6.Text="Puntos: "&punto Label9.Text="Fallos: "&fallo End Sub if click a button then Code: Copy preg=preg+1 Upvote 0
in globlals Code: Copy dim preg as int=1 In activity_create Code: Copy If FirstTime = True AND File.Exists(File.DirInternal, "base.db") = False Then File.Copy(File.DirAssets, "base.db", File.DirInternal, "base.db") End If SQL1.Initialize(File.DirInternal, "base.db", True) then Code: Copy Sub juego Label8.Text=preg Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i la1=(Cursor1.GetString("pregunta")) r1=(Cursor1.GetString("r1")) r2=(Cursor1.GetString("r2")) r3=(Cursor1.GetString("r3")) r4=(Cursor1.GetString("r4")) If pos=1 Then Label1.Text=la1 Label2.Text=r1 Label3.Text=r2 Label4.Text=r3 Label5.text=r4 Else If pos =2 Then Label1.Text=la1 Label3.Text=r1 Label4.Text=r2 Label5.Text=r3 Label2.text=r4 Else If pos =3 Then Label1.Text=la1 Label4.Text=r1 Label5.Text=r2 Label2.Text=r3 Label3.text=r4 Else If pos =4 Then Label1.Text=la1 Label5.Text=r1 Label2.Text=r2 Label3.Text=r3 Label4.text=r4 End If Next Cursor1.Close Label7.Text="Nivel: "&nive Label6.Text="Puntos: "&punto Label9.Text="Fallos: "&fallo End Sub if click a button then Code: Copy preg=preg+1
margret Well-Known Member Licensed User Longtime User Nov 20, 2012 #4 Replace your sub with this or just add the two logging lines marked with comments to yours. Run the app and see what the log shows: Code: Copy Sub juego Label8.Text=preg Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) Log(Cursor1.RowCount - 1) 'Added for logging For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i Log(Cursor1.Position) 'Added for logging la1=(Cursor1.GetString("pregunta")) r1=(Cursor1.GetString("r1")) r2=(Cursor1.GetString("r2")) r3=(Cursor1.GetString("r3")) r4=(Cursor1.GetString("r4")) If pos=1 Then Label1.Text=la1 Label2.Text=r1 Label3.Text=r2 Label4.Text=r3 Label5.text=r4 Else If pos =2 Then Label1.Text=la1 Label3.Text=r1 Label4.Text=r2 Label5.Text=r3 Label2.text=r4 Else If pos =3 Then Label1.Text=la1 Label4.Text=r1 Label5.Text=r2 Label2.Text=r3 Label3.text=r4 Else If pos =4 Then Label1.Text=la1 Label5.Text=r1 Label2.Text=r2 Label3.Text=r3 Label4.text=r4 End If Next Cursor1.Close Label7.Text="Nivel: "&nive Label6.Text="Puntos: "&punto Label9.Text="Fallos: "&fallo End Sub Upvote 0
Replace your sub with this or just add the two logging lines marked with comments to yours. Run the app and see what the log shows: Code: Copy Sub juego Label8.Text=preg Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) Log(Cursor1.RowCount - 1) 'Added for logging For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i Log(Cursor1.Position) 'Added for logging la1=(Cursor1.GetString("pregunta")) r1=(Cursor1.GetString("r1")) r2=(Cursor1.GetString("r2")) r3=(Cursor1.GetString("r3")) r4=(Cursor1.GetString("r4")) If pos=1 Then Label1.Text=la1 Label2.Text=r1 Label3.Text=r2 Label4.Text=r3 Label5.text=r4 Else If pos =2 Then Label1.Text=la1 Label3.Text=r1 Label4.Text=r2 Label5.Text=r3 Label2.text=r4 Else If pos =3 Then Label1.Text=la1 Label4.Text=r1 Label5.Text=r2 Label2.Text=r3 Label3.text=r4 Else If pos =4 Then Label1.Text=la1 Label5.Text=r1 Label2.Text=r2 Label3.Text=r3 Label4.text=r4 End If Next Cursor1.Close Label7.Text="Nivel: "&nive Label6.Text="Puntos: "&punto Label9.Text="Fallos: "&fallo End Sub
F fanfalveto Active Member Licensed User Longtime User Nov 20, 2012 #5 I don´t know only see in log 0 when program runs to row 250 and after -1. may be is problen the program to make the database don´t make more than 250 rows.i do that with sqlite expert Upvote 0
I don´t know only see in log 0 when program runs to row 250 and after -1. may be is problen the program to make the database don´t make more than 250 rows.i do that with sqlite expert
margret Well-Known Member Licensed User Longtime User Nov 20, 2012 #6 If the first line logged says 0, then you have an empty database. It should log the number of records in the database file. You certianly should check on how the file is being created. Upvote 0
If the first line logged says 0, then you have an empty database. It should log the number of records in the database file. You certianly should check on how the file is being created.
margret Well-Known Member Licensed User Longtime User Nov 20, 2012 #7 Change or comment your code line like below. Now run and see what the log shows. Code: Copy Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) 'Change above line to this for a test. Then run and see what the log shows. Cursor1=SQL1.ExecQuery ("SELECT * FROM table1") Upvote 0
Change or comment your code line like below. Now run and see what the log shows. Code: Copy Cursor1=SQL1.ExecQuery("SELECT pregunta,r1,r2,r3,r4 FROM table1 WHERE id=" &preg) 'Change above line to this for a test. Then run and see what the log shows. Cursor1=SQL1.ExecQuery ("SELECT * FROM table1")
F fanfalveto Active Member Licensed User Longtime User Nov 20, 2012 #8 the data base is not empty,i play the game to row 250 and it´s ok,i see the database in dat/data/myprogram/files and only there are 250 rows. sure is a problem whit sql expert,i try to create another database from 251 to 500 or use another application to create. Upvote 0
the data base is not empty,i play the game to row 250 and it´s ok,i see the database in dat/data/myprogram/files and only there are 250 rows. sure is a problem whit sql expert,i try to create another database from 251 to 500 or use another application to create.
margret Well-Known Member Licensed User Longtime User Nov 20, 2012 #9 OK, so it seems you have found the issue? Is that correct? Upvote 0
F fanfalveto Active Member Licensed User Longtime User Nov 20, 2012 #10 well i don´t know i try to make another database. if i can´t do then post again for help. Thank you very much Upvote 0
well i don´t know i try to make another database. if i can´t do then post again for help. Thank you very much