Link to home
Start Free TrialLog in
Avatar of genaughton
genaughton

asked on

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
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

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



if you can not read the field correctly ,
s/b

if you can not read the FILE correctly ,
Avatar of genaughton
genaughton

ASKER

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
Decompiled/compiled ok.  Same results.

JN
are we just checking functionality? yes
is you jet up to date?
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
ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, if u got A2003, the dll version will differ, but Im sure it should be easy to pickup
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
Are you able to export manually?

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

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
Ive never been called cap before :)
rocki,
are you morphing now?
Holy cow.  

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

JN