Data type mismatch in criteria expression.

Lums

Member
Joined
Feb 9, 2010
Messages
22
Programming Experience
Beginner
i have a form, which is used to mark students work, each student has an id (upn) and each test has an id and to comment on the students performance on the test, the teacher enters a comment which is linked by test and student id. this is because the same student can do different tests and have different comments and different students can do the same test and have the same comments.. does anyone know how i can work around this error

ab6rt2.png

con4.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = f:\Docs\College\Computing\CW\Form\VB Forms\VB Forms\Database Design.mdb"
con4.Open()
sql4 = "SELECT [Comments].Comment FROM [Comments] WHERE [Comments].UPN = '" & upnpass & "' AND [Comments].TestID ='" & idpass & "';"
da4 = New OleDb.OleDbDataAdapter(sql4, con4)
da4.Fill(ds4, "info")
con4.Close()
maxrows4 = ds4.Tables("info").Rows.Count
commentbx.Text = ds4.Tables("info").Rows(inc4).Item(0)
 
Is TestID setup up as a numeric? Your SQL suggests that it is character data but TestID suggests that it is numeric in nature.
 
Back
Top