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
Application("DomainFile") = "C:\Pubs\Pubs.eqd"
Application("DSN") = "Pubs"
Application("Login") = "My_name"
Application("PWD") = "My_password"
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.