vb Set rst = con.Execute("select * from 用户信息 where 姓名 like '" & Text1.Text & "'")类型不匹配
来源:百度知道 编辑:UC知道 时间:2024/05/26 04:37:30
Private Sub Command1_Click()
Dim rst As Recordset
Dim con As New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\用户信息\用户信息.mdb;Persist Security Info=False"
con.Open
Set rst = con.Execute("select * from 用户信息 where 姓名 like '" & Text1.Text & "'")
If Not rst.EOF Then
con.Execute "update from 用户信息 where 密码 like '" & Text2.Text & "'"
MsgBox "修改成功!"
Adodc1.Refresh
Adodc1.Recordset.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End Sub
为什么这段代码老提示我类型不匹配~谁能帮忙解答一下吗
Dim rst As Recordset
Dim con As New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\用户信息\用户信息.mdb;Persist Security Info=False"
con.Open
Set rst = con.Execute("select * from 用户信息 where 姓名 like '" & Text1.Text & "'")
If Not rst.EOF Then
con.Execute "update from 用户信息 where 密码 like '" & Text2.Text & "'"
MsgBox "修改成功!"
Adodc1.Refresh
Adodc1.Recordset.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End Sub
为什么这段代码老提示我类型不匹配~谁能帮忙解答一下吗
给我邮箱 我发给你QQ892113807
1. Dim rst As Recordset 改成 Dim New rst As ADODB.Recordset
2. Set rst = con.Execute("select * from 用户信息 where 姓名 like '" & Text1.Text & "'") 改成 Set rst = con.Execute("select * from 用户信息 where 姓名 like " & "'%" & Text1.Text & "%'" )
Like须和"%"一起使用
---------------------------
完整的代码
Private Sub Command1_Click()
Dim rst As New ADODB.Recordset
Dim con As New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\用户信息\用户信息.mdb;Persist Security Info=False"
con.Open
Set rst = con.Execute("select * from 用户信息 where 姓名 like '%" & Text1.Text & "%'")
If Not rst.EOF Then
con.Execute "update from 用户信息 where 密码 like '%" & Text2.Text & "%'"
MsgBox "修改成功!"
Adodc1.Refresh
Adodc1.Re
set rst=connection.execute错误,大家帮忙!!
set rst=Server.CreateObject("ADODB.recordset")这句话什么意思
vb询 Set cn = New ADODB.Connection
rc=rst.recordcount这句里的recordcount
VB中什么是SET语句
Vb 用MDI窗口set a= new form 的问题
ASP问题<%=rst(""%) 在线等答案
update tableA set a=b from tableB where tableA.c=tableB.c
set conn=nothing
update lat_store set c_name1=b.c_sname ,c_name2=c.c_sname