BUG: ExcelSample Database Setup.bat Fails If the Path Contains a Space (828088)



The information in this article applies to:

  • Microsoft Office Professional Edition 2003
  • Microsoft Visual Studio Tools for the Microsoft Office System version 2003

SYMPTOMS

When you run Setup.bat for the ExcelSample database that is used with some of the Microsoft Visual Studio Tools for the Microsoft Office System samples, the database is created, but the tables are not populated with data. If you examine the Database.log file in your Temp directory, you can see that Setup.bat generated the following error message:

XML parsing error: Invalid at the top level of the document.

CAUSE

This problem occurs if the path of Setup.bat contains a space.

STATUS

Microsoft has confirmed that this is a bug in Visual Studio Tools for Office.

RESOLUTION

To resolve this problem, you can use either of the following methods:
  • Copy the ExcelSampleDatabase folder to a folder where the full path does not contain any spaces.
  • Modify the Setup.bat file so that the file path is converted to the 8.3 notation. To do this, you must replace the following line of code in the Setup.bat file:
    set SRCDIR=%~sp0
    Replace the previous line of code with the following line of code:
    set SRCDRIVE=%~d0
    set SRCDIR=%~sp0
    set SRCFULL=%SRCDRIVE%%SRCDIR%
    set SRCDIR=%SRCFULL:setup.bat=%
    
If you have already run Setup.bat one time, and it was not successful, you must first delete the ExcelSample database before you run Setup.bat again. To do this, follow these steps:
  1. Start a command prompt.
  2. At the command prompt, type osql.exe -E, and then press ENTER.

    Note For help about how to use the osql command and the oSQL parameters, type osql /? at the command prompt.
  3. Type drop database ExcelSample, and then press ENTER.
  4. Type go, and then press ENTER.
  5. Close the command prompt window.

MORE INFORMATION

Sample solutions that you can open in Microsoft Visual Studio .NET are included in Visual Studio Tools for Office Help. The documentation for each sample includes step-by-step instructions about how to build and how to run the sample. For those samples that require a database, a script (Setup.bat), and data files, all these are supplied with the sample that is used to create the database. The following samples use the ExcelSample database that is described in this article:
  • Excel Worksheet Using ADO.NET Sample (ExcelReadWriteADO)
  • Excel Worksheet with Custom Text Sample (ExcelReadCustomUser)
  • Excel Worksheet Using a Windows Form Sample (ExcelReadWinForm)
The success or the failure of the Setup.bat script is reported in a Database.log file that is located in your Temp directory. To view the contents of this report, type %temp%\database.log at a command prompt.

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbBug kbSample KB828088 kbAudDeveloper kbAudITPRO