I'm inputting student records but i get this error
And i even built a exe of my project and the inputs are in different fields
here's my input code
And i even built a exe of my project and the inputs are in different fields
here's my input code
VB.NET:
Public Sub DbCon()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\proj\Module_1_Encoder\enrollment.mdb"
con.Open()
sql = "SELECT StudNum, MName, LName, FName, Address, SchoolYr, Mother, Father, Gender, BPBD, Religion, DateEntered, MOccupation, FOccupation, Guardian, Height, Weight, Age, Mobile, Phone, YearLvl FROM tblStudent"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "tblStudent")
con.Close()
End Sub
VB.NET:
DbCon()
con.Open()
sql = "insert into tblStudent values('" & StudNumMaskedTextBox.Text & "','" & MNameTextBox.Text & _
"','" & LNameTextBox.Text & "','" & FNameTextBox.Text & "','" & AddressTextBox.Text & _
"','" & SchoolYrTextBox.Text & "','" & MotherTextBox.Text & "','" & FatherTextBox.Text & _
"','" & GenderTextBox.Text & "','" & BPBDTextBox.Text & "','" & ReligionTextBox.Text & _
"','" & DateEnteredTextBox.Text & "','" & MOccupationTextBox.Text & "','" & FOccupationTextBox.Text & _
"','" & GuardianTextBox.Text & "','" & HeightTextBox.Text & "','" & WeightTextBox.Text & _
"','" & AgeTextBox.Text & "','" & MobileMaskedTextBox.Text & "','" & PhoneMaskedTextBox.Text & _
"','" & YearLvlTextBox.Text & "')"
cm.CommandText = sql
cm = New OleDb.OleDbCommand(sql, con)
cm.ExecuteNonQuery()
con.Close()
MsgBox("Encoded")
Me.Close()