Hi, i got the following problem:
I want to Insert Data in a ODBC- linked table. If I do this via INSERT- Statement I get the Message "Ressources exceeded" (in German: "Systemressourcen nicht ausreichend")
Whatever I tried, the problem remained.
So I tried insert the Data record by record with the following code (not exactly, I tried to reduce the code to the main statements)
But in result I got Error 3155. If I do this for a record, there is no problem. I can't find out the special reason, maybe constraints or whatever.
I am not sure, the code will work, because I eliminated less important lines for a better understanding.Code:Private Function copy_cell(rownum As Integer, rsZiel As Recordset, rsQuelle As Recordset, Index As Integer) As String Dim err_txt As String On Error GoTo ErrorMessage: copy_cell = "" rsZiel.Fields(Index+1) = pcrsQuelle.Fields(Index) Exit Function ErrorMessage: err_txt = "Row " & Str(rownum ) err_txt = err_txt & " [" & rsZiel.Fields(Index +1).Name & "] " err_txt = err_txt & "<" & Err.Description & ">" copy_cell = err_txt Resume Next End Function private sub copy_table(TabelleZiel As String, TabelleQuelle As String) Set rsZiel = dbx.OpenRecordset(TabelleZiel) Set rsQuelle = dbx.OpenRecordset(TabelleQuelle) zahl = 0 Do While Not rsQuelle.EOF zahl = zahl + 1 rsZiel.AddNew rsZiel.Fields(0) = zahl 'Primärschlüssel 'copy record field by field 'it is a little simplified, because fields maybe not in the right order. But this I managed. For Index = 0 To rsZiel.Fields.Count - 1 'result of copy_cell ist empty, if there is no error. err.descriotion is empty, whyever s = copy_cell(zahl, rsZiel, rsQuelle, Index) Next Index rsZiel.Update 'that is the place, where error appears rsQuelle.MoveNext loop end sub
I hope anybody can help me.