Results 1 to 4 of 4
  1. #1
    ajay.2613 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    2

    Issue in Importing datatabse-VBA

    Hi All

    I am importing a database into another blank database below is the code m using

    Sub makedb()
    Dim accessApp As Access.Application
    Set accessApp = New Access.Application
    accessApp.DBEngine.CreateDatabase "D:\tblImport.accdb", DB_LANG_GENERAL


    DoCmd.TransferDatabase acImport, "Microsoft Access", _
    "C:\WMDokInt_80_01_32Bit.accdb", acTable, "datLogo", _
    "datLogo", False
    EndSub

    It give me 2046 error(the command or action TransferDatabase isn't available now)

    Can anyone Please help?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You don't need any of this code to import a db element, except the
    docmd.transferdatabase

    it may not work if the source db is open.
    or if the element does not exist in it.

  3. #3
    ajay.2613 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    2
    Quote Originally Posted by ranman256 View Post
    You don't need any of this code to import a db element, except the
    docmd.transferdatabase

    it may not work if the source db is open.
    or if the element does not exist in it.

    Thnx for the reply!!!

    source db is not open and table exist in that DB

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    'all you need:

    DoCmd.TransferDatabase acImport,
    "Microsoft Access", "C:\WMDokInt_80_01_32Bit.accdb", acTable, "datLogo", "datLogo"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-08-2015, 02:08 PM
  2. Importing QuickBooks Tables: Sporadic ODBC Call failed Issue
    By HappyJohn in forum Import/Export Data
    Replies: 0
    Last Post: 10-08-2014, 03:08 PM
  3. Replies: 1
    Last Post: 06-02-2014, 07:15 AM
  4. Importing Spreadsheet Field Names Issue
    By collekt in forum Import/Export Data
    Replies: 2
    Last Post: 02-27-2013, 01:43 PM
  5. Issue with importing excel data
    By Jrbeene86 in forum Import/Export Data
    Replies: 0
    Last Post: 03-27-2012, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums