Copyright: © 1995 Crescent Div. of Progress Software Corp.
Citation: © 1995 Crescent Division of Progress Software Corporation


Contents
 EnQuiry Help Contents
Technical Support	Copyright

 How to Use EnQuiry

 The EnQuiry Interface

EnQuiry Toolbar

Query Builder

Query Map

Query Preview

 Reference Information

EnQuiry Preferences

EnQuiry Properties

EnQuiry Query Advisor

Error Messages

SQL Select Statement Syntax

Glossary


Query Builder Pane
Query Builder

The primary EnQuiry workspace. Within Query Builder, select tables and fields to query and build various clauses associated with the SQL Select statement.

It contains access to these objects:


Query Map Pane
Query Map

Visually represents your query, including the tables you’ve selected and the join relationships among those tables. Fields you’ve selected as part of the query are displayed in bold type. Query Map lets you modify join relationships. Using the "What's This?" help function, you can also get schema information about your selections.

Click on each of the three Query Map interface elements (Table Object, Join Lines, or Join Operator buttons) below for a brief description.


Query Preview Pane
Query Preview

Provides an environment in which you can verify that your query returns the expected results in either grid or freeform layout.

You can use the [image] (Freeform) and the [image] (Grid) icons on the Toolbar to change the layout style

Current record number in status bar


Select Database

Connects to an existing database, either Microsoft Access 2.x or higher or ODBC for the current query-building session. EnQuiry keeps track of the database that you last connected to.

Dialog Box Options

File Name

List Files Of Type

Microsfot Access Files (*.mdb)

Drives

Directories

Network


Select Tables
See also Selecting Tables.

Lets you select tables to query from the list provided. Only tables that reside in currently connected databases are displayed. To access, click the [image] button in the Tables pane or click Edit->Tables.

Dialog Box Options

Available Tables

Selected Tables

Add button

Remove button


Select Fields
See also Specifying fields.

Lets you select fields to query from the list displayed. To access, click the [image] button in the Fields pane or click Edit -> Fields.

If your tables have many fields, you can click a single table in the tables selection box so that EnQuiry displays only the fields in that table for selection. EnQuiry also supports the standard Microsoft Windows multiselect behavior.

You can also add aggregates.

Only fields that reside in previously selected tables are displayed.

Dialog Box Options

Databases

Tables

Available Fields

Resultset Fields

Aggregate Functions

Count(*)

Count

Sum

Min

Max

Avg

Schema Information


Conditions Builder
See also Specifiying Conditions.

Lets you specify the criteria for filtering data returned by the query. You use it to build a Conditional Expression.

Distinct Check Box

Check this box if you want to retrieve only distinct sets or values in specified fields. The default is All.

Dialog Box Options

Dialog Box Grid

Field Expression

Operator(s)

Field(s) or Value(s)

Connective(s)

Database(s)

Table(s)

Fields

SQL Syntax Operators

Insert Line

Delete Line

Clear All

Operator Help

Schema Information

Schema Information

Browse selected subset for review


Join Builder
Joins Builder
See also Building Joins.

The Joins Builder lets you specify the criteria for joining tables. EnQuiry builds an equi-join when it can make assumptions about the data in your database. For example, an equi-join is assumed when two fields in different tables have the same field name, and the same data type.

Use this dialog box to modify the equi-join that EnQuiry built for you, or to define your own join relationships.

 NOTE: Duplicate, reflexive, and redundant joins are not allowed. Joining tables on fields of different types can cause EnQuiry to give a warning, but it allows you to proceed. If the data types are incompatible (for example, integer and character), you will receive an SQL runtime error when you retrieve data.

Dialog Box Options

Dialog Box Grid

Field (left hand)

Operator Selection List

Field (right hand)

Join Type

Databases

Tables

Fields

Insert Line

Delete Line

Clear All

Join Type Help

Schema Information

Schema Information

Browse selected subset for review


Sort By Builder
Sort Builder
See also Specifiying Sort Order.

Lets you specify the fields that you want the retrieved data sorted on, and the way you want it sorted (ascending or descending).

Dialog Box Options

Dialog Box Grid

Fields

Order

Databases

Tables

Fields

Insert Line

Delete Line

Clear All

Schema Information

Schema Information

Browse selected subset for review


Group By Builder
See also Grouping Records.

Lets you specify the fields that you want the retrieved data grouped by. Often used in conjunction with aggregates.

Dialog Box Options

Dialog Box Grid

Fields (Group By)

Databases

Tables

Fields

Insert Line

Delete Line

Clear All

Schema Information

Schema Information

Browse selected subset for review


SQL Text Dialog

The SQL statement exactly as it will be used to retrieve data from the database. Use this dialog to view your SQL query, to identify problems reported by the Query Advisor, or to copy the text and place it in the clipboard.

 NOTE: SQL uses brackets to surround Microsoft Access database field names and table names with spaces.


Tables
Presents the Select Tables dialog box that contains a list of the tables contained in the connected database. Select the table(s) that you want to build the query against. EnQuiry places the tables in the Selected Tables box.


Fields
Presents the Select Fields dialog box that contains a list of fields contained in the connected database and selected tables. Select the field(s) that you want to include in the query. EnQuiry places the fields in the Selected Fields box.


Conditions
Presents the Conditions Builder dialog box that enables you to specify criteria for filtering the data that the query retrieves from the database. For example, you might use the Where Clause to specify that you only want customers whose current balance is greater than $1,000.00. You can specify All or Distinct to filter your data from specified fields.


Joins
Presents the Joins Builder dialog box you use to build a Join Clause. Use joins if you access data from more than one table in a database.

For example, you might have a database table of customer addresses and a separate table of customer orders. Each table contains a customer ID field. To mail an order to a customer, you build a Select statement that retrieves data from both the Customer Address and the Customer Orders table. You would retrieve the data by joining the tables on the Customer ID field.


Sorts
Presents the Sort By Builder dialog box that you use to build an Order By Clause.

The Order By Clause lets you specify a sort order (ascending or descending) for the data returned by the query. You can specify a sort order on any number of database fields.


Groups
Presents the Group By Builder dialog box that you use to build a Group By Clause.

The Group By Clause lets you group the records returned by a query according to the value in a specified field.

For example, you might want to retrieve all of the customers who ordered a product from you during the last year, but you want to view the data as summary by the month in which it was ordered. You would include a Group By phrase on the Date Ordered field.


Table Icon
Table Object

Visual representation of the tables in the query in the Query Map.


Join Lines

Visual representation of the join relationships between queried tables in the Query Map.


Join Operator Buttons
Join Operator Button

Visual representation of the join type between queried tables in the Query Map. Enables access to the Joins Builder dialog box. Click the Join Operator button to display it.

You can modify or delete the current join by modifying the contents of the Joins Builder dialog.


Retrieve Data

To execute the query and display the resultset that meets the specified criteria, click [image] on the Toolbar or select View->Preview Query Results from the main menu. If the SQL statement contains invalid parts that cannot be executed, Retrieve Data returns a detailed error message about the problem. Use the Query Advisor to view details.


Preferences

Use this to display EnQuiry preferences in your working environment that you can select and change.


SQL Text

Use this to display the SQL Select statement EnQuiry generated.


Switch to Grid
Grid Preview

Use this to display the resultset in a row-and-column format.


Switch to Freeform
Freeform Preview

