dreamer2007
Mitglied
Hallo zusammen!
Ich habe ein Problem mit einem SQL-Statement, dass ich per ADODB-Recordset an eine vorhandene Access-Tabelle schicken möchte.
Komischerweisefunktioniert das gleiche Statement, zwar mit anderen Variablen, im gleichen Codeblock perfekt. Nur bei diesem String gibt es eine Fehlermeldung: "Syntaxfehler in INSERT INTO - Anweisung".
Vielleicht ja ja jemand eine Idee:
Gruß
Dreamer
Ich habe ein Problem mit einem SQL-Statement, dass ich per ADODB-Recordset an eine vorhandene Access-Tabelle schicken möchte.
Komischerweisefunktioniert das gleiche Statement, zwar mit anderen Variablen, im gleichen Codeblock perfekt. Nur bei diesem String gibt es eine Fehlermeldung: "Syntaxfehler in INSERT INTO - Anweisung".
Vielleicht ja ja jemand eine Idee:
PHP:
Dim con As New ADODB.Connection
Dim RS As ADODB.Recordset
Dim str As String
Dim location As String
location = CurrentDb.name
Verbindung Erstellen
conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & location
con.Open conStr
Set RS = New ADODB.Recordset
For i = 0 To upper_bnd Step 1
str = "INSERT INTO costs_od_costs (AP_ID,INTERNAL_ID,siglum,process,type, "
str = str & "description,object, costs, startdate, enddate) "
str = str & "VALUES ('" & ap_number & "','" & i & "', '" & od_costs_array(i).siglum & "', "
str = str & "'" & od_costs_array(i).process & "', '" & od_costs_array(i).type & "', "
str = str & "'" & od_costs_array(i).description & "','" & od_costs_array(i).object & "', "
str = str & "'" & od_costs_array(i).costs & "', '" & od_costs_array(i).startdate & "', '" & od_costs_array(i).enddate & "')"
RS.Open str, con
Next i
Gruß
Dreamer