dbSQL

Query Statement for the ASPdb database operation. 

Property Syntax

Obj.dbSQL = "SQL statement"

Parameters

Parameters

Description

SQL statement Any valid SQL statement. This statement can be as long as a regular VB string can hold in comparison to the 255 characters limit imposed by the ASP script. Note that when the statement includes database.owner.table or calculated fields then dbNameMap must be used to prepare for Filtering and editing. 

Example

<%
...
...
X.sSQL="SELECT " _
& "Job.JobID, Job.ProjectID , " _
& "Project.PProject AS Project, " _
& "Job.JTitle AS JobTitle, " _
& "COUNT(Bid.JobID) AS NumBids, " _
& "Job.JobStatus AS JobStatus, " _
& "Job.JPostDate AS PostDate, " _
& "Job.JDueDate AS DueDate, " _
& "Job.JModifyDate AS LastModified, " _
& "Project.UserID " _
& "FROM ((Project RIGHT OUTER JOIN Job ON Project.ProjectID = Job.ProjectID) " _
& "LEFT OUTER JOIN Bid ON Job.JobID = Bid.JobID) " _
& "WHERE (Job.UserID = 12345) " _
& "GROUP BY Job.JobID, Job.ProjectID, Job.JTitle, " _
& "Job.JobStatus, Job.JPostDate, Job.JDueDate, " _
& "Job.JModifyDate, Job.ProjectID, Project.PProject, Project.UserID"  
X.dbSQL=sSQL
...
...
%>


Notes