Use this to display the resultset as text boxes with label controls. Use the data control to navigate the resultset. This is the default format.


VB Toggle Button
Switch to Visual Basic

Use this to move between the EnQuiry Editor and the Visual Basic form.


Greater Than or Equal Operator (=>)
Greater Than or Equal Operator (>=)

Lets you retrieve database records whose value is greater than or equal to a value that you specify.


IN Operator

Lets you specify a list of values in which the queried field value must be contained.


NOT IN Operator

Lets you specify a list of values that you do not want retrieved from the database.


LIKE Comparison Operator
LIKE Operator

Lets you specify a pattern of characters that you want to retrieve from the database. The match pattern that you specify is flexible. You can match a complete pattern, or you can specify a string in which certain symbols (called wildcards) have special meaning. Note that all pattern matches are case sensitive by default.


NOT LIKE Comparison Operator
NOT LIKE Operator

Lets you specify a pattern of characters that you do not want retrieved from the database. The match pattern that you specify is flexible; that is, you can specify a complete match, or you can specify a string in which certain symbols (called wildcards) have special meaning. Note that all pattern matches are case sensitive by default.


BETWEEN Comparison Operator
BETWEEN Operator

Lets you specify a range of values that you want retrieved from the database.


NOT BETWEEN Comparison Operator
NOT BETWEEN Operator

Lets you specify a range of values that you do not want retrieved from the database.


Equal Operator (=)

Lets you retrieve database records whose value equals a value that you specify.


Not Equal Operator
Not Equal Operator (<>)

Lets you retrieve database records whose value does not equal a value that you specify.


Greater Than Operator
Greater Than Operator (>)

Lets you retrieve database records whose value is greater than a value that you specify.


Less Than Operator
Less Than Operator (<)

Lets you retrieve database records whose value is less than a value that you specify.


Less Than or Equal Operator
Less Than or Equal Operator (<=)

Lets you retrieve database records whose value is equal to or less than a value that you specify.


Conditional Expression

A statement that compares the relationship (such as equal, or greater than) of two (or more) items.


Glossary

A

Add-in

Arithmetic operator

Ascending

B

C

Conditions

Conditional expression

Control

Clause

Constant

D

DAO

Database

Descending

Duplicate join

E

Expression

F

Field

Form

G

Group by

H

I

Inner join

J

Join

K

L

Left join

Logical expression

M

Modal

Modeless

N

Null

Numeric operator

O

ODBC

Operator

Outer join

P

Property

Q

Query

Query builder

Query map

Query preview

R

RDC

Record

Redundant join

Reflexive join

Relational expression

Relational operator

Resultset

Right outer join

Row

S

Search condition

Select

Sort

SQL (Structured Query Language)

String

T

Table

U

V

Value

W

Where clause

X-Y-Z


Where Clause

The primary clause of the Select statement. It lets you specify the conditions that records must meet to be returned by a query.


Value

A literal (non-null) data type that is specific and unchangeable. Also called a constant.


Ascending
Ascending (ASC)

The arrangement of data in order from the lowest value to the highest value, according to the rules for comparing data.


Condition

A logical expression.


Control

The element of Visual Basic that you use to create user interface objects. You can use them to get input from users and to display output to users. Examples include boxes, buttons, and labels. You define the appearance of a control using properties. You define their behavior using code or methods.


Clause

An element of an SQL statement that contains a group of expressions or phrases that perform a function, such as specifying ordering and sorting of data returned by a query.


Constant

A value that does not change during program execution. Also known as literal.


Database

A collection of logically related tables or fields whose values can be accessed or retrieved.


Descending
Descending (DESC)

The arrangement of data in order from the highest value to the lowest value. May vary according to the rules for comparing data.


Expression
See also Constant and Operator.

A combination of constants, variables, expressions, and parentheses used to perform a computation. An expression can consist of a single constant or variable or a complex arrangement of operators and functions.


Field

The smallest unit of useful information. A component of a record that holds a data value. Also called a column.


Form

A Visual Basic window that contains controls, graphics, and other forms. It is the Visual Basic application’s interface. EnQuiry generates controls that hold the query information and that can be added to any new or existing Visual Basic form.


Inner Join

The most common type of join. An inner join combines records from two tables whenever there are matching values in a field common to both tables. This is the default.


Join

A query operation that combines data from multiple tables.


Left join
Left Outer Join
See also Right join, Inner join, Outer join, and Join.

A join type that includes all records from the first (left-hand) of two tables. Combines records of both tables where the values of the join tables match or the value of the join field in the left-hand table is null.


Logical Expression

An expression that contains logical or relational operators. It can be evaluated to be either true or false.


Modal

A dialog box that requires an action before the user can continue. The Condition, Sort, Join, and Group dialog boxes are modal.


Modeless

A dialog box that lets the user shift focus without responding to the dialog box. The Query Advisor is a modeless dialog box.


Null

A special value that indicates the absence of any information.


Numeric Operator

See Operator.


Operator

Two types of operators are used in EnQuiry: arithmetic and comparison.

An arithmetic operator is a character or symbol that indicates an arithmetic operation can be performed between two or more expressions. Arithmetic operators include + , - , * , and /.

A comparison operator is a character or symbol that indicates a relationship between two or more expressions. They include < (Less than), <=(Less than or equal to), > (Greater than), >= (Greater than or equal to), <> (Not equal), = (Equal), IN , BETWEEN, LIKE, and NOT.


Property

A Visual Basic construct that allows you to modify the appearance and behavior of Visual Basic controls. For example, properties change the color or size of a control, or the ability to minimize or maximize a control.


Query

A query retrieves records from a database. You can define criteria in the query to filter the database records retrieved.


Query Builder

The main portion of the EnQuiry working environment where you build the query.


Query Map

Displays a visual representation of the current query. Use this EnQuiry component to view the tables in the query and their join relationships that you build with the Query Builder.


Query Preview

Use this component to view the resultset returned by the query from within the EnQuiry development environment.


Record

A group of related data treated as a single unit. Also called a row.


Relational Expression

A logical statement that describes the relationship (like equal or greater than) of two expressions.


Relational Operator

The reserved words or symbols used to express a relational condition or expression.


Right join
Right Outer Join
See also Left outer join, Inner join, Join.

A join type that includes all of the records from the second (right-hand) of two tables. This combines records of both tables where the values of the join tables match or the value of the join field in the right-hand table is null.


Row

See Record.


Search Condition

The criteria for extracting data from a database.


Select
Select Statement
See also SQL Statement.

A statement in SQL that you use to query the database.


Sort

A way in which data is ordered. It can be Ascending or Descending.


Structured Query Language (SQL)

The language used to structure, query and maintain relational databases.

Select Statement Syntax


SQL

See Structured Query Language.


String

A character string.


Table

A collection of logically related records organized into records (rows) and fields (columns).


Arithmetic Operator

A symbol used to indicate a mathematical expression. These symbols include +, -, *, /, [, ], and NOT.

 NOTE: Certain SQL dialects require placing the NOT operator in specific locations in the the SQL statement. Refer to your SQL documentation for further information.


Select Statement Syntax
SQL Select Statement
See also Aliases and SQL-Supported Statements Not Supported by Microsoft Access.

The SQL Select syntax that the Query Builder generates is a subset of the SQL-92 standard put forth by the American National Standards Institute (ANSI). EnQuiry also places brackets ([]) around table and field names containing embedded space characters, as supported in Microsoft Jet Database Engine SQL. Below is a simplified syntax diagram of the Select statement that the Query Builder generates.

