何度も何度もエラーが発生します。INSERT ステートメントの何が問題なのか誰か教えてもらえますか?
これが私のコードです:
Dim SQLcon As New OleDbConnection
Dim SQLdr As OleDbDataReader
Try
SQLcon.ConnectionString = "Provider=Microsoft.ACE.OleDb.12.0;" & _
"Data Source= C:\Users\cleanfuel\Desktop\ProgramniOrig\DBhospital.accdb"
Dim SQLcmd As New OleDbCommand("INSERT INTO tblLogin (Username,Password,SecretQuestion,SecretAnswer)" & _
"VALUES(@Username,@Password,@SecretQuestion,@SecretAnswer)", SQLcon)
SQLcmd.Parameters.AddWithValue("@Username", txtUser.Text)
SQLcmd.Parameters.AddWithValue("@Password", txtPass.Text)
SQLcmd.Parameters.AddWithValue("@SecretQuestion", txtSecretQ.Text)
SQLcmd.Parameters.AddWithValue("@SecretAnswer", txtSecretA.Text)
SQLcon.Open()
MsgBox("Patient Added!", MsgBoxStyle.Information)
SQLdr = SQLcmd.ExecuteReader()
Catch ex As Exception
MessageBox.Show("Error Occured, Can't Register!" & ex.Message)
Finally
SQLcon.Close()
End Try
Return ""