提前道歉 - 我是视觉工作室的新手(和一般编程)
我正在尝试使用以下代码填充两个访问表房东和财产-但我不断收到
" SQL 语句末尾缺少分号 (;)。"
有什么建议么 ?这是代码:
Dim aConnection As OleDbConnection
Dim aCommand As OleDbCommand
Dim aConnectionString, aQuery As String
Dim Username As String = txtUsername.Text
Dim Pword As String = TextBox2.Text
Dim EmailDetails As String = TextBox9.Text
Dim Question As String = DropDownList2.Text
Dim Answer As String = TextBox4.Text
aConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = " _
& Server.MapPath("AppData/RMT.accdb")
aConnection = New OleDbConnection(aConnectionString)
aConnection.Open()
aQuery = "Insert Into Landlord (Username, email, Security_Question, Security_Answer, Pword, Status) Values ('" & Username & "','" & EmailDetails & "','" & Question & "','" & Answer & "', '" & Pword & "','pending')Into Property Values (26,46,'marysway','MarysRd','Marysville','Cork North')"
aCommand = New OleDbCommand(aQuery, aConnection)
aCommand.ExecuteNonQuery()
aConnection.Close()