SELECT [DISTINCT]

From Clause	{column [, column]... FROM [table-list|join-spec]}
Where Clause	[WHERE logical-expression]
Order By Clause	[ORDER BY field-name [ASC|DESC] [, field-name [ASC|DESC]]...]
Group By Clause	[GROUP BY field-name [, field-name]...]
In a Select statement, you must specify the tables and fields from which you want to extract data. You can also specify several different clauses that allow you to limit and order the rows returned in the result set of the query. A clause is a segment of a statement that contains SQL keywords and expressions that refine how the statement performs an action. For example, the Select statement can contain an Order By clause. The Order By clause lets you specify how you want to sort the rows of data in the result set returned by the query.

Different portions of the Query Builder construct the various parts of the Select statement. Use the [image] SQL Text button or SQL Text option on the View menu to view the Select statement under construction for the current query definition.

EnQuiry supports the following SQL keywords:

SELECT field(s) or aggregate   FROM 	table(s)    join-type:

Count(*)	Inner join

ALL 	Right outer join

DISTINCT 	Left outer join

AVG	Full outer join

MIN

MAX

SUM

Count

WHERE	field	comparison operator	expression

<

<=

>

>=

<>

=

LIKE

Not LIKE

BETWEEN

Not BETWEEN

IN

Not IN

GROUP field(s)

ORDER BY 	 field(s)	ASC DESC

 NOTE: Refer to the Getting Started with EnQuiry manual for further information on SQL statements.


FROM

An SQL Select statement clause that specifies the database tables from which you want the query to extract data. This is the only required clause in the Select statement.


ORDER BY

An SQL Select statement clause that lets you specify the order in which you want to display data returned by the query. You can specify that data be returned in ascending or descending order.


COUNT*
Count(*)

An aggregate function that counts the number of records in the result list (including duplicate rows).


All

A function that retrieves all values in the specified records or fields. This is the default.


Distinct

A function that retrieves only unique sets of values in the specified records or fields.


Avg

An aggregate function that calculates an average value for all values of the field in the result set.


Min

An aggregate function that returns the minimum value of all values of the field that you specify.


Max

An aggregate function that returns the maximum value for all values of the field that you specify.


Sum

An aggregate function that calculates the sum for all values of the field that you specify.


Full Outer Join

A join type that combines records from two tables based on the values in the field on which the tables are joined. Records are returned when values in both fields match or when either field is null.


Group By

An SQL Select statement clause that extracts values from rows that have the same value as specified columns.


Getting Technical Support

Technical Support

The Crescent Division of Progress Software Corporation technical support staff is ready to help you with problems that you encounter when installing or using EnQuiry.

If you need technical support, contact the Crescent Division using any of the following methods. Please have your product name, version number, serial number, and system configuration information available so that the Crescent technical support staff can process your support requests efficiently.

By Telephone	By BBS	By Internet
By FAX	By CompuServe	By Mail


DAO

Data Access Object, used to connect to and interact with a database.


Clear a query
Clear Clause/Query

To clear a clause:

Click Clear All in the Conditions Builder, Joins Builder, Sort Builder, or Group Builder dialog box.

To clear a query:

Click File->Clear Query from the EnQuiry menu to create a blank query form.


Modify a Group By Specification
Modifying Group By Specifications
See also Reordering Fields.

Removing a Group By specification

Reordering the Group By clause

Adding new Group By specifications


Field (left hand)
Field (Left-Hand)

Use this area in the Joins Builder dialog to specify the name of the field that you want to join to a field in another table.


Operator Selection List

Presents a list of operators for defining the relationships in the Joins Builder dialog. Choose from these operators: =  , <>, <, <= , >, =>.


Field (right hand)
Field (Right-Hand)

Use this area in the Joins Builder dialog to specify the name of the field that you want to join to the field in the first Field specification list on the same line. Select the field name by first selecting a table name from the Tables selection list and then the desired field from the Fields selection list.


Join Type Selection List

Select the join type from the list box. EnQuiry supports these join types: inner, right-outer, left-outer, full-outer.


Databases List

Displays the name of the currently connected database.


Tables List

Displays the names of the tables that you can include in the query.


Fields List

Displays the list of fields that you can use to define the query.


Insert Line

Use this to insert a blank line to the query. When you click Insert Line, EnQuiry inserts a blank line before the line where the cursor is currently positioned.


Delete Line

Use this to delete a line from the query. When you click Delete Line, EnQuiry deletes the specification on the line where the cursor is currently positioned.


Clear All

Use this to clear the dialog.


Fields (Sort By)

Choose the field that you want to sort the data in from the Fields selection list.


Order (Sort By)

Choose the way that you want the data sorted. When you choose ASC, data is sorted in ascending order (this is the default). When you choose DESC, data is sorted in descending order.


Field Expression

Lets you specify the field or expression that you want to build a condition for. You populate this field by selecting the field from the Fields list on the dialog box or by entering text (or both).


Operator(s)

Presents a selection list with the operators that you can use to compare the relationship of the items you specify in the condition you are defining. You can choose from these operators: IN , NOT IN, LIKE , NOT LIKE , BETWEEN ,NOT BETWEEN , = , <> , > , < , => , <=


Field(s) or Value(s)

Lets you specify a field name or constant  value that completes the condition.


Connective(s)

Lets you build a compound condition. The possible values are AND (the default) and OR. Specifying AND requires that the conditions both be true for the condition to be true. Specifying OR indicates that only one part of the condition must be true for the condition to be true.


Table(s)
Available Table(s)

Presents the tables you can select to build your query.


SQL Syntax Operators

Valid operators to use in the left and right expression of an SQL statement. Select any operator while you are building your query by clicking on it.


EnQuiry Toolbar

Preview Query Results

First

Previous

Next

Last

SQL Text

Grid Preview

Freeform Preview

Properties

Preferences

Switch to VB

Query Advisor


Layout Properties
Properties

Use this to display and modify the properties used in EnQuiry for Database, Control, and Form layout.


First

Use this button to move to the first record in the resultset.


Previous

Use this button to move to the previous record in the resultset.


Next

Use this button to move to the next record in the resultset.


Last

Use this button to move to the last record in the resultset.


Fields (Select Fields)
Available Fields (Select Fields)

Select and deselect fields that you want to include in the query’s resultset by clicking the field name.


Aggregate Functions

Lets you determine statistics on sets of values.


Count(*) (Select Fields)
Count(*)

Use to count the number of records in the record set.


Count (Select Field)
Count

Use to count the number of records that meet the query criteria for that field.


Avg (Select Fields)
Avg

Use to determine the arithmetic mean (the sum of the values divided by the number of values) of a set of values in the specified field.


File Name

Select or type the name of the database you want to connect to. This box lists databases with the filename extension selected in the List Files Of Type box.


List Files of Type

Select the type of file you want to see in the File Name list. The default is *.mdb.


Microsoft Access Files (*.mdb)

Lists all Access databases in the current directory.

 NOTE: SQL uses brackets to surround Microsoft Access database field names and table names with spaces.

SQL-supported statements not supported by Microsoft Access:

•	Full outer join type in the Joins Builder


Drives

Select the drive that contains the database you want to connect to.


Directories

Select the directory that contains the database that you want to connect to.


Network

