VB如何调用mysql的存储过程
比如数据库里有glry这样的一个表,定义如下:
create table if not exists glry (
id int auto_increment not null ,
GONGHAO char(6) not null,
primary key (id) )
我建了如下的存储过程:
create procedure a(in b char(6))
select * from glry where GONGHAO=b
在VB中我怎么条用这个存储过程?
按照网上的资料我这样做的,建立好连接然后
Dim objCmd As ADODB.Command
Dim objPara1 As ADODB.Parameter
Set objCmd = New ADODB.Command
Set objPara1 = New ADODB.Parameter
With objCmd
.ActiveConnection = gobjConn '已建立的连接
.CommandText = "a"
.CommandType = adCmdStoredProc
End With
objPara1.Name = "@b"
objPara1.Type = adChar
objPara1.Size = 6
objPara1.Direction = adParamInput
objPara1.Value = "000001"
objCmd.Parameters.Append objPara1
Set gobjRs = objCmd.Execute
Set objCmd = Nothing
Set gobjRs = Nothing
在红字显示处出错,出错信息在word里存放,好几天了,实在是解决不了了,高手,帮帮我吧。
另外这个“@”是什么意思?
有成功的VB连接mysql的例子也好呀。