关于数据库查询的问题
这是我做的查询功能,哪位大虾告诉我一下,为什么当我查出记录以后仍然弹出对话框呢?On Error GoTo err1
Set i = New ADODB.Connection
Set j = New ADODB.Recordset
Dim mysql As String
Select Case a
Case 1
mysql = "select * from yh where yhm='" & Trim(Text3.Text) & "'"
Case 2
mysql = "select * from yh where mm='" & Trim(Text3.Text) & "'"
End Select
i.ConnectionString = "provider=sqloledb.1;data source=(local);user id=sa;pwd=247162545;initial catalog=sdb"
i.Open
j.Open mysql, i, adOpenStatic, adLockOptimistic
Set MSHFlexGrid1.DataSource = j
showdata
err1:
MsgBox Err.Description