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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with print to file. Runtime error 54

Status
Not open for further replies.

Sorwen

Technical User
Nov 30, 2002
1,641
US
I use the following code in another database and it works fine. I'm trying to use it in a new database and I get a runtime error 54

Code:
Function WriteFile(FileName As String, FileData As String) As Boolean
Dim FileNumber As Integer
    
    FileNumber = FreeFile
    
    Open FileName For Binary Access Write As #FileNumber
    Print #FileNumber, FileData
    Close #FileNumber
    
End Function
I've used both Print and Write and get the same error.
 
Have you sufficient credential for writing ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
[tt]For Binary[/tt], you want [tt]Put()[/tt] and [tt]Get()[/tt].

CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Have you sufficient credential for writing ?"
Yes. I have full for were I'm writing to and to the file itself.

"For Binary, you want Put() and Get()."
I'll Try Put and Get, but I had no problem when I used it before and if I run that database it still works fine.
 
Put worked fine. Why the other works fine I have no clue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top