SQL query page Home

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using ASPRunner
Working with projects
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
Master-details
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart and setting parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Login page
User login settings
Advanced security settings
User group permissions
Dynamic permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Connecting to database
Connecting to MS Access database
Connecting to MS SQL Server database
Connecting to FoxPro database
Connecting to MySQL database
Connecting to Oracle database
Connecting to MS Excel database
Connecting to CSV or Text file
Events
Data Access Layer
More about events
Global events
Table events
Page life cycle overview
Predefined actions
Send simple email
Send email with new data
Save new data in another table
Insert a record into another table
Check if specific record exists
Display a message on the Web page
Redirect to another page
Custom code
Sample code
Show list of customer orders
Check if start date is ealier than end date
Before deleting a record check if related records exist
Speed up data entry using events
Publishing ASP application to the remote Web server
Using third party FTP client to publish ASP pages to the remote Web server
Using FrontPage to publish ASP pages to the remote Web server
Demo account
What is the Demo Account?
Terms and Conditions
Enterprise Edition
Online report/chart builder
Master-details relationships
Using JOIN SQL queries
AJAX-based Functionality
ASPRunner session variables
Debugging tips
Template files processing rules (Files.txt)
Multilanguage support
Useful functions and links
ASPRunner templates
Stylesheets
Template language
Rich Text Editor plugins
How to control Inline Add/Edit functionality from script
Troubleshooting "Operation must use an updateable query" errors
ODBC
Upgrade Guide from ASPRunnerPro 4.0 and older
Frequently Asked Questions
Error: Operation must use an updateable query.
Error: Syntax error in UPDATE statement.
Error: Syntax error in INSERT INTO statement
Error: Login failed for user 'MACHINE_NAME\IUSR_MACHINE_NAME'
Error: Data type mismatch in criteria expression
Error: The Microsoft Jet database engine cannot open the file (unknown).
Error: Unable to open registry key 'Temporary (volatile) Jet DSN for process ...
Error: Data provider could not be initialized
Error: Invalid use of Null: 'Replace'
Error: Specified driver could not be loaded due to system error 5 (Oracle in OraHome92)
How can I add new ODBC Datasource
Error: Too many fields defined
Error: I enter correct login and password but receive Invalid Login error. I use SQL Server.
I cannot find ODBC Administrator applet on Windows 2000 machine
I cannot connect to my Excel (Access) database
Where can I download latest ODBC drivers
How to work with Access database stored on the remote computer?
Reserved Access, T-SQL, ODBC keywords.
Order ASPRunner online

 
  ASPRunner manual


Query Designer

 

Query Designer gives you the ability to use the simple graphical interface to construct SQL statements.

Note: if you modify default SQL query, make sure that key column(s) are included into fields list. This is required to provide edit/delete/view functionality.

To switch between tables use Tables list panel on the left.

 

What is supported

  • Inner joins, outer joins, unions

To add join click on the Add Table button, select table and then drag and drop any field from first table to the joined table. To setup join type click on the line between tables, select foreign keys on the Table link properties dialog in both tables and choose join type.

More info on Using JOIN SQL queries

SQL query:
SELECT
products.ProductID,
products.ProductName,
products.SupplierID,
products.CategoryID,
products.UnitPrice,
categories.CategoryName
FROM products
INNER JOIN categories ON
products.CategoryID = categories.CategoryID

Note: it's recommended to use aliases for fields from joined tables to avoid confusion when two from different tables have the same name.

  • Calculated fields

To add calculated fields use empty grid below all field names:

SQL query:
Select ProductName,
Quantity,
UnitPrice,
UnitPrice*0.05 as Tax
from Products

  • WHERE clause

You can add where clause in the Filter column. If you need to add two or more conditions use Or... columns.

SQL query:
select * from customers where country='UK'

For more complicated queries wrap condition by brackets:
select * from customers where (customertype='A' or customertype='B')

  • ORDER BY clause

If you'd like to specify default sorting order on the list page (ascending or descending) select Sort Type in the corresponding column for necessary fields.

 

  • GROUP BY clause

To add GROUP BY clause click "Group By" button and select one of groupping function in Group By column.

SQL query:
Select ProductName,
CategoryID,
SUM(UnitPrice)
from Products
GROUP BY ProductID, ProductName, CategoryID
ORDER BY ProductName

 

What is not supported

  • Stored procedure calls (Workaround: create a view that calls stored procedure and use this view as a datasource)

  • Update/Delete/Insert/Create queries

If your query for some reason doesn't work create view/query in your database and use this query as a datasource in ASPRunner.

1. Run MS Access and create new query. Switch to SQL view.
2. Type your SQL query there.
3. Save this query as qryNewQuery.
4. Run ASPRunner and use qryNewQuery as datasource table.

 

The CHM file was converted to HTML by chm2web software.