Results 1 to 7 of 7

Thread: TransferDatabase isn't available

  1. #1

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    TransferDatabase isn't available

    Hello all,

    I've attempted to rectify my problem from google or other vbforum threads w/o any luck... I'm working from Excel VBA 2010.

    I need to save one of my sheets as a .dbf, and know that Access still has support for this file format. I have exported the sheet I need to save into an Access Database and simply need to export that Access table as a dBaseIV.

    The following code snippet is causing the problem:

    "Run Time error: 2046"
    The command or action 'transferDatabase" isn't available now.

    The following code snippet is causing the error.

    vb Code:
    1. Dim oApp As Object
    2.         Set oApp = CreateObject("Access.Application")
    3.  
    4.         Dim acExport As Variant
    5.         Dim acReport As Variant
    6.         oApp.DoCmd.TransferDatabase acExport, "dBase IV", pathToAccessDB, acReport, "tempGIS", dbfLocation

    the pathToAccessDB points to the .mdb containing the table I need to export. tempGIS is said table name. dbfLocation is the .dbf file I'm attempting to export to.

    Any suggestions?

    Thanks much!

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: TransferDatabase isn't available

    Try This...

    Code:
    oApp.DoCmd.TransferDatabase acExport, "dBase IV", pathToAccessDB, acTable, "tempGIS", dbfLocation
    or try this...

    Code:
    oApp.DoCmd.TransferDatabase TransferType:=acExport, DatabaseType:="dBase IV", _
    DatabaseName:=pathToAccessDB, ObjectType:=acTable, Source:="tempGIS", Destination:=dbfLocation
    If it still doesn't work then how are you working with Access? LateBinding or EarlyBinding?
    Last edited by Siddharth Rout; May 12th, 2010 at 11:46 AM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Re: TransferDatabase isn't available

    Quote Originally Posted by koolsid View Post
    Try This...

    Code:
    oApp.DoCmd.TransferDatabase acExport, "dBase IV", pathToAccessDB, acTable, "tempGIS", dbfLocation
    Hey Sid,

    I had tried that before unsuccessfully, and just did it again it insure I wasn't mistaken and it is the same error. Although I think acTable is correct parameter.

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: TransferDatabase isn't available

    I just made some changes in my post above... see it it helps...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Re: TransferDatabase isn't available

    Quote Originally Posted by koolsid View Post
    Try This...

    Code:
    oApp.DoCmd.TransferDatabase acExport, "dBase IV", pathToAccessDB, acTable, "tempGIS", dbfLocation
    or try this...

    Code:
    oApp.DoCmd.TransferDatabase TransferType:=acExport, DatabaseType:="dBase IV", _
    DatabaseName:=pathToAccessDB, ObjectType:=acTable, Source:="tempGIS", Destination:=dbfLocation
    If it still doesn't work then how are you working with Access? LateBinding or EarlyBinding?
    I was using late binding but switched to early binding...

    vb Code:
    1. Set oApp = Access.Application

    still getting same error with that change and named parameters.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: TransferDatabase isn't available

    If using Early Binding then use this

    Code:
    Dim oApp As Access.Application
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Re: TransferDatabase isn't available

    Quote Originally Posted by koolsid View Post
    If using Early Binding then use this

    Code:
    Dim oApp As Access.Application
    Ah yes, changed that now...

    I changed it to
    vb Code:
    1. Dim oApp As Access.Application
    2. Set oApp = Access.Application

    still getting error 2046.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width