Results 1 to 5 of 5

Thread: [RESOLVED] DOS error?

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Resolved [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]

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,517

    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.

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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]

  5. #5

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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
  •  



Click Here to Expand Forum to Full Width