哪位大神告诉一下vb6.0怎么调用带2个参数的存储过程,有简单的例子最好。谢谢!
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了哪位大神告诉一下vb6.0怎么调用带2个参数的存储过程,有简单的例子最好。谢谢!相关的知识,希望对你有一定的参考价值。
Dim CmdSPDim adoRS
Dim adCmdSPStoredProc
Dim adParamReturnValue
Dim adParaminput
Dim adParamOutput
Dim adInteger
Dim iVal
Dim oVal
Dim adoField
Dim adVarChar
\'这些值在 VB 中是预定义常量,可以直接调用,但在 VBScript 中没有预定义
adCmdSPStoredProc = 4
adParamReturnValue = 4
adParaminput = 1
adParamOutput = 2
adInteger = 3
adVarChar = 200
iVal = 5
oVal = 3
\'建一个command对象
set CmdSP = Server.CreateObject("ADODB.Command")
\'建立连结
CmdSP.ActiveConnection = "Driver=SQL Server;server=(local);Uid=sa;Pwd=sa;Database=Pubs"
\'定义command 对象调用名称
CmdSP.CommandText = "sp_PubsTest"
\'设置command调用类型是存储过程 (adCmdSPStoredProc = 4)
CmdSP.CommandType = adCmdSPStoredProc
\'往command 对象中加参数
\'定义存储过程有直接返回值,并且是个整数,省缺值是4
CmdSP.Parameters.Append CmdSP.CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 4)
\'定义一个字符型输入参数
CmdSP.Parameters.Append CmdSP.CreateParameter("@au_lname", adVarChar, adParaminput, 20, "M")
\'定义一个整型输入参数
CmdSP.Parameters.Append CmdSP.CreateParameter("@intID", adInteger, adParamInput, , iVal)
\'定义一个整型输出参数
CmdSP.Parameters.Append CmdSP.CreateParameter("@intIDOut", adInteger, adParamOutput, oVal)
\'运行存储过程,并得到返回记录集
Set adoRS = CmdSP.Execute
\'把每个记录打印出来,其中的字段是虚拟的,可以不用管
While Not adoRS.EOF
for each adoField in adoRS.Fields
Response.Write adoField.Name & "=" & adoField.Value & "<br>" & vbCRLF
Next
Response.Write "<br>"
adoRS.MoveNext
Wend
\'打印两个输出值:
Response.Write "<p>@intIDOut = “ & CmdSP.Parameters("@intIDOut").Value & "</p>"
Response.Write "<p>Return value = " & CmdSP.Parameters("RETURN_VALUE").Value & "</p>"
\'大扫除
Set adoRS = nothing
Set CmdSP.ActiveConnection = nothing
Set CmdSP = nothing
以上代码仅供参考
其实核心的就是如何获得存储过程的返回值
追问还是没看明白呢,能不能把我发的那个存储过程 做一个呢?我照着样子写试试?麻烦啦。。。
参考技术A Dim a(50) As IntegerPrivate Sub Command1_Click() '生成并显示原来的数组
Print "原来的数组:"
For i = 1 To 40
a(i) = i
Print a(i);
If i Mod 20 = 0 Then Print
Next i
End Sub
Private Sub Command2_Click() '输入新数据并修改原来数组
Dim x As Integer, k As Integer
Do While x >= 0
x = CInt(InputBox("请输入X(输入负数结束):"))
k = CInt(InputBox("请输入要放到第几个位置(<=40):"))
If x >= 0 Then change x, k
Loop
Print "修改以后的数组:"
For i = 1 To 40
Print a(i);
If i Mod 20 = 0 Then Print
Next i
End Sub
Sub change(x As Integer, k As Integer) '修改数组的子程序(过程)
a(k) = x
End Sub 参考技术B 你的“存储过程”具体指什么?追问
就是这个存储过程 怎么调用?
dim s1 as string
dim KH as string
dim ID as string
kh="这里填写某患者卡号"
ID="这里填写某患者ID"
s1 = FZJH_GetCheckList(KH,ID)
msgbox "患者的检验单标本类型为:" & s1
哪位大神知道怎么用appium实现引导页的滑动,并且成功跳转到主界面?
通过获取屏幕的尺寸大小,然后通过swipe进行滑动,具体代码如下:
from appium import webdriver
from time import sleep
capabilites =
"platformName": "Android",
"platformVersion": "5.1.1",
"deviceName": "aa19503",
"app": "F:\\\\mukewang.apk",
driver = webdriver.Remote('
# 获取屏幕宽和高
def get_size():
size = driver.get_window_size()
width = size['width']
height = size['height']
return width,height
# 向左滑动
def swipe_left():
x1 = get_size()[0] / 10 * 9
y1 = get_size()[1] / 2
x = get_size()[0] / 10
sleep(3)
driver.swipe(x1, y1, x, y1)
swipe_left()
参考技术A 看来需要我这个高手高手高高手出马了以上是关于哪位大神告诉一下vb6.0怎么调用带2个参数的存储过程,有简单的例子最好。谢谢!的主要内容,如果未能解决你的问题,请参考以下文章
哪位大神能解答一下怎么在Android Studio中配置LitePal
有哪位大神告诉我,Keil MDK 4.74版本新建工程出问题了,如何解决呢?