我正在将VB6
windows应用程序中的某些旧代码更新为VB.Net Web应用程序.我理解旧代码,但我不确定如何将其转换为.Net记录集.
myStoredProcedure = "sp_WritevPayrollCurrent" myCurrentPast = "'N'" myStoredProcedure = "sp_ObtainSubClassID" myClassName = "Payroll Major" mySubClassName = "New Hire" Set rs = TgetReadResultsetWithParms(myClassName,mySubClassName,(myStoredProcedure))
另外,我不确定“myStoredProcedure”被宣告两次会发生什么,或者这可能是一个错误?
TgetReadResultsetWithParms函数如下(一些案例被编辑以释放空间):
Dim en As rdoEnvironment Dim cn As rdoConnection Dim rq As rdoQuery rdoDefaultCursorDriver = rdUseServer 'open a connection to the tstdbexecutive database using DSNless connections Set en = rdoEnvironments(0) Set cn = connectionstring stuff here Select Case myStoredProcedure 'create reusable rdoQuery and Call sql server stored procedure. Case "sp_ObtainClassID" Set rq = cn.CreateQuery("","{call " & cstDatabaseName & ".dbo.sp_ObtainClassID(?)}") Case Else Set rq = cn.CreateQuery("","{call " & cstDatabaseName & ".dbo." & myStoredProcedure & "(?)}") End Select 'set the input argument value for the store procedure. rq(0) = myParm1 'open the Resultset and pass it back to calling procedure Set TgetReadResultsetWithParm = rq.OpenResultset(rdOpenKeyset,rdConcurReadOnly)