一个例子:
Result = SqlRpcInit(Sqlconn, "sp_dboption", 0)
Result = SqlRpcParam(Sqlconn, "@dbname", 0, SQLCHAR, 30, Len("UserInfo"), "UserInfo")
Result = SqlRpcParam(Sqlconn, "@optname", 0, SQLCHAR, 35, Len("Select into/bulkcopy"), "Select into/bulkcopy")
Result = SqlRpcParam(Sqlconn, "@optvalue", 0, SQLCHAR, 10, Len("true"), "true")
Result = SqlRpcExec(Sqlconn)
(以上程序使用db_library API,详细使用情况请阅读vb帮助)
Result = SqlRpcInit(Sqlconn, "sp_dboption", 0)
Result = SqlRpcParam(Sqlconn, "@dbname", 0, SQLCHAR, 30, Len("UserInfo"), "UserInfo")
Result = SqlRpcParam(Sqlconn, "@optname", 0, SQLCHAR, 35, Len("Select into/bulkcopy"), "Select into/bulkcopy")
Result = SqlRpcParam(Sqlconn, "@optvalue", 0, SQLCHAR, 10, Len("true"), "true")
Result = SqlRpcExec(Sqlconn)
(以上程序使用db_library API,详细使用情况请阅读vb帮助)
解决方案 »
- 不就是有人又看上7月份那个MVP了么?
- LVM_GETISEARCHSTRING或LVM_GETISEARCHSTRINGW或LVM_GETISEARCHSTRINGA怎么使用?
- 连接数据库错误处理
- 如何备份SQL Server到网络位置?请高手帮忙!
- Sub Main()一定要在公共模块中才能运行吗?
- 求Visual Studio 6.0企业版下载。
- VB中整形数的高低位为什么是高位在前,低位在后?
- 小于0.1的数值不能直接放在TEXT中吗?
- 急呀,请问我用CreateWindowEx创建的SysIPAddress32控件,怎么添加KeyPress事件呀?
- formula one 如何使用,告知,急需!
- 如何将word等office组加入到自己的vb程序中
- VB与数据库
Dim lconn As New ADODB.Connection
Dim lcmd As New ADODB.Command
Dim Param1, Param2, Param3, Param4, Param5 As ADODB.Parameter lconn.Open gsCon
lcmd.ActiveConnection = lconn
lcmd.CommandText = "sp_aaa" ' 存储过程名
lcmd.CommandType = adCmdStoredProc
Set Param1 = lcmd.CreateParameter("nf", adInteger, adParamInput)
Set Param2 = lcmd.CreateParameter("yf", adInteger, adParamInput)
Set Param3 = lcmd.CreateParameter("jls", adInteger, adParamInput)
Set Param4 = lcmd.CreateParameter("retcode", adInteger, adParamOutput)
Set Param5 = lcmd.CreateParameter("retmsg", adBSTR, adParamOutput, 30)
Param1.Value = Int(Trim(txtNf.Text)) ' 打印年份
Param2.Value = Int(Trim(txtYf.Text)) ' 打印月份
Param3.Value = Int(Trim(txtPage.Text)) ' 打印月份 lcmd.Parameters.Append Param1
lcmd.Parameters.Append Param2
lcmd.Parameters.Append Param3
lcmd.Parameters.Append Param4
lcmd.Parameters.Append Param5
lcmd.Execute
lconn.close