2010-07-15 2 views
0

3 개의 레코드 집합을 메서드에 전달하여 동일한 데이터베이스 연결 아래에 모든 데이터로 채우는 데 이상한 문제가 있습니다. 아래 코드를 실행할 때 사용자 지정 로깅 정보를 검토하면 메서드에 전달 된 레코드 집합을 메서드 내의 로컬 변수에 할당 할 때 형식 불일치 오류가 발생하는 것을 알 수 있습니다.채우기 할 구성 요소 메서드에 레코드 집합 전달

그래서 mthod를 호출 할 때 다음이 기록됩니다 :

2010년 7월 15일 오전 10시 59분 47초 - GetALLRecordSets에게 2010년 7월 15일 오전 10시 59분 47초 시작 - GetALLRecordSets의 RS 초기화를 시작합니다

홀수 비트는 ASP 코드가 동일하고 구성 요소 dll이 동일한 베타 서버에서이 동일한 코드가 작동한다는 것입니다.

이 문제의 원인에 대한 의견이 있으십니까?


클래식 ASP 코드 :

set rs1= createobject("ADODB.Recordset") 
set rs2 =createobject("ADODB.Recordset") 
set rs3 = createobject("ADODB.Recordset") 

set myObj = Server.CreateObject("Component.className") 

call myObj.GetAllRecordSets(rs1, rs2, rs3) 

VB6 구성 요소 코드 : 서버에

Public Sub GetALLRecordSets(ByRef rs1 As Variant, _ 
          ByRef rs2 As Variant, _ 
          ByRef rs3 As Variant) 
On Error GoTo ErrorSpot 

    WriteToLog "Begin GetALLRecordSets", "", 0, "" 

    Dim lngErrNum As Long 
    Dim strErrDesc As String 
    Dim filterStr As String 
    Dim objConn As ADODB.Connection 
    Dim myrs1 As ADODB.Recordset 
    Dim myrs2 As ADODB.Recordset 
    Dim myrs3 As ADODB.Recordset 

    WriteToLog "Begin GetALLRecordSets RS initialization", "", 0, "" 

    Set myrs1 = rs1 
    Set myrs2 = rs2 
    Set myrs3 = rs3 

    WriteToLog "End GetALLRecordSets RS initialization", "", 0, "" 

    Set rs1 = myrs1.Clone 
    Set rs2 = myrs2.Clone 
    Set rs3 = myrs3.Clone 

ExitSpot: 
    'Cleanup 
    Exit Sub 

ErrorSpot: 
    'Save the error information 
    lngErrNum = Err.Number 
    strErrDesc = Err.Description 
    'Log the error 
    WriteToLog "GetALLRecordSets", strErrDesc, lngErrNum, strErrDesc  
End Sub 

답변

0

다른 version of MDAC? 예를 들어 Recordset의 특정 버전을 생성해야 할 수도 있습니다.

Set rs1 = CreateObject("ADODB.Recordset.2.8")