ADO操作存储过程(VB)

Dim adoConnaction as new adodb.connaction

Dim adoCommand as new adodb.Command

Dim adoRecordset as new adodb,Recordset

Dim strConnaction as string

'数据库连接

strConnaction = "Driver={sql server};server=server name;uid=;pwd=;database=db name;"

adoConnaction.open strConnaction

adoConnaction.CursorLocation= adUseClient

'Command和Recordset对象设置

adoCommand.activeConnaction=adoConnaction

adoCommand.commandtype=adCmdStoreProc

adoCommand.commandText="storeprocedure name"

'------------------------

adoCommand.Parameter(?).type=???

adoCommand.Parameter(?).Value

'------------------------

set adoRecordset = adoCommand.Execute

'使用adoRecrdset

'.........

'关闭ado

你可能感兴趣的:(Coding)