troubleshooting Question

DB2 data import ...Run-time error '-2147467259 (80004005)':

Avatar of Mike Eghtebas
Mike EghtebasFlag for United States of America asked on
DB2
8 Comments4 Solutions2562 ViewsLast Modified:
In attempting to import some data from a DB2, I get the following error:

Run-time error '-2147467259 (80004005)':
[IBM][CLI Driver][DB2] SQL0104N An unexpected token "TALLDATA"
was found following ''. Expected token may include: ":". SQLSTATE=42601

.
.
    sqlStr = "SELECT L.VIN, L.BK, L.BR, L.CUS, L.LN INTO tAllData FROM SourceDB.SourceTable AS L" & _
             " Inner Join qSomeQuery AS G On L.VIN=G.VIN"

    strDBConnect = "Connection:=ODBC;DSN=PDB2;UID=uuuuu;pwd=ppppp;DBALIAS=PDB2"
    Set cmd = New ADODB.Command
                 
    cmd.CommandText = sqlStr
    cmd.ActiveConnection = strDBConnect
    Set rst = cmd.Execute   '<-- **** Run-time error '-2147467259 (80004005)'
.
.

FYI: I have been able to connect to this DB2 and read field names, for example.  So, there is no problem as far as connecting to DB2.  What is wrong with the code?  Do you see any problems in my make table SQL?

TALLDATA or tAllData above is my target table name (which doesn't exit yet).  Because I am running this code from MS Access, I added also:

    Dim db As Database
    Set db = CurrentDb
    sqlStr = "SELECT L.VIN, L.BK, L.BR, L.CUS, L.LN INTO db.tAllData FROM SourceDB.SourceTable AS L" & _
             " Inner Join qSomeQuery AS G On L.VIN=G.VIN"

Still didn't work.

Thank you.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 4 Answers and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros