I am creating a program that uses the SQLite database a lot and have come across a problem where the HorseFileName TABLE is Created but Data will not save to the HorseFileName Table.
I have put the code from the main app I am creating into a small prog to test it for errors but just can not see where I have it wrong as it runs through the debug line by line until the cmd.ExecNonQuery and then drops through to the error.
Maybe someone may see something I do not see in my code.
Thanks for any help.
It is this sub that it stops working in the error trap.
The full code is attached as I abbreviated the above because of the size of code.
Had problems with the other table RaceFileName originally but found the problems I had there and it now is working OK.
I have been using sqliteadmin program to examine the tables for input and so verifying if data has been added.
I have put the code from the main app I am creating into a small prog to test it for errors but just can not see where I have it wrong as it runs through the debug line by line until the cmd.ExecNonQuery and then drops through to the error.
Maybe someone may see something I do not see in my code.
Thanks for any help.
It is this sub that it stops working in the error trap.
B4X:
Public Sub [B]SaveHorseListData[/B]
ErrorLabel(HseListErr)
' create parameters
cmd.AddParameter("RaceID")
cmd.AddParameter("TAB")
cmd.AddParameter("HorseName")
cmd.AddParameter("E")
.....
.....
cmd.CommandText = "INSERT INTO " & HorseFileName & " (HID, RaceID, TAB, HorseName, E, Cty, ThisForm, " & _
"Barrier, NewBar, Weight, FWD, WDOds, FWW, WWOds, FSD, SDOds, FSW, SWOds, AdjRate, HorseAge, HorseType, " & _
"HorseSex, HorseTrainer, HorseTrainerLoc, Jockey, Allow, QTABJock, Career, Runs, Ws, Ps, APIs, " & _
"CurAPIs, WinDist, ThisDist, ThisCourse, Fast, Good, Dead, Slow, Heavy, FUp, SUp, ThisDistPC, " & _
"ThisCoursePC, FastPC, GoodPC, DeadPC, SlowPC, HeavyPC, FUpPC, SUpPC, DLS, Breed, Owner, Silks, " & _
"RunsBack, RBLetUp, WRPos, SRPos, PcePos, APIPos, PsPos, WsPos, DDist, DWgt, HPace, BlkBk, FS) " & _
"VALUES (null, @RaceID, @TAB, @HorseName, @E, @Cty, @ThisForm, @Barrier, @NewBar, @Weight, @FWD, @WDOds, " & _
"@FWW, @WWOds, @FSD, @SDOds, @FSW, @SWOds, @AdjRate, @HorseAge, @HorseType, @HorseSex, @HorseTrainer, " & _
"@HorseTrainerLoc, @Jockey, @Allow, @QTABJock, @Career, @Runs, @Ws, @Ps, @APIs, @CurAPIs, @WinDist, " & _
"@ThisDist, @ThisCourse, @Fast, @Good, @Dead, @Slow, @Heavy, @FUp, @SUp, @ThisDistPC, @ThisCoursePC, " & _
"@FastPC, @GoodPC, @DeadPC, @SlowPC, @HeavyPC, @FUpPC, @SUpPC, @DLS, @Breed, @Owner, @Silks, @RunsBack, " & _
"@RBLetUp, @WRPos, @SRPos, @PcePos, @APIPos, @PsPos, @WsPos, @DDist, @DWgt, @HPace, @BlkBk, @FS)"
cmd.SetParameter("RaceID", RHse.RaceID)
cmd.SetParameter("TAB", RHse.TAB)
cmd.SetParameter("HorseName", RHse.HorseName)
cmd.SetParameter("E", RHse.E)
cmd.SetParameter("Cty", RHse.Cty)
cmd.SetParameter("ThisForm", RHse.ThisForm)
....
....
cmd.ExecuteNonQuery
Return
HseListErr:
Msgbox("Adding Horse to Database failed!", "Horse Error", cMsgboxOK, cMsgboxHand)
Return
End Sub
The full code is attached as I abbreviated the above because of the size of code.
Had problems with the other table RaceFileName originally but found the problems I had there and it now is working OK.
I have been using sqliteadmin program to examine the tables for input and so verifying if data has been added.