|
-
May 12th, 2010, 11:27 AM
#1
Thread Starter
Hyperactive Member
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:
Dim oApp As Object
Set oApp = CreateObject("Access.Application")
Dim acExport As Variant
Dim acReport As Variant
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!
-
May 12th, 2010, 11:35 AM
#2
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
-
May 12th, 2010, 11:42 AM
#3
Thread Starter
Hyperactive Member
Re: TransferDatabase isn't available
 Originally Posted by koolsid
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.
-
May 12th, 2010, 11:47 AM
#4
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
-
May 12th, 2010, 12:11 PM
#5
Thread Starter
Hyperactive Member
Re: TransferDatabase isn't available
 Originally Posted by koolsid
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:
Set oApp = Access.Application
still getting same error with that change and named parameters.
-
May 12th, 2010, 12:17 PM
#6
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
-
May 12th, 2010, 12:35 PM
#7
Thread Starter
Hyperactive Member
Re: TransferDatabase isn't available
 Originally Posted by koolsid
If using Early Binding then use this
Code:
Dim oApp As Access.Application
Ah yes, changed that now...
I changed it to
vb Code:
Dim oApp As Access.Application
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|