The Processing Instruction Target Matching “[xX][mM][lL]” is Not Allowed

When running Java or other types of applications which use an XML file as part of the input, you may see this error: The Processing Instruction Target Matching “[xX][mM][lL]” is Not Allowed.

Often the cause is a malformed XML file, with a common problem being a blank line accidentally inserted before the required first line of the xml:

[ A blank line here will cause the error ]
<?xml version-"1.0"?>
Continue reading

FTP a file from one server to another, automatically

We are using an ASP script to create iCal files from a database, so another department can display the events on their web-based calendar.

Their calendar page is outside the corporate firewall. The ASP script needs to reside on and IIS server within the firewall. I needed a fool-proof way to transfer the ical file nightly out to an external web server so it could be accessed by any calendar applications that need to use it. The best way I’ve found so far is to create a batch file with command-line FTP instructions, and add it to a Windows scheduled task.

  1. To do this with your own files, create a directory that will hold the batch file somewhere on the server. Since the batch file will contain your destination server’s ftp password in plaintext, you will want to secure the directory. Create a Windows or domain account whose password will never change. I happened to have a “utility” domain-based account that already had access to some parts of the server, so I gave that account rights to the new directory.

Continue reading

SQL Server or SQL Server Express: Connection Error: (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.

After a server containing a SQL Server database is restarted, you may get the error

Connection Error: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.

Or you may get an error like the one below:

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connection.s (provider: Shared Memory Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)”

Continue reading

Fixing the error: JAVA_HOME is not set on a Mac

While setting up Nutch on a Mac, I kept getting this error in the terminal:

Error: JAVA_HOME is not set

To fix the error on OS X 10.6.x (Snow Leopard), enter the following at the command prompt:

export JAVA_HOME=$(/usr/libexec/java_home)

On 10.5 and above, the command line tool /usr/libexec/java_home dynamically finds the top Java version specified in Java Preferences for the current user. Using this method will allow the path to automatically change as software updates change Java versions.

Continue reading

SQL Server Express tutorial: Add a built-in user to a database

In IIS, several built-in Windows accounts are created automatically during installation. These include IUSR_MachineName, IWAM_MachineName, and ASPNET, each of which has specific privileges. Web applications will often require that the IUSR account have rights to connect to SQL Server Express.

Here’s how to give this account permissions in the SQL Server database, when the database is located on the same box as the application.


  1. Open  SQL Server Management Studio.

  2. Right click the folder “Users” in the path
    Databases > Database Name > Security

    2010-08-18_18.27.18.jpg


  3. Select New User. . . from the popup menu.

    2010-08-18_18.27.35.jpg


  4. Continue reading

SQL Server tutorial: Copy database tables to another database

To export the table structure and data from one SQL Server database to another existing or new database, use the Export Data… function in SQL Server Management Studio. This procedure will not copy any of the other database objects such as constraints, stored procedures, or users.


  1. In the Object Explorer, right click the name of the database. Select Tasks >Export Data…


  2. Continue reading

How to set up an ODBC Data Source for a SQL Server database on a Windows Server

Many web applications require that you set up an ODBC Data Source which serves as a sort of pointer to a particular database which specifies which driver and credentials to use to connect. Here’s how to set up one for SQL Server/SQL Server Express on a Windows 2003 server.

  1. Select Start > Administrative Tools > Data Sources(ODBC)

     odbc data sources


  2. Select the System DSN tab, and click the Add button.

    2010-08-18_17.58.49.jpg


Continue reading