VB 中 select 语句 出现 FROM子句语法错误 下面是代码 15
DimconnAsNewADODB.ConnectionDimrsAsNewADODB.RecordsetPrivateSubForm_Load()conn.Connec...
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "db1.mdb;Persist Security Info=False"
conn.Open
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set conn = Nothing
conn.Close
End Sub
Private Sub Text1_LostFocus()
If Text1.Text <> "" Then
Set rs = conn.Execute("Select * form 家具材质代码表 where 材质 = '" & Text1.Text & "'")
If rs.RecordCount = 0 Then
Set rs = Nothing
rs.Close
End If
rs.MoveFirst
Text2.Text = rs(" 代码")
Set rs = Nothing
rs.Close
End If
End Sub 展开
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "db1.mdb;Persist Security Info=False"
conn.Open
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set conn = Nothing
conn.Close
End Sub
Private Sub Text1_LostFocus()
If Text1.Text <> "" Then
Set rs = conn.Execute("Select * form 家具材质代码表 where 材质 = '" & Text1.Text & "'")
If rs.RecordCount = 0 Then
Set rs = Nothing
rs.Close
End If
rs.MoveFirst
Text2.Text = rs(" 代码")
Set rs = Nothing
rs.Close
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询