• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

DoCmd.TransferText changes "." to "#" in file extension and fails

When I try to execute this line of code:

DoCmd.TransferText acExportDelim, "XML_RaterExport", "tblRates", "C:\Temp\Rates.csv", True

I get an error --

Run-time error '3011':   The Microsoft Jet database engine could not find the object 'Rates#csv'

Note that somehow Access is deciding that the "." is a "#"  ???

The same thing happens with a ".txt" extension.  I was originally passing the output filename via a string variable, but I get the same results even hard-coded as above.

I'm stumped -- experts?

Thanks in advance!

JN
0
genaughton
Asked:
genaughton
  • 6
  • 6
  • 5
1 Solution
 
Rey Obrero (Capricorn1)Commented:
can you try this

sub test()
dim sFile as string, cFile as string
sfile="C:\Temp\"

cfile=dir(sfile,"*.csv")

while cfile<>""
        msgbox cfile
        cfile=dir
wend

end sub

if you can not read the field correctly ,

do a debug>compile
check all errors raised
see if you have a MISSING: from your references
do a compact and repair
do a decompile
see instruction here
http://www.granite.ab.ca/access/decompile.htm



0
 
Rey Obrero (Capricorn1)Commented:
if you can not read the field correctly ,
s/b

if you can not read the FILE correctly ,
0
 
genaughtonAuthor Commented:
Cap,

your code runs ok -- are we just checking functionality?  Note that what I'm after is an export from tblRates to a .txt or .csv file.  Jet seems to be internally changing the .csv in the code to #csv...

JN
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
genaughtonAuthor Commented:
Decompiled/compiled ok.  Same results.

JN
0
 
Rey Obrero (Capricorn1)Commented:
are we just checking functionality? yes
is you jet up to date?
0
 
Rey Obrero (Capricorn1)Commented:
0
 
genaughtonAuthor Commented:
I'm running Access 2003 SP2.  In the system info, it shows Jet version 4.0 -- this is a corporate environment, so I'm limited on what I can do software install-wise without involving IT.  Is there a known issue with Jet in this area?

thx,

JN
0
 
rockiroadsCommented:
If you manually performed an export to that same location/file, does it work?
Does the file c:\temp\rates.csv already exist? If so, its not already opened or not writable or anything like that is it? Basically have u permissions to write to that dir and overwrite that file.
Another reason might be the dll needs reregistering, see this http://support.microsoft.com/?id=292269
0
 
rockiroadsCommented:
ok, if u got A2003, the dll version will differ, but Im sure it should be easy to pickup
0
 
genaughtonAuthor Commented:
This is interesting.  In the system info for Jet Core Components, the path for Jet 4.0 shows as "Not Available" and the version is blank.  Also, if I do a search for msrd4*.* (based on the listed file name for Jet 3.0 of msrd3x40.dll), I come up with "file not found."  

It seems amazing that this would be the first issue I've hit in 6 months if the install is bad, tho(?).

JN
0
 
rockiroadsCommented:
Are you able to export manually?

0
 
Rey Obrero (Capricorn1)Commented:
can you try this...
open your VBA window
Tools>references

uncheck any of the selected references, remember it
close

do a debug>compile

now go back to references and select the one that you uncheked

do a debug>compile


see if this will make a difference

0
 
genaughtonAuthor Commented:
Cap,

Oh, crud.  When I tried exporting manually, I got an error that the fields in the table didn't correspond to the fields in the export filespec I was calling.  

I'd used an export spec during development and testing with a set file, but the production version will be exporting a table that is built "on the fly" via code code from several sources, so... , when I tried with different source files it bombed.

Thank goodness MS has nice clear error messages -- har! har!

Thanks again for your help -- I'd definitely still be banging my head on the wall if you hadn't pointed me back to basic troubleshooting.

JN
0
 
rockiroadsCommented:
Ive never been called cap before :)
0
 
Rey Obrero (Capricorn1)Commented:
rocki,
are you morphing now?
0
 
genaughtonAuthor Commented:
Holy cow.  

Well, it just shows what kind of day I've been having -- thanks rocki!

JN
0
 
rockiroadsCommented:
:-D
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 6
  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now