Opens the Connect Network Drive dialog box so that you can make a connection to a network drive.

 NOTE: This button appears only on network-connected systems.


Using EnQuiry

1	Use EnQuiry to define a database query. The Query Builder in EnQuiry allows you to define an SQL SELECT statement using a point-and-click interface.

2	Use EnQuiry to add controls to a new or existing form. You can display data returned by the current query definition as a grid or a traditional form using text boxes. EnQuiry adds a standard data control or RDC (32-bit only) that lets you navigate the record set returned by the current query definition.

3	Use EnQuiry to save the current query and form definition to a Visual Basic form (.FRM) file. This form file can be used like any other form file.

4	Use File->Add Query To... in EnQuiry to add the query to a new or existing form in a Visual Basic project.


Starting EnQuiry

From Visual Basic 4.0:

Select EnQuiry from the Add-Ins menu.


Stopping EnQuiry

From the EnQuiry File Menu:

Click File->Close.

 NOTE: File->Close does not prompt you to save the query. Because you cannot save it, you can only add the controls to Visual Basic 4. If you close EnQuiry, the session closes but EnQuiry is still running.

From Visual Basic 4.0:

EnQuiry terminates its session when you quit Visual Basic.


Modifying Fields

Adding fields

Removing fields

Reordering fields


Selecting a Form Format

On the EnQuiry toolbar click [image] to display the form in grid format or [image] to display the form in freeform format.


Query Adviser
Query Advisor

Use this to view the Query Advisor. You can close it by clicking Hide in the Query Advisor dialog box.


Error Messages

Illegal Property Change

Self Joins Not Allowed


Illegal Property Change

Property is beyond currently selected parameters. Redefine the property parameters.


Self Joins Not Allowed
Self-Joins Not Allowed

A table cannot be joined to itself.


Changing Preferences
EnQuiry Preferences

Access Preferences from the Edit menu or by clicking the [image] Preferences icon on the toolbar. You can change the following preferences:

User-configurable preferences:

Balloon Help

Query Advisor

Edit Active Colors

Connection Type

Microsoft Access 2.x or higher

ODBC using Standard VB Data Control

ODBC using VB Enterprise 32-bit RDC


EnQuiry Properties

User-configurable information:

Database

Form

Controls


Controls

If Controls Do Not Fit on Form, Then...

Control Base Name


Form
See also Form Geometry.

Options

Scroll Preview to Keep Last Control in View


EnQuiry Query Advisor

The Query Advisor is a dialog box that contains certain advisories with the current query.

In the Preferences dialog box, mark the checkbox to show the Query Advisor only when required; otherwise, the Query Advisor appears at all times. (You can also enable this preference from the Show On Demand Only checkbox in the Query Advisor.)

The stoplight icon represents the query conditions:

	Green	Query is OK.
	Yellow	Warning: Query is OK, but it might need to be optimized or refreshed.
	Red	Fatal error: The query has a major problem and cannot return data.

Details


Current Record Number in Status Bar

In Freeform view, displays the current record number of the resultset in the status bar.


Balloon Help

This tooltips-like feature describes each icon. To turn this feature on (default), mark the "Show Balloon Help" checkbox; clear the checkbox to turn it off.

To show the balloon help for the fields select lists, mark the "Show Balloon Help for Right Mouse Actions" checkbox; clear the checkbox to turn this feature off.


Edit Active Colors

Allows you to change active foreground/background colors used in the Conditions, Joins, Sort, and Group dialog boxes.


Details
Details...

The Details... button on the Query Advisor dialog box displays any dynamic information about the advisory. To view the details for an advisory, highlight the line with the message for which you want information, then click Details....

 NOTE: Not all advisories have details.

 NOTE: If you are using an ODBC connection and receive the "ODBC call failed" dialog box, your query might not be syntactically correct. Check your SQL for possible syntax errors.


Controls Dont Fit on Form
If Controls Do Not Fit On The Form, Then...

The following options are based on the EnQuiry defaults; when you select the target form, EnQuiry asks whether you want to override the target form with the EnQuiry form properties. Select one of the following:

•	Lay Out Anyway: EnQuiry adds controls to the form without changing the form size. The result can be that some of the controls are not visible. Select this if you want to work on the layout later.

•	Enlarge My Form Automatically: EnQuiry adjusts the form to fit the controls.

•	Ask Me: EnQuiry reports that the controls for a selected field do not fit current layout properties, then asks whether you want to adjust the form size or other properties. If you click Yes, EnQuiry displays the Properties dialog box. (This is the default.)


Control Base Name

Specify the name that EnQuiry prefixes to your controls in the generated form.

 NOTE: Valid control base names can contain a through z, A through Z, 0 through 9, underscore (_), and backspace. An empty (blank) control name is also allowed. When applying changes, verify that the control name does not exceed 20 characters, because EnQuiry prepends "txt" (for a text control) or "lbl" (for a label control) and appends a sequential number (1 through 256) to identify the control uniquely.

Also verify that the first character is alphabetic (not numeric).


Read-Only DB Access

When EnQuiry places controls on the form, it sets the Read-Only property of the data control to True, if this box is checked. The default is unchecked.


Scroll Preview to Keep Last Control in View

Mark this checkbox to maintain the last control in view as EnQuiry puts the control in the Query Preview pane.


Form Geometry

You can set default EnQuiry form dimensions (position and size) in pixels. When EnQuiry adds the query to a form, the pixels are converted to twips.

Position and Size

1	In the EnQuiry Properties box, click the Form tab.

2	Enter the exact pixel locations in the Top, Left, Width, and Height boxes.

Or:

1	Under the Geometry heading, click Visual Edit under Position and Size.

2	To adjust the form, press the left mouse button in the Set Form Dimensions dialog box and drag the form to size.

3	Click OK.

 NOTE: When you add a query to a new or existing form in Visual Basic, you can choose to override the target form properties with the EnQuiry form properties.


Aliases

EnQuiry creates aliases when required, for example, when aggregate functions are in the resultset.


Schema Information

Displays the following database-dependent field attributes:

Field Attribute	Description
Name	Contains the table name.
Type	Contains the data type of the table.
Size	Indicates the maximum size of a field, measured in bytes.
AllowZeroLength?	Indicates whether a zero-length string ("") is a valid entry.
Fixed-Length?	Indicates whether the field data type is a fixed-length type (i.e., not text, memo, or binary).
AutoIncrement?	Automatically increments a number when the table receives a new record.
Updateable?	Indicates whether records can be updated (not available at design time, and read-only at run time).
Collating Order	Specifies the character-ordering sequence in text for string comparison or sorting.
Default Value	Specifies the default value of a field object.
Ordinal Position	Specifies the order in which fields are displayed.
Required?	Specifies whether a value is required in a field.
Source Field	Contains the name of the field from which the schema draws its information.
Source Table	Contains the name of the table in the field from which the schema draws its information.
Validate on Set?	Specifies whether the value of a field object is validated when the object's value property is set.
Validation Rule	Sets conditions on what can be entered in your fields.
Validation Text	Indicates text of the message displayed if the value of a field object does not satisfy the validation rule specified by the validation rule setting.

If a selected database does not contain a particular field attribute, its correspondent description is left blank.

Data Preview


Browse selected subset for review
Single-Field Data Preview

Displays the data review dialog box in which you can retrieve sample data for a specific field. You can choose the format for display:

