Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Code triggering Read Only Error in 2003 1

Status
Not open for further replies.

CJP12711

MIS
Jul 23, 2001
116
US
I recently upgraded an Access 97 database to 2003. Everything works great with 1 exception. When I get to the button with the below code, I get an error - 'Database or file is read only'. If I run the same code from Access 97, it has no issues. It's a copy of the same database - same tables, queries, security, etc. Any ideas why 2003 would throw up this error when writing to the dmg2pats.cpf file?

Thanks for your help!
CJ


Private Sub Command71_Click()
Dim OUTFILE
OUTFILE = "c:\windows\temp\dmg2pats.cpf"
DoCmd.OpenQuery "qryTFtoPatsDemog"
DoCmd.TransferText acExportDelim, "Dmg2pats Export Specification", "tf_DemogToPats", OUTFILE, False
MsgBox "Demog updates have been exported to " & OUTFILE & Chr$(13) & Chr$(10) & _
"NEXT: " & Chr$(13) & Chr$(10) & _
" * Import using template pCraftDmgUpd from Pats"
' " 1) Copy to L:/import" & Chr$(13) & Chr$(10) & _
'acImportDelim, "P_Demog Import Specification", "p_Demog", thePatsFile, False
'"Dmg2pats Export Specification"
End Sub
 
More recent versions of Access are fussy about extensions. You will either need to tamper with the registry or else set outfile to have a .txt, .csv, or other recognised extension.
 
Thanks for the quick response! The file extension has to be cpf, unfortunately. When you say 'tamper with the registry', can you be more specific as to what I need to change?

Thanks!!!

CJ
 
I'll give that a try... thanks so much for your help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top