|
-
Jun 20th, 2015, 07:42 AM
#1
Thread Starter
Junior Member
INSERT Command Problems
Hi,
I can't figure out why I get the error "datatype mismatch in criteria expression"
This is my script:
Code:
Using meldingcmd As OleDbCommand = New OleDbCommand
Make_con()
With meldingcmd
.Parameters.Clear()
.Connection = con
.CommandText = "INSERT INTO Meldingen (Weg_ID,Onderdeel,Dringendheid,Beginlat,Beginlong,Eindlat,Eindlong,Afstand,Opmerkingen,Datum) VALUES (?,?,?,?,?,?,?,?,?,?);"
.Parameters.AddWithValue("@p1", Convert.ToInt32(current_weg_Id))
.Parameters.AddWithValue("@p2", Onderdeel_CBX.Text)
.Parameters.AddWithValue("@p3", Dringendheid_CBX.Text)
.Parameters.AddWithValue("@p4", Convert.ToDecimal(BeginLAT_T.Text))
.Parameters.AddWithValue("@p5", Convert.ToDecimal(BeginLONG_T.Text))
.Parameters.AddWithValue("@p6", Convert.ToDecimal(EindLAT_T.Text))
.Parameters.AddWithValue("@p7", Convert.ToDecimal(EindLONG_T.Text))
.Parameters.AddWithValue("@p8", Convert.ToDecimal(Afstand_T.Text))
.Parameters.AddWithValue("@p9", Melding_opmerking_T.Text)
.Parameters.AddWithValue("@p10", Date.Now())
.ExecuteNonQuery()
End With
con.Close()
End Using
And my fields have been defined in Access as
current_weg_ID = Number, Long Integer
Onderdeel = Text
Dringendheid = Text
Beginlat,Beginlong,Eindlat,Eindlong,Afstand = Number, Decimal
Opmerkingen = Memo
Datum = Date/Time, Standard notation.
Can anybody help me...it's driving me nuts at this moment :-)
Grtz and thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|