程序如下
Private Sub Command1_Click()
Dim p As String
p = str(Text1.Text)
Adodc1.RecordSource = "select * from sheet where name=" & p & ""
Adodc1.Refresh
End Sub
提示类型不匹配,或者提示有参数未指定值,急,在线等,望尽快回答
Private Sub Command1_Click()
Dim p As String
p = str(Text1.Text)
Adodc1.RecordSource = "select * from sheet where name=" & p & ""
Adodc1.Refresh
End Sub
提示类型不匹配,或者提示有参数未指定值,急,在线等,望尽快回答
如果你的name字段是文本型的,那么应该写成 name='" & trim(p) & "'"
p = str(Text1.Text) 第二行只能改为 p=trim(Text1.Text)str涵数是将数值转为文字, 而p你已宣告为文字,所以第二行你这样写肯定出错如果
Dim p as Integer
则 p= val(text1.text)