|
-
May 18th, 2011, 08:04 AM
#1
Thread Starter
PowerPoster
[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
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 18th, 2011, 01:13 PM
#2
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?
Last edited by wes4dbt; May 18th, 2011 at 01:19 PM.
-
May 18th, 2011, 01:20 PM
#3
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.
-
May 18th, 2011, 01:37 PM
#4
Thread Starter
PowerPoster
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.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 18th, 2011, 01:46 PM
#5
Thread Starter
PowerPoster
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.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|