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
VB 调用ACCESS储存源码
最新推荐文章于 2018-08-23 10:41:25 发布