sqlserver 存储过程读取
自己写的一个简单存储过程
ALTER PROCEDURE [dbo].[uptab]
@id int,
@name varchar(32)
AS
BEGIN
update tab1 set name=@name where led_id=@id
END
下面的是 vb6.0成功使用的一个例子
Public Function execpro(strstr As String) As Integer
Dim execSQL As String
Dim cmd As ADODB.Command
Dim param As ADODB.Parameter
Dim param1 As ADODB.Parameter
Set cmd = New ADODB.Command
'''On Error GoTo execproerr
cmd.ActiveConnection = "DRIVER={SQL Server};SERVER=" + cnfgnow.DBip + ";DATABASE=chisdb_dev;UID=sa;PWD=mima"
cmd.CommandText = "uptab"
cmd.CommandType = adCmdStoredProc
cmd.Parameters("@id") = "1767678"
cmd.Parameters("@name") = "成功" ' "20081128-p-1011400---9-1-0" '
Dim i As Integer
cmd.Execute
'''write_log strstr & Trim(cmd.Parameters("@MsgInfo").Value)
execpro = i
Exit Function
'''execproerr:
'''write_log "写数据库错误"
execpro = 0
End Function