Hallo Leute,
vielleicht kann mir von euch einer weiterhelfen. Habe ein kleines Testprogramm geschrieben, um Daten von einer DB (Acron) in eine andere (mySQL) zu transferieren. Nun bekomme ich jedesmal:
Laufzeitfehler 3265 Item cannot be found in the collection corresponding to the requested name or ordinal
die Felder sind aber definitiv in den DB's vorhanden. Hier mal ein kleiner Auszug:
myClose RsMySql
RsMySql.Open "Select Schluessel from Prozessdaten where Schluessel=1"
If RsMySql.RecordCount = 0 Then
myClose RsAcron
RsAcron.Open "Select" & _
"timestamp,milliseconds,as_s_ut_ka_gehweg_pval,as_s_ut_ka_wasser_pval" & _
"," & _
"as_s_ut_ulast_gehweg_pval,as_s_ut_ulast_wasser_pval" & _
",as_w_wirkleistung_pval,df_baldeney_pval," & _
"df_kettwig_pval,l_ow_pval,l_uw_pval,ma_o2_ow_pval,ma_t_luft_pval,ma_t" & _
"ow_pval,rwe_ow_pval,rwe_uw_pval," & _
"s_l_niveau1_pval,s_l_niveau2_pval,w1_l_bkasten_pval,w1_l_kammer_pval," & _
"1_s1_krone_pval," & _
"w1_s1_kroneimptest_pval,w1_s1_kronetest_pval,w1_s2_krone_pval,w1_s2_k" & _
"oneimptest_pval," & _
"w1_s2_kronetest_pval,w2_l_bkasten_pval,w2_l_kammer_pval from process " _
& _
"where (timestamp>{ts '2005-01-01 00:00:00'} and timestamp < {ts" & _
"'2005-01-01 23:59:59'}) "
RsAcron.MoveFirst
MsgBox RsAcron.Fields("as_s_ut_ulast_gehweg_pval").Value
Do While Not RsAcron.EOF
CnMySQL.Execute "insert into prozessdaten (" & _
"Zeitstempel_Acron,Millisekunden_Acron,AS_S_UT_KA_Gehweg," & _
"AS_S_UT_KA_Wasser,AS_S_UT_ULAST_Gehweg,AS_S_UT_ULAST_Wasser,AS_W_" & _
"irkleistung,DF_Baldeney," & _
"DF_Kettwig,L_OW,L_UW,MA_O2_OW,MA_T_Luft,MA_T_OW,RWE_OW,RWE_UW,S_L" & _
"Niveau1,S_L_Niveau2,W1_L_BKasten," & _
"W1_L_Kammer,W1_S1_Krone,W1_S1_KroneImpTest,W1_S1_KroneTest,W1_S2_" & _
"rone,W1_S2_KroneImpTest," & _
"W1_S2_KroneTest,W2_L_BKasten,W2_L_Kammer) Values('" & _
RsAcron.Fields("timestamp").Value & "'," & _
RsAcron.Fields("milliseconds").Value & "," & RsAcron.Fields( _
"as_s_ut_ka_gehweg_pval").Value & "," & _
RsAcron.Fields("as_s_ut_ka_wasser_pval").Value & "," & _
RsAcron.Fields("as_s_ut_ulast_gehweg_pval").Value & _
"," & RsAcron.Fields("as_s_ut_ulast_wasser_pval").Value & "," & _
RsAcron.Fields("as_w__wirkleistung_pval").Value & "," & _
RsAcron.Fields("df_baldeney_pval").Value & _
"," & RsAcron.Fields("df_kettwig_pval").Value & "," & _
RsAcron.Fields("l_ow_pval").Value & "," & _
RsAcron.Fields("l_uw_pval").Value & "," & RsAcron.Fields( _
"ma_o2_ow_pval").Value & "," & _
RsAcron.Fields("ma_t_luft_pval").Value & "," & RsAcron.Fields( _
"ma_t_ow_pval").Value & "," & _
RsAcron.Fields("rwe_ow_pval").Value & "," & RsAcron.Fields( _
"rwe_uw_pval").Value & "," & _
RsAcron.Fields("s_l_niveau1_pval").Value & "," & RsAcron.Fields( _
"s_l_niveau2").Value & "," & _
RsAcron.Fields("w1_l_bkasten_pval").Value & "," & _
RsAcron.Fields("w1_l_kammer_pval").Value & "," & RsAcron.Fields( _
"w1_s1_krone_pval").Value & "," & _
RsAcron.Fields("w1_s1_kroneimptest_pval").Value & "," & _
RsAcron.Fields("w1_s1_kronetest_pval").Value & _
"," & RsAcron.Fields("w1_s2_krone_pval").Value & "," & _
RsAcron.Fields("w1_s2_kroneimptest_pval").Value & _
"," & RsAcron.Fields("w1_s2_kronetest_pval").Value & "," & _
RsAcron.Fields("w2_l_bkasten").Value & "," & _
RsAcron.Fields("w2_l_kammer_pval").Value & ")"
RsAcron.MoveNext
Loop
' ******** Laufzeitfehler 3265 Item cannot be found in the collection
' corresponding to the requested
' name or ordinal
End If Der Fehler liegt in der Do While Schleife, aber ich find ihn nicht. Das einzige, was ich mir noch vorstellen könnte ist: im rsAcron sind teilweise Felder NULL und das dieses Probleme macht an die mySQL DB zu übergeben (die Felder, die in der mySQL DB NULL sein dürfen sind auch dem entsprechend deklariert) |