473,385 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Jet Database could not find Export file

Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help
Nov 12 '05 #1
5 10995
Exporting to Word Merge Format After Renaming Field Causes Error
http://support.microsoft.com/default...roduct=acc2000

__________________________________________

"Tim Eliot" <ti*@beacon.com.au> wrote in message
news:23**************************@posting.google.c om...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help
Nov 12 '05 #2
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---

....and it complains it can't find out2.txt. Why does it need to FIND
this file when it's doing an EXPORT is what I do not understand. The
specification is properly defined and when I use it in Access to do an
export to delim text file all goes well. But this .vbs script will
not write to the indicated file.

If I create a blank text file with that name and put it in the proper
location, I get no error and the script completes fine, but no write
occurs to that file. I can't understand why it is not working. Any
suggestions? Thanks.

bp
"Tom Wickerath" <AO***********************@comcast.net> wrote in message news:<jK********************@comcast.com>...
Exporting to Word Merge Format After Renaming Field Causes Error
http://support.microsoft.com/default...roduct=acc2000

__________________________________________

"Tim Eliot" <ti*@beacon.com.au> wrote in message
news:23**************************@posting.google.c om...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help

Nov 12 '05 #3
Very strange. I copied the code you show below into a new module, created the folder
C:\codescratch, and a comma delimited export spec. with named Expout Export Specification.
Your code works fine for me.

_____________________________________________

"Blake Patterson" <bl***@blakespot.com> wrote in message
news:90**************************@posting.google.c om...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---

....and it complains it can't find out2.txt. Why does it need to FIND
this file when it's doing an EXPORT is what I do not understand. The
specification is properly defined and when I use it in Access to do an
export to delim text file all goes well. But this .vbs script will
not write to the indicated file.

If I create a blank text file with that name and put it in the proper
location, I get no error and the script completes fine, but no write
occurs to that file. I can't understand why it is not working. Any
suggestions? Thanks.

bp
"Tom Wickerath" <AO***********************@comcast.net> wrote in message
news:<jK********************@comcast.com>...
Exporting to Word Merge Format After Renaming Field Causes Error
http://support.microsoft.com/default...roduct=acc2000

__________________________________________

"Tim Eliot" <ti*@beacon.com.au> wrote in message
news:23**************************@posting.google.c om...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help

Nov 12 '05 #4
YOU WROTE:

Very strange. I copied the code you show below into a new module,
created the folder
C:\codescratch, and a comma delimited export spec. with named Expout
Export Specification.
Your code works fine for me.

- - - - - - -
But I am not using it in a module. This is code is in a .vbs script
file sitting on the Windows desktop. I am trying to execute it by
clicking on the icon and running it. Is this my problem? You see, I
need to have Windows' task scheduler schedule this operation to run
nightly, which is why I am trying to use it in a .vbs script file.

Any thoughts? Thanks.

Code below:
' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---


.. . . . . . . . . . . . . . . . . . . . . .

"Tom Wickerath" <AO***********************@comcast.net> wrote in message news:<Mc********************@comcast.com>...
Very strange. I copied the code you show below into a new module, created the folder
C:\codescratch, and a comma delimited export spec. with named Expout Export Specification.
Your code works fine for me.

_____________________________________________

"Blake Patterson" <bl***@blakespot.com> wrote in message
news:90**************************@posting.google.c om...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---

...and it complains it can't find out2.txt. Why does it need to FIND
this file when it's doing an EXPORT is what I do not understand. The
specification is properly defined and when I use it in Access to do an
export to delim text file all goes well. But this .vbs script will
not write to the indicated file.

If I create a blank text file with that name and put it in the proper
location, I get no error and the script completes fine, but no write
occurs to that file. I can't understand why it is not working. Any
suggestions? Thanks.

bp
"Tom Wickerath" <AO***********************@comcast.net> wrote in message
news:<jK********************@comcast.com>...
Exporting to Word Merge Format After Renaming Field Causes Error
http://support.microsoft.com/default...roduct=acc2000

__________________________________________

"Tim Eliot" <ti*@beacon.com.au> wrote in message
news:23**************************@posting.google.c om...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help

Nov 12 '05 #5
Hi Blake,

