-
[RESOLVED] DOS error?
I upgraded a user from XP SP3 to Windows 7 Professional. Now, when he runs a report (CR 9) and tries to extract to an Excel spread sheet he gets this error:
Dos error - <report name>
This is the code
Code:
Set Report = crxApplication.OpenReport("Z:\DAD\OnHandCustomerBalance.rpt", 1)
For Each crxDatabaseTable In Report.Database.Tables
crxDatabaseTable.ConnectionProperties("user id") = "sa"
crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechniSQL
Next crxDatabaseTable
Report.ExportOptions.FormatType = crEFTExcel80Tabular
Report.ExportOptions.DiskFileName = "C:\CustomerBalance.xls"
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.Export False
-
Re: DOS error?
Maybe it doesn't like writing a file to the "C:\" root. Have you tried creating a sub folder, like "xlsExport" and then set the option like this,
Code:
Report.ExportOptions.DiskFileName = "C:\xlsExport\CustomerBalance.xls"
Also, Do you know which line of code is causing the error?
-
Re: DOS error?
i agree with the above, except that the file should be saved to the user's "my documents" folder.
The only other folder he would have permission to save to would be appdata, and it's hidden.
Try coding a relative path.
As far as i am aware, the restriction only applies to operating system drives. You could probably read/write to z all day long. However, is that an actual drive or a ramdisk?
As far as creating the new folder above, this would probably work if the current user is given ownership of it.
-
Re: DOS error?
"Z:" is a mapped network drive
This is the 1st I have run across this. However, it is also the 1st time putting the system on a Windows 7 PC. I am in a bizarre learning curve with it.
-
Re: DOS error?
I changed the code to create the XL on a different directory then C: and it worked. Windows 7 has some strange security bits.