•	All records

•	Specify number of records to retrieve

•	Specify percentage of records to retrieve


Database (Properties)

Connection Options

Read-Only

Exclusive


Microsoft Access Connection Type
Microsoft Access 2.x or higher

Check this box if your database file type is Microsoft Access 2.x or higher.


ODBC
ODBC using Standard VB Data Control

Check this box if you want to access a database through ODBC (Open Database Connectivity).

 NOTE: This version of EnQuiry supports SQL Server for ODBC.


Exclusive

When EnQuiry creates a form, it sets the Exclusive property of the data control to True, if this box is checked. The default is unchecked.


Resultset Fields

Contains the fields returned by the query.


Operator Help

Provides examples and syntax for each operator.


Join Type Help

Explains the join type selected in the join type selection list.


Dialog Box Grid

Provides a working area in which you build your query.


ODBC (Open Database Connectivity)
ODBC

Open Database Connectivity.


SQL-Supported Statements Not Supported by Microsoft Access

Full outer join type in the Joins Builder

 NOTE: This version of EnQuiry is written primarily for Microsoft Access SQL; refer to the Getting Started With EnQuiry manual for further information on other SQL versions that EnQuiry supports.


Adding to the current project
Adding Controls to the Form

1	From the EnQuiry File menu, select Add Query to....

2	When the submenu appears with the option to add the query to a new or existing form, select a form.

3	Wait while EnQuiry adds the query to Visual Basic. The Visual Basic property window opens and closes as EnQuiry adds new properties.

4.	When a message informs you that EnQuiry has successfully added your query to the form, click OK in the dialog box. The focus switches back to EnQuiry.

5.	Return to Visual Basic by clicking the [image] (Switch to Visual Basic) icon on the toolbar. Run the application as you normally would from Visual Basic.

 NOTE: When you add your query to an existing form, EnQuiry always prompts you whether to use current EnQuiry property settings or lay out anyway. EnQuiry does no form-size calculations or comparisons.

If you choose the EnQuiry settings, your current form will be reduced or enlarged, per those EnQuiry settings. If your form is reduced, some existing controls can appear off the form.

If you choose to lay out anyway, and your form is not large enough, EnQuiry controls can appear off the form.

When you add your query to a new form, EnQuiry property settings take effect.

 NOTE: Valid control base names can have the following: a through z, A through Z, 0 through 9, underscore (_), and backspace. An empty (blank) control name is also allowed. When applying changes, verify that the control name does not exceed 20 characters, because EnQuiry prepends "txt" (for a text control) or "lbl" (for a label control)  and appends a sequential number (1 through 256) to identify the control uniquely.

Also verify that the first character is alphabetic (not numeric). Refer to Properties for more information.


Query Advisor Show Only on Demand

Check this box to show the Query Advisor only when required; otherwise, the Query Advisor appears at all times.


User-configurable information
User-Configurable Properties

These tabs contain user-configurable properties for EnQuiry.


User-Configurable Preferences

This dialog contains user-configurable preferences for EnQuiry.


Tables Button

Click this button to display the Select Tables dialog box.


Fields Button

Click this button to display the Select Fields dialog box.


Conditions Button

Click this button to display the Conditions Builder.


Joins Button

Click this button to display the Joins Builder.


Sort Button

Click this button to display the Sort Builder.


Group Button

Click this button to display the Group Builder.


Conditions List

Displays the conditions specified in the Conditions Builder.


Joins List

Displays the joins selected in the Joins Builder.


Sort List

Displays the sort order specified in the Sort Builder.


Group List

Displays the grouping specified in the Group Builder.


Add Button

Click this button to add your selections to the list.


Remove Button

Click this button to remove your selections from the list.


Position and Size

Use the controls in this dialog box to configure the top, left, width, and height positions, in pixels, of the EnQuiry default form properties. When EnQuiry adds the propterties to a Visual Basic form, the pixels are converted to twips.


Margins

Use the controls in this dialog box to customize the left, right, top, and bottom margins, in pixels, of the EnQuiry default form properties. When EnQuiry adds the propterties to a Visual Basic form, the pixels are converted to twips.


Visual Edit

Use this to bring up a dialog where you can modify the position and size of the EnQuiry default form properties.


Selected Tables

Contains the tables you have selected for your query.


Selected Fields
Resultset Fields

Contains the fields you selected for your query.


Join Builder dialog box
Joins Builder Dialog Box

Use this dialog box to modify the equi-join that EnQuiry built for you, or to define your own join relationships.

 NOTE: Duplicate or reflexive joins are not allowed.


SQL Statement

This displays your SQL query exactly as it will be used by the data control EnQuiry generates. Use it to identify problems reported by the Query Advisor, or to copy the text and place it in the clipboard.


Query Adviser What's This?
Query Advisor

The Query Advisor is a dialog box that notifies you of certain conditions with the current query. It also provides hints as to what action to take.

The stoplight icon represents the query advisories:

	Green	Query is OK.
	Yellow	Warning: Query is OK, but it might need to be optimized or refreshed.
	Red	Fatal error: The query has a serious problem and cannot return data.

The Details... button on the Query Advisor dialog box displays any dynamic information about the advisory. To view the details for an advisory, highlight the line with the message for which you want information, then click Details....

 NOTE: Not all advisories have details.


Group dialog box
Group Builder Dialog Box

Use this dialog box to build groups for your query.


Sort dialog box
Sort Builder Dialog Box

Use this dialog box to build or sort order for your query.


Condition Builder Dialog Box
Conditions Builder Dialog Box

Lets you specify the criteria for filtering data returned by the query.


Control Layout

EnQuiry, based on its default form properties, cannot place the displayed control on your form. Click on the Controls tab of the Properties icon to adjust the EnQuiry default form properties.


Skip Field
Skip This Field

EnQuiry will not add the field shown to your query.


Adjust Properties

Access the Properties dialog to adjust the form or modify the layout options.


Skip All Fields
Skip Oversized Fields

EnQuiry will not add this field to your query and all subsequent fields that do not fit.


Fields (Group By)

Contains fields you have selected to group by.


Select Fields Dialog Box

Use this dialog box to select fields to query from the list displayed. To access, click the Fields button in the Fields pane or click Edit -> Fields.


Query Builder Pane

Use this to select tables and fields to query and build various clauses associated with the SQL Select statement.


Resultset

A "virtual table" containing the results of a query.


Advisories

The following advisories contain specific information about the conditions that the Query Advisor reports:

An error occurred in the database manager.

Maximum number of controls reached.

No database selected.

No fields in the resultset.

No records were returned by the query.

No table selected.

Problem with aggregate.

The query results need to be refreshed.

There are unjoined tables.


No databases selected.
No database selected.

Select File->Open Database from the main menu. Also, verify that you have selected the correct connection type (.MDB or ODBC) for your database from the Preferences dialog box.


No table selected.
No table(s) selected.
See also Selecting Tables.

Tables must be added to the query. Click the Tables button or select Tables from the Edit menu for this query.


No fields in the resultset.
No fields are in the resultset.

Fields must be added to the query for the correct resultset. Click the Fields button or select Fields from the Edit menu for this query.


Problem with aggregate.

If you define an aggregate function, all other fields in the resultset that are not part of the aggregate field definition must be used in grouping expression for the query.

