VB6 0 如何呼叫儲存過程,返回結果集問題

2022-09-14 03:12:11 字數 1360 閱讀 8349

對於vb6.0這個軟體,估計對於現在很多程式設計師來說,都不知道啥軟體來了,但本人還在摸,

if rs.bof and rs.eof then

msgbox "there is no master fr connect setting, please contact it."

exit sub

else

frconnectstr = rs("description")

end if

if frcn.state = adstateopen then

frcn.close

set frcn = nothing

end if

frcn.cursorlocation = aduseserver 'aduseclient 'aduseserver

frcn.isolationlevel = adxactreadcommitted

frcn.commandtimeout = 1800

frcn.open frconnectstr

' dim cmd as adodb.command

' set cmd = new adodb.command

' cmd.commandtext = "dbo.fr_gen_data_for_agpo"

' cmd.commandtype = adcmdstoredproc

' cmd.activeconnection = frcn

' cmd.commandtimeout = 300

' with cmd.parameters

' end with

' set rsfr = cmd.execute

' debug.print cmd.state

sql = "exec dbo.fr_gen_data_for_agpo '20g04502de01,20g07345gb01,', 'c',7"

set rsfr = frcn.execute(sql)

debug.print rsfr.state

if rsfr.state = 1 then

debug.print rsfr.recordcount

if rsfr.bof and rsfr.eof then

else

do while not rsfr.eof

debug.print rsfr(0)

rsfr.movenext

loop

end if

'get jo, by g or c

end if

記得儲存過程,要補上乙個 set nocount on, 原理不詳~~~囧

vb呼叫儲存過程

public sub procexe byval procname as string,byval pch as string dim cn as adodb.connection dim cmd as adodb.command cn.connectionstring cn.open set cm...

VB呼叫儲存過程

dim adocomm as new adodb.command dim prmretval as adodb.parameter dim prmid as adodb.parameter adocomm.activeconnection conn adocomm.commandtype adcmd...

VB6 0軟體呼叫VS C DLL問題解決

之前為裝置的dll供客戶二次開發,包括c c 等呼叫都沒有問題,以乙個函式為例,c檔案和h檔案裡寫法如下 uchar chartohex uchar ch extern c declspec dllexport uchar chartohex uchar ch 字元轉16進製制但日前有乙個客戶還在用...