Fill db colomns

parijs

Active Member
Licensed User
Longtime User
Hi,

This my code:


id = "Null"
keuze =main.keuze
FotoUrl = main.FotoUrl
MapNaam = main.MapNaam
lat = main.lat
lon = main.lon
pic = main.pic
picbit = main.pic
textpage = main.textpage
textpage2 = main.textpage2
ster = main.ster
wijk = main.wijk
blad = main.blad
naar = main.naar
geenknop = main.geenknop
leeg = "leeg"
leeg2 = "emty"

SQL.ExecNonQuery2("INSERT INTO favo VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", _
Array As String(keuze, FotoUrl, MapNaam, lat, lon, pic, picbit, textpage, textpage2, ster, wijk, blad, naar, geenknop, leeg, leeg2))


And those are my problems:
my db has a Field 'Id' but my code change it in 'id'
I get the error table favo has 18 columns but 16 values were suppleid
when I press Yes for Continue no new data is store in the db.
The 2 not suppleid are the Id and the Recno (which I have not created)

Whats wrong?
 

bees

Member
Licensed User
Longtime User
Hi,

This my code:

SQL.ExecNonQuery2("INSERT INTO favo VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", _
Array As String(keuze, FotoUrl, MapNaam, lat, lon, pic, picbit, textpage, textpage2, ster, wijk, blad, naar, geenknop, leeg, leeg2))


And those are my problems:
my db has a Field 'Id' but my code change it in 'id'
I get the error table favo has 18 columns but 16 values were suppleid
when I press Yes for Continue no new data is store in the db.
The 2 not suppleid are the Id and the Recno (which I have not created)

Whats wrong?

Show the query on how you created the db.

You could try:
SQL.ExecNonQuery2("INSERT INTO favo (Kolomnaam1, Kolomnaam 2, etc..) VALUES(" & keuze & "," & FotoUrl & "," &etc & ")"

Or when using an Array you should use Array as Object(...) as I assume that not all variables are strings. If you use ? then you must supply it for all the columns in the table.

Groeten,

Stephen
 
Upvote 0
Top