Programming Options

You may want to programmatically change a project (for example, by using Microsoft® Visual Basic® or Microsoft Visual C++® to edit the .eqp file), generate a new connection file from it, and then (using the object model), build a new application (eqd).

Generating a New Connection File

You can automatically generate the new connection file by running Microsoft English Query with a command-line switch — /t, for translate. For example:

mseqdev /t pubs.eqp

This command line will translate Pubs.eqp into Pubs.eqc. The /t switch causes English Query to load the project, save the specified connection file, and then exit.

Creating an Application File from a Connection File

Although the primary use of the object model is for the deployment of application files on the web, you can also use it to programmatically create an application file (.eqd) from a connection file (.eqc).

The following sample code uses the SaveApplication method, which takes as its arguments an .eqc and eqp filenames, a database connection handle, and a user ID and password (the maxwords argument is optional):

    Dim myServer as object

    Set myServer = CreateObject("MSEQ.Server")

    myServer.SaveApplication "pubs.eqc", "pubs.eqd", "MyPubs", "guest", "guest"


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