Database or object is read-only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to run this:
Function TESTPPS()
Dim temp1 as string
temp1="T:\CLEARWIN\COACANCELS\PPS\PPS_TEST.CSV"
DoCmd.Transferspreadsheet acExport, , 'PPS_CANCELS", temp1, true
End Function

Why does this give me the error : "Database or Object is read-only"
Scott
 
Hi Scott,

The probably reason is that you have used a file extension (CSV) that
specifies a text file with a VBA method (TransferSpreadsheet) that
creates an Excel worksheet. You must either use TransferText to create a
CSV file, or pass an XLS filename to TransferSpreadsheet.
 
Hi John, your are right. I changed the .CSV to .XLS and it worked perfectly.
It seems that the command SET WARNINGS off suppress the error.

Next question:
Here is the command.
DoCmd.TransferText acImportDelim, "standardCSV", "PPS_CANCELS", temp1, True

How do you make "StandardCSV"?
I am looking but as of right now I can't find the wizard that the help file
mentioned.
Is there a default format that makes a “CSV†file?

Scott
 
I got it. thanks for your time John.

Scott Burke said:
Hi John, your are right. I changed the .CSV to .XLS and it worked perfectly.
It seems that the command SET WARNINGS off suppress the error.

Next question:
Here is the command.
DoCmd.TransferText acImportDelim, "standardCSV", "PPS_CANCELS", temp1, True

How do you make "StandardCSV"?
I am looking but as of right now I can't find the wizard that the help file
mentioned.
Is there a default format that makes a “CSV†file?

Scott
 
Back
Top