You can specify one or more group fields and group rows in the resultset that share a common value in a specified field. Group fields are primarily used to to support aggregate functions in the resultset. An aggregate function returns a value for each group of rows that share a common value for a specified group field.

Click the Details... button and refer to the Getting Started With EnQuiry manual for further information.


The query results need to be refreshed.

Query results have been modified or have never been retrieved. Click [image] (Query Preview) on the EnQuiry toolbar to refresh the results.


There are unjoined tables.

Unjoined Tables

Unjoined tables can cause your resultset to be extremely large, thereby slowing query retrieval.

Either remove the unjoined tables from the query or using the Joins Builder, join the tables with other tables in the query:

For example, if you have selected the tables Authors, Publishers, and Titles, EnQuiry guesses the join:

Publishers.PubID = Titles.PubID

The Authors table is not part of the set: it is unjoined. Assuming a self-publishing author has the same Au_ID as PubID, you could enter the Joins Builder and add the following join to include the Authors table in the set:

Authors.Au_ID = Publishers.PubID

Unjoined Sets

You can also have sets of tables where the sets are not joined. Using the Joins Builder, you can join the first set to the second.

For example, suppose that you have selected Authors, Title.Author, Publishers, and Titles for your query, and the following joins exist:

Authors.Au_ID = Title Author.Au_ID

Publisher.Pub_ID = Titles.Pub_ID

You now have two sets of joined tables:

1	Authors and Title Authors

2	Publishers and Titles

To join these two sets, use the Joins Builder to create Title Author.ISBN = Titles.ISBN. You now have a single set of tables containing Authors, Title Author, Publishers, and Titles.

 NOTE: All tables are included as part of a join, but the sets themselves are not joined.


An error occurred in the database manager.

Verfiy conditions for the proper query syntax. Click Details for information.

 NOTE: Information in the Details... dialog depends on the data source to which the query is connected.


No records were returned by the query.

If this is not your expected result, review your conditions and joins. Following are possible conditions:

•	No records were in the table. (The table is empty.)

•	Nothing matched the specific conditions.

•	There is a join problem.

•	You have a join set with an impossible set of joins that return nothing.


Maximum number of controls reached.

You have reached the maximum number of controls. Visual Basic has a limit of 255 controls, and because EnQuiry places two controls (label and text box) on a form for each field selected, EnQuiry has a limit of 127 fields. You cannot select any more fields.


Details...
Details... Problem with aggregate
See also Grouping Records.

Either remove the aggregate or specify one or more group fields and group rows in the resultset that share a common value in a specified field. If you define an aggregate function, all other fields in the resultset that are not part of the aggregate field definition must be used in the grouping expression for the query.


Details... An error occurred in the database manager

The amount of error information reported depends on the type of database to which you are connected. Examine your SQL statement to determine the error.


Schema Information dialog box

Presents schema information for the selected field. Click Help for field attribute details.


Single-Field Data Preview

Click Retrieve Data to preview data for the selected field.


Set Form Dimensions
Set Dimensions

Use the cursor to visually position your coordinates.


Trademarks
Copyright© 1995 Progress Software Corporation

The information in this help file is subject to change without notice and Progress Software Corporation assumes no responsibility for any errors that may appear in this file.

Crescent, EnQuiry, Query Advisor, Query Builder, Query Map, and Query Preview are trademarks of Progress Software Corporation.

Microsoft, Windows, SQL Server, and Visual Basic are registered trademarks of Microsoft Corporation.

All company and product names are the trademarks or registered trademarks of their respective companies.


By Telephone

Contact Crescent’s North American technical support at (617) 280-3000, Monday through Friday, from 9:00 a.m. to 5:00 p.m., EST.


By FAX

Contact the Crescent Division at (617) 280-4025.


Via BBS
By BBS

Contact the Crescent Division through our 24-hour bulletin board service at (617) 280-4221.


Via CompuServe
By CompuServe

Contact the Crescent Division through our CompuServe address: 70662,2605.

Crescent also maintains a section in the Microsoft Windows Components A+ Forum on CompuServe. To reach the Crescent section, type the following at the CompuServe prompt: GO CRESCENT.


By Internet

Contact the Crescent Division using the Internet address crescent-support@progress.com.


By Mail

Address your correspondence to:

Technical Support

Crescent Division

Progress Software Corporation

14 Oak Park,

Bedford, Massachusetts 01730


Redundant join

A redundant join occurs when both tables containing the fields referred to in the join are already in a single set of joined tables.

For example, if you have selected the tables Titles, Title Author, and Authors, EnQuiry will guess the following joins:

Titles.ISBN = Title Author.ISBN

Authors.Au_ID = Title Author.Au_ID

You now have a single set of table containing Titles,Title Author, and Authors. If you try to add a join like:

Authors.Year Born > Titles.Year Published

EnQuiry detects this as a redundant join and removes it, because both tables are already in the set containing all three tables.


Select Tables dialog box

Use this dialog box to select tables to query from the list displayed. To access, click the Tables button in the Tables pane or click Edit -> Tables from the main menu.


Duplicate join

A duplicate join occurs when the join condition is repeated in the Joins Builder.


Reflexive join

A reflexive join is a mirror copy (A-B, B-A) of an existing join condition, whereas a duplicate join is an exact copy (A-B, A-B) of an existing join condition.


RDC

Remote Data Control.


Add-In

A custom item, added to the Visual Basic menu, used to manipulate forms and controls and to respond to file-control events.


ODBC using VB Enterprise 32-bit RDC

Check this box if you are using the Enterprise version of Visual Basic for high-speed data access and more properties, methods, and events than the standard Visual Basic data control provides.


Add-Ins

From Visual Basic, select Add-Ins->EnQuiry to start EnQuiry or to return to an EnQuiry session.


EnQuiry Tasks
EnQuiry Help Contents
Technical Support	Copyright

 How to Use EnQuiry

Using EnQuiry

1	Building queries

2	Selecting form formats

3	Previewing, testing, and running queries

4	Modifying queries

5	Generating and saving forms

6	Loading EnQuiry forms into Visual Basic projects

 The EnQuiry Interface

EnQuiry Toolbar

Query Builder

Query Map

Query Preview

 Reference Information

EnQuiry Preferences

EnQuiry Properties

EnQuiry Query Advisor

Error Messages

SQL Select Statement Syntax

Glossary


Build a query
Building Queries
See also Query Builder.

1	Connecting to a database

2	Selecting tables

3	Selecting fields to include in the query resultset

4	Specifying conditions (Building a Where Clause)

5	Building a join (Optional)

6	Sorting records (Building an Order By Clause)

7	Grouping records (Building a Group By Phrase)

8	Adding controls to your Visual Basic form


Save a query
Adding controls to your Visual Basic form
See also Adding to the current project.

1	Check the Query Advisor in EnQuiry to verify that you have a green light to generate a query based on the current definition.

2	Choose the format of the form, either [image] Grid or [image] Freeform, by clicking the appropriate icon on the EnQuiry toolbar.

3	Set the naming options for the controls.

4	Set the position and size for the generated form.

5	From the EnQuiry File menu, select Add Query to....

6	A submenu prompts you whether to add the query to a new form or an existing one. Select a form.

7	EnQuiry adds the query to Visual Basic. Wait until it finishes.

8	A message informs you that the query was successfully added to the form. Click OK in the dialog box. The focus switches back to EnQuiry.

9	Return to Visual Basic by clicking the Visual Basic icon [image] on the EnQuiry toolbar.


