我正在尝试使用查询从数据库中选择一行 但问题似乎出现在这行代码中:
access.execquery("SELECT Customer_Table.* FROM Customer_Table WHERE (Customer_ID LIKE @CustomerID )")
整个子程序如下:
Private Sub selectuser(CustomerID As String)
'Query User
access.addparam("@CustomerID", CustomerID)
access.execquery("SELECT Customer_Table.* FROM Customer_Table WHERE (Customer_ID LIKE @CustomerID )")
'Report and Errors or no record found
If NotEmpty(access.exception) OrElse access.Recordcount < 1 Then MsgBox(access.exception) : Exit Sub
'Get First From Found
Dim r As DataRow = access.DBDT.Rows(0)
'Populate textboxs with data
TextBox2.Text = r("Customer_ID").ToString
TextBox3.Text = r("Company_Name").ToString
'Enable Delete Button
NewCustomerToolStripMenuItem.Enabled = True
End Sub
每当我执行程序时,它都会以空错误消息终止。