473,472 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Exporting From Access to a Dbase iV. via Object. Fails with error The Microsoft Jet Database engine could not find the object

Hi,
I've a VB script that creates a Access object in a word doc.
Here is the full script.

It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String

Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)

' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete

'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import

'
################################################## ########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################## #########################

' Close the Database
ACC.CloseCurrentDatabase

MsgBox "Finished"
End Sub

Nov 13 '05 #1
8 6967
On 27 Sep 2005 05:49:10 -0700, "chippy" <Ch************@gmail.com>
wrote:

Try it using foldernames and filenames that fit the 8.3 format
exclusively:
g:\work\test1.dbf

-Tom.

Hi,
I've a VB script that creates a Access object in a word doc.
Here is the full script.

It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String

Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)

' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete

'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import

'
################################################# #########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################# ##########################

' Close the Database
ACC.CloseCurrentDatabase

MsgBox "Finished"
End Sub


Nov 13 '05 #2
Thanks, I'll give that a go. yet the code for import works well??

Nov 13 '05 #3
Renamed the code to the dos files names. ie "workin~1"
The problem continues.
I also tried to rename the access table to a short name (4 characters)
still no go.
Very annoying.
Tried it on Access 2000 and 2002

Nov 13 '05 #4

File names, Table names and field names are limited to 8 characters in
the DBF File format that Access uses. Nor can a file, table or Field
name have a space in it.
On 27 Sep 2005 05:49:10 -0700, "chippy" <Ch************@gmail.com>
wrote:
I've a VB script that creates a Access object in a word doc.
Here is the full script.
It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String
Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)
' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete
'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import
'
################################################# #########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################# ##########################
' Close the Database
ACC.CloseCurrentDatabase
MsgBox "Finished"
End Sub

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #5
"chippy" <Ch************@gmail.com> wrote in
news:11**********************@g49g2000cwa.googlegr oups.com:
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database
engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False


Don't you need to provide the appropriate filename with extension
for the next-to-the-last argument? I just tested it, and the path
should be the 3rd argument, and the filename the one where you just
repeat the path again.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Whats annoying is that the code works fine as is if a sub inside access
itself.
If you leave the 3rd argumant as a path it creates a default named
dbase.
Anyway
I tried, renaming all tables, and folders etc to < 8 characters but it
still fails the same way.:
*
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "C:\data\Work\cdata.dbf", False

I also tried exporting a paradox still same error.
*
I was successful in trying to export as a Access database but this is
not what I need.
Very anoying

Nov 13 '05 #7
"chippy" <Ch************@gmail.com> wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
Whats annoying is that the code works fine as is if a sub inside
access itself.
If you leave the 3rd argumant as a path it creates a default named
dbase.
Anyway
I tried, renaming all tables, and folders etc to < 8 characters
but it still fails the same way.:
*
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "C:\data\Work\cdata.dbf", False
"C:\data\Work\cdata.dbf" should be "cdata.dbf". You provide the path
in the 3rd argument and the filename in the 6th.
I also tried exporting a paradox still same error.
*
I was successful in trying to export as a Access database but this
is not what I need.
Very anoying


This should work:

ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "cdata.dbf", False

If it doesn't, then I don't know what the issue is.

The reason things are different for Access MDBs and for DBF files is
that Access puts multiple tables in a single MDB file, whereas in
DBF, it's one table per file.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8
Thanks davis for your help. Still can't make it work as an object in
word so have made it launch access and export. This works and the code
is identical without the Object call, I just copied my code in.
Must be a bug with access objects.

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
3
by: Rob Hughes | last post by:
(This is a crosspost from .data for greater exposure) I am writing an external app that utilizes. The app needs to be able to run repeatedly, but I am having a problem because Access will not...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
5
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web...
6
by: venmore | last post by:
Hi Can someone please point in the right direction. I have an XML file that gets updated every 4 hours on a web server. I can check the XML modification time in ASP and compare to the databse....
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
by: bcbrock | last post by:
I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server. Both servers are Windows Server 2003 SP2. My...
3
by: cvalle | last post by:
A little about me... I’ve build a few Access dbases but I consider myself a novice. I have never inherited someone else’s Dbase. The dbase is not password protected, but I cannot access all of the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.