I believe this is the problem. As much as I hate macros in Access (ie. "Macros are for
weenies, code is cool"), this is a case where a macro can be used to help start the
process. Note: You can also use a form, which calls your function in its On_Open event
procedure.

You can create a macro which runs a function. The code must be a public function. It
cannot be a private function or a subroutine (public or private). The action argument in
the macro is RunCode, and you specify the function name in the lower window with a blank
set of parentheses if the function requires no arguments. Example:

Action: RunCode
Function Name: Export()

Test this much out first, and make sure you can get it to work from within Access. Then
drag your macro to the desktop (or any other folder). This should produce a shortcut to
the macro. Close Access. Test it outside of Access by double-clicking on your new
shortcut. It should still work. You may want to add code to the function to cause Access
to quit on it's own. Rename the shortcut to whatever you want, and then add the shortcut
file as a scheduled task.

Tom
___________________________________________

Option Compare Database
Option Explicit

Function Export()
On Error Resume Next 'Probably best, if you are running it unattended

Dim objAccess
Set objAccess = CreateObject("Access.Application")

objAccess.OpenCurrentDatabase ("C:\codescratch\db1.mdb")

objAccess.DoCmd.TransferText acExportDelim, "Expout Export Specification", "tblEmployees",
"C:\codescratch\out2.txt", False, ""

objAccess.CloseCurrentDatabase
Set objAccess = Nothing

DoCmd.Quit ' Quit Access

End Function

"Blake Patterson" <bl***@blakespot.com> wrote in message
news:90**************************@posting.google.c om...
YOU WROTE:

Very strange. I copied the code you show below into a new module,
created the folder
C:\codescratch, and a comma delimited export spec. with named Expout
Export Specification.
Your code works fine for me.

- - - - - - -
But I am not using it in a module. This is code is in a .vbs script
file sitting on the Windows desktop. I am trying to execute it by
clicking on the icon and running it. Is this my problem? You see, I
need to have Windows' task scheduler schedule this operation to run
nightly, which is why I am trying to use it in a .vbs script file.

Any thoughts? Thanks.

Code below:
' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---


.. . . . . . . . . . . . . . . . . . . . . .

"Tom Wickerath" <AO***********************@comcast.net> wrote in message
news:<Mc********************@comcast.com>...
Very strange. I copied the code you show below into a new module, created the folder
C:\codescratch, and a comma delimited export spec. with named Expout Export Specification. Your code works fine for me.

_____________________________________________

"Blake Patterson" <bl***@blakespot.com> wrote in message
news:90**************************@posting.google.c om...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("Access.Application")
ObjAccess.OpenCurrentDatabase("C:\codescratch\db1. mdb")

ObjAccess.DoCmd.TransferText acExportDelim, "Expout Export
Specification" ,"table1", "C:\codescratch\out2.txt", False, ""

ObjAccess.CloseCurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---

...and it complains it can't find out2.txt. Why does it need to FIND
this file when it's doing an EXPORT is what I do not understand. The
specification is properly defined and when I use it in Access to do an
export to delim text file all goes well. But this .vbs script will
not write to the indicated file.

If I create a blank text file with that name and put it in the proper
location, I get no error and the script completes fine, but no write
occurs to that file. I can't understand why it is not working. Any
suggestions? Thanks.

bp
"Tom Wickerath" <AO***********************@comcast.net> wrote in message
news:<jK********************@comcast.com>...
Exporting to Word Merge Format After Renaming Field Causes Error
http://support.microsoft.com/default...roduct=acc2000

__________________________________________

"Tim Eliot" <ti*@beacon.com.au> wrote in message
news:23**************************@posting.google.c om...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True

after setting stDataSource and stFileName to the desired values. Most
of the time it works, but occasionally, typically as code changes are
being made to the module, the following message appears:

"The Microsoft Jet database engine could not find the object
<stFileName>. Make sure the object exists and that you spell its name
and the path name correctly."

Once this happens the file specified in stFileName can never be used
in an export again, whether through the above command, or exporting
directly from the query named in stDataSource or any other query.
Even if I go to a completely new Access database the message will
still come up if I attempt to export to that file name.

The problem is only with Access - all other applications seem to be
able to write to the file. Also, it is only with the file in the
exact path specified in stFileName; move to another directory and the
program will work for a while.

For now I get around the problem by continually changing an
unimportant part of the file name, but that is a rather inelegant
solution. If someone has a better solution I wouldn't mind giving it
a try.

Ta for your help

Nov 12 '05 #6

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

Similar topics

10
by: Vijay Singh | last post by:
Hi Does anybody know if Oracle provides any tool or script for porting database from Oracle7.0 to Oracle8.0. I know one can do it using Oracle*Export, but I am looking for a tool. Vijay
1
by: Bridget Willey | last post by:
I am using ACT 6 and am trying to "split" the database between records for customers and junk records. The accounts designated as "customers" have that word in the ID field, and I am using that...
2
by: PC User | last post by:
I have this code from a db of a previous version of access to archive a database, but I'm using A2K and it doesn't seem to work. Can someone help me? Code:...
8
by: chippy | last post by:
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...
3
by: josh.kuo | last post by:
Sorry about the subject, I can't think of a better one. I recently wrote some PHP classes that I think might be of interest to this group. Since I have been reaping the benefits of reading news...
17
by: OdAwG | last post by:
Just some questions regarding tables. I am new Access Database and need a little help. I have the following data listed below 01. I have a table called tbl_Customer with the following...
0
by: Vinod Sadanandan | last post by:
STANDBY DATABASE MONITORING & PROTECION MODES (9iR2) This document is written for understanding and monitoring standby database configured with diffrent protection modes . MAXIMUM PROTECTION ...
6
by: mirianCalin | last post by:
i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how.. i've found this instruction on the net but i cant...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.