Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.TransferDatabase, acImport

Status
Not open for further replies.

EBee

MIS
Aug 10, 2001
229
US
Is there an issue using the command below? It's giving me an error " The Microsoft Jet engine could not find object tblAllAddress. . ." the code is in a MS Access 2000 while the PaidPlus.mdb is a MS Access 97. Could this be a reason?


DoCmd.TransferDatabase acImport, "Microsoft Access", _
'"\\sbserver02\Circulation Transfer\Circ Admin Share\ThirdPartyData\PaidPlus.mdb", acTable, " tblAllAddresses
 
Try removing the spaces between the quotes and the table name.

" tblAllAddresses " should be "tblAllAddresses"

There should not be an issue importing a table from a different version of Access.

John Borges
 
I actually figured it out. I'm missing the destination parameter, howerver, I still can not figure out how to sort the table via vba using rst.sort = "[RandomID]" after importing it.

thanks for any advice

Private Sub cmdImportData_Click()
Dim Response As Integer
Dim rst As ADODB.Recordset

Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection


Response = MsgBox("Are you sure you want to import new data?", vbOKCancel, "WARNING!!")

If Response = vbOK Then

DoCmd.Rename "tblAllAddresses_" & Format(Now, "mmddyyyy_hhmmss"), acTable, "tblAllAddresses"

DoCmd.TransferDatabase acImport, "Microsoft Access", _
"\\sbserver02\Circulation Transfer\Circ Admin Share\ThirdPartyData\PaidPlus.mdb", acTable, "tblAllAddresses", "tblAllAddresses"

MsgBox "Table Import Complete"

rst.Open "tblAllAddresses", , adOpenKeyset, adLockOptimistic
rst.Sort = "[RandomID]"
Else

Exit Sub
End If

End Sub
 
In RDBMS tables are not sorted.
To see the records sorted as you like simply create a query with an ORDER BY clause.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top