Steps for Deploying on the Web

You can deploy your Microsoft English Query application on the Web, using Internet Service Manager (IIS). If you’re using Internet Service Manager version 4.0 or greater, you can use Setupasp.vbs to do this task automatically. For earlier versions of IIS, refer to "Deployment Steps for Internet Service Manager 3.0 and Earlier." You can also embed a domain file (.eqd) in an ASP page, which is described in this section. For more information about sample files containing VBScript, see What You Need to Deploy on the Web.

Automatic Deployment with Setupasp.vbs (for Internet Service Manager 4.0)

If you’re running Internet Information Server 4.0 and IIS with the Windows Scripting Host installed, the simple way to deploy a Web page that allows users to pose questions to your English Query domain is to run Setupasp.vbs. It is in the \Program Files\Microsoft English Query\Samples\Asp2 directory.

Setupasp.vbs is a Windows Scripting Host (WSH) script  that copies the ASP files and the domain file (.eqd) to a directory on the Web server, creates an IIS virtual directory for the English Query pages, and sets options in a file called Params.inc, which indicates to the ASP script where to find your database. Then you can test your application and link to the page from other Web pages on your site, including other ASP applications.

Deployment Steps for Internet Service Manager 3.0 and Earlier

If you're running Internet Information Server versions 3.0 and earlier, follow these steps:

    To deploy using earlier versions of Internet Service Manager

  1. Copy the sample files (.htm, .inc, .asa, and .asp) from the \Samples\Asp2 directory to a directory of your choice, such as, C:\Pubs.
  2. Copy the files in the \QB subdirectory to a subdirectory such as C:\Pubs\QB.
  3. Start Internet Service Manager.
  4. Double-click the computer that contains the directory you specified in step 1.
  5. Click the Directories tab, and double-click the directory specified in step 1.
  6. Select Read and Execute or Read and Script. Click OK.
  7. Select Enable default document, and type Default.htm.
  8. In a text editor, open Params.inc, and update the value of the parameter called DomainFile with the name of the sample application: Pubs.eqd. (You can also specify an .eqc file; however, the .eqc file runs more slowly than a compiled application file.). For example,
  9. Application("DomainFile") = "C:\Pubs\Pubs.eqd"

  10. Modify the database parameters in Params.inc to reflect the data source name, database username, and password:
  11. Application("DSN") = "Pubs"

    Application("Login") = "My_name"

    Application("PWD") = "My_password"

  12. Decide if your application should be optimized for low simultaneous usage or high simultaneous usage. Set the the Application("Deployment") parameter to "Internet" if you will have high numbers of simultaneous users. Otherwise the Deployment parameter defaults to "Intranet," which results in slightly faster performance for small numbers of users, but doesn't scale quite as well. The application will work fine with either value; this parameter is for performance optimization only.
  13. Modify the other parameters in Params.inc to reflect your installation.
  14. Create (or edit) a plain text .eqq file (for example, Pubs.eqq) with a list of appropriate sample questions, one per line.
  15. Test the application by accessing it in your Web browser: http://localhost/pubs

Embedding a Domain File Into Your Own Active Server Page

You can also integrate your English Query application into other ASP applications. For example, you might make an English query text box available on a search page.

The following code fragment (a simplified version of the ASP sample code) shows the essence of how to convert users’ supplied questions into SQL. You could embed code like this into the ASP page that processed the user’s query.

Set objEQSession = Server.CreateObject("Mseq.Session")
objEQSession.InitDomain(Application("DomainFile"))
Set objEQResponse = objEQSession.ParseRequest(strQuest)

Select Case objEQResponse.Type
Case nlCommandResponse
    Set objCommands = objEQResponse.Commands
    For intCommand = 0 To objCommands.Count - 1
        Set objCommand = objCommands(intCommand)
        Select Case objCommand.CmdID
        Case nlQueryCmd
            DoSQLCommand objCommand
        Case nlAnswerCmd
            Response.Write objCommand.Answer
    Next
Case nlUserClarifyResponse
    DoClarification objEQResponse, strQuestion
Case nlErrorResponse
    Response.Write objEQResponse.Description & "<BR>”
    Response.End
End Select

In this sample, the English Query object is created with Server.CreateObject(“Mseq.Session”). To load the domain, InitDomain method and the name of the .eqd file is called. A response object is returned by calling the ParseRequest() method with the user’s question. The response can be a command response, which is a set of commands that are either SQL commands or direct answers that English Query can supply without needing you to supply SQL.

The SQL command is executed against your SQL Server database, and you generally display the result as a table on your Web page. The process of executing the SQL command using Active Data Objects (ADO) and displaying the result in a table is embedded in the DoSQLCommand function (available in \Program Files\Microsoft English Query\\Samples\Asp\Common.inc).

If the command is an answer, it’s displayed directly to the user. The response might also be a request for clarification. For example, the question might be “what are all authors in Washington,” and the clarification might ask whether Washington was a city or a state. The DoClarification call (also available in Common.inc) encapsulates the code necessary to prompt the user to disambiguate the question, by displaying possible values from the UserInputs collection on the response object.


(c) 1996-1998 Microsoft Corporation. All Rights Reserved.