Using the SQL Genie
The SQL Genie helps you write SQL expressions. To start the SQL Genie :
Create a SQL::Connection object and open a connection to AlphaSports.mdb.
Pass the SQL::Connection object to the SQL_Query_Builder() function.
|
dim qry as C dim conn as SQL::Connection conn.open("{A5API=Access,FileName='C:\Program Files\a5v8\MDBFiles\Alphasports.mdb',UserName='Admin'}") qry = sql_query_builder(conn) |
This opens the SQL Genie and displays its Tables tab.
Click Add Table to display the Add Table dialog.
Select "Customer" and click OK. When you return to the SQL Genie, you will see the start of your SQL expression in the SQL window. [Picture]

Display the Columns tab.
Select the "FIRSTNAME",
"LASTNAME", "PHONE", and "FAX" entries in
the Available Columns list and click
to move them into the Selected Columns
list. Note how the SELECT statement in the SQL
window updates to reflect your latest choices. [Picture]

Display the Filter tab.
Click
to display the Select Column or Expression
dialog.
Select "PHONE" in the Columns list and click OK. Note how the SELECT statement in the SQL window updates to reflect your latest choices. [Picture]

Click
to display the Operator list.
Select "is not null". [Picture]

Display the Order tab.
Select "LASTNAME"
in the Available Columns list and click
.
Select "FIRSTNAME"
in the Available Columns list and click
. Note how the SQL window displays
the latest version of the SQL SELECT statement.
Click OK to return to the Interactive window. [Picture]

Execute the query and list the data you get back. The data contains 4 fields, filtered, and ordered as you specified.
|
conn.execute(qry) dim data as C data = conn.resultset.ToString() ? data = Winston Abrams (402) 555-6112 Randi Adams (808) 555-6721 (808) 555-7500 John Baker (914) 555-8400 Tom Barber (914) 555-8700 Jeffrey Bernstein (914) 555-0987 George Boschetti (803) 555-6143 ... |
Close the connection.
|
conn.close() |
Supported By
Alpha Five Version 8 Enterprise Edition
Limitations
Desktop applications only.
See Also