troubleshooting Question

exporting via docmd.transferdatabase

Avatar of __Holly__
__Holly__ asked on
Microsoft Access
2 Comments1 Solution689 ViewsLast Modified:
ok im kindof horsing around; pushing data from Access into a blank DB2 database--

and im encountering this annoying little bug--

I keep on ending up having all of my destination tables named "table" instead of table.

in other words-- in access; i am using tdf.name (tablename) =

OrderDetail
OrderHeader
ItemMaster

and in DB2, it is showing up as
"OrderDetail"
"OrderHeader"
"ItemMaster"

and I really hate going through and renaming all these all the time (removing the CHR(34))

thanks

_________________________________________________

Public Sub ExportAllTables()
On Error GoTo errhandler
Dim tdf As AccessObject

For Each tdf In CurrentData.AllTables
If Left(tdf.Name, 4) = "msys" Then GoTo nextTdf

DoCmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=J2396_ELJEFFE;UID=akempf;PWD=***(password here)***;LANGUAGE=us_english;DATABASE=ELJEFFE", acTable, tdf.Name, Replace("in_" & tdf.Name, "__", "_")

nextTdf:
Next tdf
cleanexit:
Exit Sub
errhandler:
MsgBox Err.Number & " - " & Err.Description
Resume Next
Resume cleanexit
End Sub
ASKER CERTIFIED SOLUTION
nico5038

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
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 1 Answer and 2 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