3つのレコードセットをメソッドに渡して、すべて同じデータベース接続でデータを入力しようとしているという奇妙な問題が発生しています。以下のコードを実行するときにカスタムログ情報を確認すると、メソッドに渡されたレコードセットをメソッド内のローカル変数に割り当てるときに、タイプの不一致エラーが発生していることがわかります。
したがって、mthodが呼び出されると、以下がログに記録されます。
7/15/2010 10:59:47AM-GetALLRecordSetsを開始します7/15/201010:59:47AM-GetALLRecordSetsRSの初期化を開始します
奇妙なことに、この同じコードは、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