S
SirPoonga
I am making a custom import script to import data from a text file into
a table.
I do something like
sqlcmd = "INSERT INTO " & outTable & " " & _
"(" & record_names & ") " & _
"VALUES (" & outString & ")"
CurrentProject.Connection.Execute sqlcmd
I put a breakpoint on the execute command. When that line is run I get
Run-time error '-2147217900(80040e14)':
Syntax error in INSERT INTO statement.
ok, so in my immediate window I did a
print sqlcmd
I copy and pasetd the SQL cmd into the SQL view of the Query Builder.
The command ran fine.
So, why would a SQL statement run fine in the Query Builder but not in
code?
a table.
I do something like
sqlcmd = "INSERT INTO " & outTable & " " & _
"(" & record_names & ") " & _
"VALUES (" & outString & ")"
CurrentProject.Connection.Execute sqlcmd
I put a breakpoint on the execute command. When that line is run I get
Run-time error '-2147217900(80040e14)':
Syntax error in INSERT INTO statement.
ok, so in my immediate window I did a
print sqlcmd
I copy and pasetd the SQL cmd into the SQL view of the Query Builder.
The command ran fine.
So, why would a SQL statement run fine in the Query Builder but not in
code?