Modify a query
Modifying Queries
See also Query Builder.

Modifying fields

Modifying Group By specifications

Modifying Joins

Modifying the Sort Order

Modifying Where Clauses


Run a Query
Previewing, Testing, and Running Queries
See also Query Preview Pane.

Previewing

To preview the query data, click [image] Preview Query Results on the Toolbar. Use the data controls to browse through the resultset.

To preview the SQL EnQuiry created, click on the [image] SQL Text icon on the Toolbar.

Testing

Consult the Query Advisor to verify that your query is valid.

Running

1	From the Query Preview, click [image] (Query Preview Results).

2	Click [image] (Next).

3	Click [image] (Prev).

4	Click [image] (Switch to Grid). (This is optional.)

5	Cllick [image] (View SQL) to view the SQL that EnQuiry generates. (This is optional.)


View SQL
Viewing SQL

To see the SQL statement that you created using EnQuiry, from the Toolbar, click [image] (SQL Text).


Connect to a database
Connecting to a Database
See also Select Database.

 NOTE: If you want to connect to an ODBC database, before using EnQuiry with a project, verify that you can access data from an ODBC database within Visual Basic 4.

1	Click File->Open Database from the main menu in the EnQuiry editor. EnQuiry displays the Select Database dialog box. The dialog box that appears depends on the database type selected in EnQuiry Preferences. The default is Microsoft Access 2.x and higher, which displays the  Select Database dialog box.

 NOTE: You can connect to only one database at a time.

2	If you want to connect to an ODBC file, EnQuiry displays its SQL Data Sources menu. Click the correct format for your query.

 NOTE: Verify that you have specified the correct connection type. If EnQuiry responds with a message box explaining that you cannot use ODBC to attach an external Microsoft or ISAM database table to your database, your connection type is set to ODBC. To correct this, click the [image] Preferences Preferences icon, then on the Database tab, check the Microsoft Access 2.x or higher box. Click Apply.

3	Click the drive and directory that contain the database to which you want to connect.

4	Select the database name.

5	Click OK. The Query Builder caption now displays the name of the selected database.


Specify tables to query
Selecting Tables
See also Select Tables.

1	Click the Query Builder [image] button or click Edit->Tables in the EnQuiry menu.

 NOTE: If you have not selected a database to query, a dialog box asks whether you want to select one now. Click Yes to display the Select Database dialog box. Select a database, then continue.

2	Click the table name from the Available Tables dialog box that EnQuiry displays.

3	Click the [image] (Add button) to place the selections into the Selected Tables list.

 NOTE: To remove selections from the Selected Tables list, highlight the tables, then click the [image] (Remove button) to place them back into the Available Tables list.

4	Once you’ve selected all of the tables that you want to query, click OK.

 TIP: EnQuiry supports the standard Microsoft Windows multiselect behavior and drag-and-drop capabilities. To select two or more items in sequence click the first table you want to select, press and hold down SHIFT while you click the table in the list.To select one or more items out of sequence, press and hold down CTRL while you click each table name.


Specify fields
Specifying Fields
See also Select fields.

In the Query Builder:

1	Click the Query Builder [image] button or click Edit->Fields in the EnQuiry menu.

2	Choose the table(s) you want by clicking the table name in the Tables Selection box.

3	Choose the fields that you want by clicking the field name in the Available Fields box.

4	Click the [image] (Add button).

 NOTE: To remove selections from the Selected Fields list, highlight the fields, then click the [image] (Remove button).

 TIP: If your tables have many fields, you can click a single table in the tables selection box so that EnQuiry displays only the fields in that table for selection. EnQuiry also supports the standard Microsoft Windows multiselect behavior and drag-and-drop capabilities.
(See Selecting Tables.)

5	Once you’ve chosen all of the fields that you want, click OK.


Specify conditions
Specifying Conditions (Building a Where Clause)
See also Conditions Builder.

In the Query Builder:

1	Check the Distinct box if you want to retrieve only unique sets or values in specified fields. The default is All.

2	Click the [image] button or click Edit->Conditions in the EnQuiry menu.

3	Position the cursor in the Left Expression field.

4	From the Tables Selection box, click the table that contains the field on which you want to build the condition.

5	Select a field or enter an expression in the Field box. (This is known as the left expression.)

6	Click the Operators list box and select a comparison operator.

7	Select a field or enter an expression in the Field(s) or Value(s) box. (This is known as the right expression.)

8	Click OK. The Query Builder displays the specified conditions.

To build a compound expression:

1	Complete the first condition as specified above.

2	Click the Connectives list box and select a connective.

3	Build another condition as explained above. Repeat steps 2 and 3 for each additional condition.

4	Click OK.

 NOTE: You can also use the ALT-F keyboard command to select fields.


Build joins
Building Joins

Access the Joins Builder dialog box:

From the Query Map, click the Join Operator button or click Edit->Joins in the EnQuiry menu.

Or:

From the Query Builder, click the [image] button.

Build a join:

1	Position the cursor in the left field.

2	In the Tables Selection box, click the name of the table to which you want to join another table.

3	From the Fields Selection box, click the name of the field on which you want to build the join condition.

4	Click the Operators list box and select an operator.

5	In the Tables Selection box, click the name of the table to which you want to join the already selected table.

6	Click the name of the field in the second table that you want to join to the first table.

7	Click the Join Type list box and select a join type. This creates a new line at the bottom of the work area. If you do not select a join type, it defaults to inner.

8	Repeat steps 1 through 6 to add more join specifications.

9	Click OK. The Query Builder displays the specified joins.

 NOTE: Duplicate, redundant, and reflexive joins are not allowed. Tables can be joined on fields of different types. A warning dialog message informs you that this could cause an SQL error when you try to retrieve data. Check the Query Advisor for details and actions to take.


Specify sort order
Specifying Sort Order
See also Sort Builder.

In the Query Builder:

1	Click the [image] button or click Edit->Sort from the main menu.

2	From the Tables Selection box, click the table name that contains the field on which you want to order records.

3	Click the field name in the Fields Selection box. This creates a new line at the bottom of your work area.

4	By default, the sort is ASC. Click DESC to change the sort order.

5	Repeat steps 1 through 4 to add more fields on which to sort records.

6	Click OK. The Query Builder displays the sort order of your query.


Group records
Grouping Records
See also Group By Builder.

To build a Group By phrase in the Query Builder:

1	Click the [image] button or click Edit->Group from the main menu.

2	From the Tables Selection box, click the name of the table that contains the field by which you want to group records.

3	From the Fields Selection box, click the name of the field name. This creates a new line at the bottom of your work area.

4	Repeat steps 1 through 3 to add more fields on which to group records.

5	Click OK. The Query Builder displays the selected grouping.


Remove a Table
Removing Tables
See also Select Tables.

 NOTE: When you remove a table, EnQuiry removes any clauses that reference the table.

In the Query Builder:

1	Highlight the lines containing the table(s) you want to remove.

2	Click Delete.


Remove a field
Removing Fields
See also Specifiying Fields.

 NOTE: When you remove a field, EnQuiry removes any clauses that reference the field.

In the Query Builder:

1	Highlight the lines containing the fields you want to remove.

2	Click Delete.


Modify the Where Clause
Modifying Where Clauses
See also Conditions Builder.

Adding conditions

Modifying conditions

Removing conditions


