|
谁可以加下注释,解析下~~最好每一句都有
先谢谢啦~~
Dim mdbcn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim sn As New ADODB.Recordset
Dim Par As ADODB.Parameter,str As String
mdbcn.CursorLocation = adUseClient
mdbcn.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);UID=admin;DBQ=你的数据库"
mdbcn.Open
cmd.CommandText = "你的查询名"
cmd.CommandType = adCmdStoredProc
str = InputBox("输入参数值:")
Set Par = cmd.CreateParameter("", adVarChar, adParamInput, 200)
cmd.Parameters.Append Par
Par.Value = str
Set cmd.ActiveConnection = mdbcn
Set sn = cmd.Execute
MsgBox sn.RecordCount
Set sn = Nothing: Set cmd = Nothing
Set mdbcn = Nothing |
|