帮忙来看看这段怎么改
Private Sub Command1_Click()'Dim conn As New ADODB.Connection
Dim rs_mima As New ADODB.Recordset
Dim strSQL As String
Dim sql As String
strSQL = "select * from 用户信息表 where 用户名='" & Trim$(Text1.Text) & "' and 密码='" & Trim$(Text2.Text) & "' "
conn.Open strSQL, conn, 1, 1
'"provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path & "dsn=huangchen"
If Trim(Text1.Text) <> Trim(Text2.Text) Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Exit Sub
Else
sql = "select * from 用户信息表 where 用户名='" & 用户名 & "'"
rs_mima.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_mima.Fields(1) = Text1.Text
rs_mima.Update
MsgBox "密码修改成功", vbOKOnly + vbExclamation, ""
Unload Me
End If
End Sub
我想用这段代码修改密码,但是不知道怎么连接数据库,我用的数据库是SQL server 2000 ,各位高手帮帮忙,谢谢,好象是红色那句有问题.b
[[it] 本帖最后由 huangchen 于 2008-11-13 23:30 编辑 [/it]]