Modify the Join Clause
Modifying Joins
See also Joins Builder.

Adding relationships

Changing relationships

Removing relationships


Modify the Sort Order
Modifying the Sort Order
See also Sort Builder.

Removing sort specifications

Adding sort specifications

Changing sort specifications

Reordering sort specifications


Modify the Group By Clause
Modifying the Group By Clause
See also Group By Builder.

Removing Group By specifications

Adding Group By specifications

Modifying Group By specifications


Remove a condition
Removing Conditions

1	From the Query Builder pane, click and highlight the condition(s) you want to delete.

2	Click Delete.

Or:

1	Click the Query Builder [image] button.

2	Position the cursor to the line that contains the condition that you want to remove.

3	Click Delete Line.

 NOTE: Removing the last condition line also removes the connective on the new last line.


Insert a condition
Adding Conditions

In the middle of an existing Where Clause:

1	Click the Query Builder [image] button.

2	Position the cursor to the line before which you want to add the new condition.

3	Click Insert Line.

4	Add the condition as described in Specify conditions.

At the end of an existing Where Clause:

1	Position the cursor on the last condition and click the Connectives button.

2	Select a connective.

3	Add the condition as described in Specify conditions.


Modify a condition
Modifying Conditions

To change a field, highlight the complete field, then click the new field from the Field Selection box.

To change the value of an expression, delete the existing field or literal value and re-enter the new information. If the field that you want to change is a connective or operator, select the new value from the respective selection list.


Remove a relationship
Removing Relationships

1	In the Query Builder pane, click and highlght the joins you want to delete.

2	Click Delete.

Or:

1	Click the Query Builder Joins button.

2	Position the cursor on the line that you want to delete (in the Joins Builder dialog box).

3	Click Delete Line.

4	Click OK.

 TIP: To remove the entire Join Clause, click Clear All.


Add a relationship
Adding Relationships

1	Click the Query Builder [image] button or select Edit->Joins from the main menu.

2	Click Insert Line. EnQuiry inserts a new line in which you can build the table relationship.

3	Refer to Building Joins to add the new relationship.

4	Click OK.


Change a relationship
Changing Relationships
See also Building Joins.

1	Click the Query Builder [image] button or select Edit->Joins from the main menu.

2	Position the cursor in the left or right field on the line where you want to change the relationship (in the Joins Builder dialog box).

3	Select the new field from the Fields list.

4	Click OK.


Remove a sort specification
Removing Sort Specifications

1	From the Query Builder pane, click and highlight the sort specification(s) that you want to delete.

2	Click Delete.

Or:

1	Click the Query Builder [image] button or select Edit->Sort from the main menu to access the Sort Builder dialog box.

2	Position the cursor on the specification that you want to delete.

3	Click Delete Line.

4	Click OK.

 TIP: To remove the entire Order By clause, click Clear All.


Add a sort specification
Adding New Sort Specifications

1	Click the Query Builder [image] button to access the Sort Builder dialog box.

2	Position the cursor to the line before which you want to add the new sort specification.

3	Click Insert Line.

4	Click the field that you want to add to the sort specification.

5	Click OK.


Change a sort specification
Changing Sort Specifications

1	Click the Query Builder [image] button or Edit->Sort from the main menu to access the Sort Builder dialog box.

2	Position the cursor to the line that you want to change, then select the new field from the field list.

3	Click the ASC or DESC button to modify the sort order.

4	Click OK.


Remove a Group By specification
Removing Group By Specifications
See also Group Builder.

1	From the Query Builder pane, click and highlight the Group By specification(s) that you want to remove.

2	Click Delete.

Or:

1	Click the Query Builder [image] button.

2	Position the cursor on the line that you want to delete, and click Delete Line.

 TIP: To remove all Group By specifications, click Clear All.


Add a Group By specification
Adding New Group By Specifications

1	Click the Query Builder [image] button or Edit->Group from the main menu.

2	Position the cursor to the line before which you want to add the new Group By specification.

3	Click Insert Line.

4	Click the field that you want to group records by.

5	Click OK.


Reordering Fields

1	From the Query Builder, click the field whose order you want to change.

2	With the cursor on the field name, click and drag the left mouse button, using a horizontal motion. EnQuiry displays the “Drag to Order” cursor.

3	Drag the field to the desired location in the Fields pane (the cursor changes to a curved arrow) and release the mouse button.

4	Click OK. EnQuiry reorders the fields.


Selecting Fields

1	Click the Query Builder [image] button or click Edit->Fields in the EnQuiry menu.

2	Double-click the field name  or single click the then click [image] in the Select Fields dialog box to add fields to the resultset.

3	Once you’ve selected all of the fields that you want to query, click OK.

 TIP: EnQuiry supports the standard Microsoft Windows multiselect behavior: To select two or more items in sequence click the first table you want to select, press and hold down SHIFT while you click the table in the list. To select two or more items out of sequence, press and hold down CTRL while you click each table name.


Reordering the Group By clause
Reordering Group By Clauses

1	From the Query Builder, click the field whose order you want to change.

2	With the cursor on the field name, click and drag the left mouse button, using a horizontal motion. EnQuiry displays the “Drag to Order” cursor.

3	Drag the field to the desired location in the Fields pane (the cursor changes to a curved arrow) and release the mouse button. EnQuiry prompts you to verify that you want to reorder the sort order.

4	Click OK. EnQuiry reorders the fields.


Generating and Saving Forms
See also Propertiesand Adding a Query to a Form.

After you select a database, EnQuiry populates a new or existing form with the properties including the following:

•	Connect

•	DatabaseName

•	RecordSource

EnQuiry also creates and hides DBGrid (to support the grid presentation style if you choose it). It then sets the DataSource property of the DBGrid grid to the data control.

Freeform Considerations

After you select the fields from within the Query Builder or Query Map, EnQuiry does the following to the Visual Basic form for the Freeform presentation style:

•	Creates and calculates the position for a text box control and a label control for selected fields

•	Updates the DataSource and DataField properties for the text box control

Grid Considerations

After you select the fields from within the Query Builder or Query Map, EnQuiry does the following to the Visual Basic form for the Grid presentation style:

•	Displays fields from multiple records returned by the query in a row-and-column format

•	Provides a data control that implements the database connection and data-access functionality for the form.

 NOTE: You add a query to a form, even if the SQL is not yet valid. (This helps protect your work.) However, you can use this form (Retrieve Data or Add Query to...) only when the SQL is a valid query.


Loading Forms into Visual Basic Projects
Loading EnQuiry Queries into Visual Basic Forms
See also Adding to the current project.

1	Verify that you have saved your current form in Visual Basic. Switch to Visual Basic by clicking the [image] (Switch to Visual Basic) icon.

2	In EnQuiry, choose Add Query from the File menu.

3	EnQuiry displays the Add Query menu. You can add the query to the current Visual Basic form or to a new form.

 NOTE: When you add your query to an existing form, EnQuiry always prompts you whether to use current EnQuiry property settings or lay out anyway. EnQuiry does no form-size calculations or comparisons.

If you choose the EnQuiry settings, your current form will be reduced or enlarged, per those EnQuiry settings. If your form is reduced, some existing controls can appear off the form.If your choose to lay out anyway, and your form is not large enough, EnQuiry controls can appear off the form.

When you add your query to a new form, EnQuiry property settings take effect.

Once the query is added, you can access and use the form as you would any Visual Basic form.