473,557 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.TransferT ext 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 11010
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.goo gle.com...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferT ext 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("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
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************ ***********@com cast.net> wrote in message news:<jK******* *************@c omcast.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.goo gle.com...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferT ext 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***@blakespo t.com> wrote in message
news:90******** *************** ***@posting.goo gle.com...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
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************ ***********@com cast.net> wrote in message
news:<jK******* *************@c omcast.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.goo gle.com...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferT ext 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("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---


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

"Tom Wickerath" <AO************ ***********@com cast.net> wrote in message news:<Mc******* *************@c omcast.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***@blakespo t.com> wrote in message
news:90******** *************** ***@posting.goo gle.com...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
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************ ***********@com cast.net> wrote in message
news:<jK******* *************@c omcast.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.goo gle.com...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferT ext 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("A ccess.Applicati on")

objAccess.OpenC urrentDatabase ("C:\codescratc h\db1.mdb")

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

objAccess.Close CurrentDatabase
Set objAccess = Nothing

DoCmd.Quit ' Quit Access

End Function

"Blake Patterson" <bl***@blakespo t.com> wrote in message
news:90******** *************** ***@posting.goo gle.com...
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("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
Set ObjAccess = Nothing
' --- END CODE ---


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

"Tom Wickerath" <AO************ ***********@com cast.net> wrote in message
news:<Mc******* *************@c omcast.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***@blakespo t.com> wrote in message
news:90******** *************** ***@posting.goo gle.com...
Did you ever get this worked out?

I am running this script:

' --- BEGIN CODE ---
dim objAccess
Set objAccess = CreateObject("A ccess.Applicati on")
ObjAccess.OpenC urrentDatabase( "C:\codescratch \db1.mdb")

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

ObjAccess.Close CurrentDatabase
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************ ***********@com cast.net> wrote in message
news:<jK******* *************@c omcast.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.goo gle.com...
Just wondering if anyone has hit the following issue and how you might
have sorted it out.

I am using the command:

DoCmd.TransferT ext 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
2594
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
498
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 field as a lookup to separate these records from the rest of the database, which have nothing in the ID field. When I try to use the Export Wizard,...
2
1815
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: ============================================= Sub BackupMyDatabase () ' ============================================== ' Example code for ArchiveAccessObjects() '...
8
6979
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 straight Macro or script it works. Add it as an object and it won't work. HELP.
3
2927
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 groups for years, I figure it's time for me to contribute a little bit back, maybe some people out there will find this useful. * Introduction ...
17
2011
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 information listed below 02. In that table I have three columns that have numeric data in it (City, State, Marital_Status) 03. I need to convert the...
0
4711
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 -Guarantees that no data loss will occur if the primary database fails. To provide this level of protection, the redo data needed to recover each...
6
5643
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 understand 1. Export A MySQL Database This example shows you how to export a database. It is a good idea to export your data often as a backup. #...
39
5830
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 ISO-8859-1 -t UTF-8 mydb.sql mydb_utf8.sql mysqlCREATE DATABASE mydb_utf8 CHARACTER SET utf8 COLLATE utf8_general_ci;
0
7626
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7549
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7830
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5454
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5172
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.