By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,799 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,799 IT Pros & Developers. It's quick & easy.

about importing access tables..

P: 1
hi i am trying to import access tables into my backend database( current database) which is sql server.
i created file browser which browse access database from harddrive and places all the tables into listbox. and upon clicking table name in list box, i want it to import it to my current database( which is sql server).
in order i used this code:


Private Sub ListTables_AfterUpdate()
docmd.TransferDatabase acLink, "Microsoft Access", dbname, acTable, Me.ListTables, Me.ListTables
docmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=dsnname;LANGUAGE=us_english;DATABASE=cur rentdbname", acTable, Me.ListTables, Me.ListTables
End Sub

this thorws an error saying" the expression you entered is wrong data type for one of the argument" and point to first line

and without linking i guess it suppose to import to you current databse by just importing access tables.

Private Sub ListTables_AfterUpdate()
docmd.TransferDatabase acImport "Microsoft Access", dbname, acTable, Me.ListTables, Me.ListTables
End SUb
it still thorws same error.
i am sure i selected same database.

and listbox name is 'listtables'


help m eout here..
May 29 '07 #1
Share this Question
Share on Google+
2 Replies

MMcCarthy
Expert Mod 10K+
P: 14,534
If I understand you correctly you want to export the tables from your current database which is MS Access to SQL Server. You can't do it this way.

Look into using the Access upsizing wizard. Go to the tools menu - database utilities - upsizing wizard. If that doesn't work you will have to import the tables from SQL Server in which case I will move this question to that forum.

Let me know how your get on.
Jun 1 '07 #2

ADezii
Expert 5K+
P: 8,750
hi i am trying to import access tables into my backend database( current database) which is sql server.
i created file browser which browse access database from harddrive and places all the tables into listbox. and upon clicking table name in list box, i want it to import it to my current database( which is sql server).
in order i used this code:


Private Sub ListTables_AfterUpdate()
docmd.TransferDatabase acLink, "Microsoft Access", dbname, acTable, Me.ListTables, Me.ListTables
docmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=dsnname;LANGUAGE=us_english;DATABASE=cur rentdbname", acTable, Me.ListTables, Me.ListTables
End Sub

this thorws an error saying" the expression you entered is wrong data type for one of the argument" and point to first line

and without linking i guess it suppose to import to you current databse by just importing access tables.

Private Sub ListTables_AfterUpdate()
docmd.TransferDatabase acImport "Microsoft Access", dbname, acTable, Me.ListTables, Me.ListTables
End SUb
it still thorws same error.
i am sure i selected same database.

and listbox name is 'listtables'


help m eout here..
How about using DTS (Data Transformation Services) within SQL Server?
Jun 1 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.