docmd.transfertext using filename with .1 or .2 extensions

M

Marve

Hello,

Please help me with my current conversion problem from access 97 to
access 2003... we have this database which opens a file, it's basically
text but the file ext is *.1 or *.2...it uses MS Common Dialog 6.0...
Everything works on 97 but after I converted it to 2003... the program
doesn't seem to open the text files with .1 or .2 unless I change it to
..txt... I can't go on updating the files ext's because it would be a
hell lot of work.. so it would be great if someone have bright ideas to
help me overcome this problem... I'm thinking that the 2003 should be
more linient about ext's but isn't or maybe I'm just missing
something..Here';s the line of code I uses. It fails on the
line:DoCmd.TransferText acImportFixed, "PROE EXPORT", _
"TBL_DATA", sfilename



Sub Openfile(sfilename)
Dim filetoopen As String
' Turn off Display of Warnings
DoCmd.SetWarnings False
' Delete Current Contents of Table
DoCmd.RunSQL "Delete From TBL_DATA"
DoCmd.OpenQuery "DeleteLoomInfo", acViewNormal, acEdit


' Import file using PROE EXPORT Specification
DoCmd.TransferText acImportFixed, "PROE EXPORT", _
"TBL_DATA", sfilename


' Delete unused records
DoCmd.OpenQuery "loadLoomToTable", acViewNormal, acEdit
DoCmd.OpenQuery "WW delete unused records", acNormal, acEdit
' Delete WWCCT Info
DoCmd.OpenQuery "WW CCTID Delete", acNormal, acEdit
' Append WWX and Y to CCTID table
DoCmd.OpenQuery "Append WWX", acNormal, acEdit
DoCmd.OpenQuery "Append WWY", acNormal, acEdit

' Turn on Display of Warnings
DoCmd.SetWarnings True
' Change Title and Export Label to Reflect Loaded Assembly Name

'filename = Left(sfilename, InStr(sfilename, ".")) +
CStr(Right(sfilename, Len(sfilename) - InStr(sfilename, ".")) + 1)
WWName = Right(sfilename, (Len(sfilename) - InStr(sfilename, ".") +
6))

'Open report form
Dim stLinkCriteria As String
DoCmd.Openform "Report form 1", , , stLinkCriteria


End Sub


Thanks
 
D

Douglas J. Steele

Realistically, the only reason it worked for you in Access 97 is because you
didn't have all the service packs installed: that "feature" was introduced
into Access 97 by the Jet 3.5 SP3.

Check out http://support.microsoft.com/?id=306144. Don't worry that it says
Access 2000: it's the same for Access 2002 and 2003 as well.
 
M

Marve

Thank you! I did change the registry settings and add the extension we
use. Now all works.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top