Autodesk 15606-011408-9300 Developer Guide - Page 113
Controlling the Output, Recordset, Execute, Connection, SQLQuery, <BODY>, RSAPN, Owner_Name
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 113 highlights
The third line creates a variable that holds a SQL statement specifying the database records for houses built in 1963: SQLQuery = "SELECT * FROM Parcel_Data Where Year_Built = '1963'" The last line puts it all together, creating a Recordset object and assigning it to an object variable named RS. Note that Execute is a method of the Connection object, in this case dbConnection. We're using Execute to run the SQL statement we assigned to SQLQuery: Set RS = dbConnection.Execute(SQLQuery) Controlling the Output Now that we have our Recordset object, let's add a block of code that controls how the database output is displayed on the page. This code should appear within , at the location where you want the database output to appear. If you want to display the parcel number, owner's name, and year built, your output code will look like this: Parcel Number: Owner: Year Built: If you're accustomed to client-side scripting, this code might look peculiar. Notice how it is actually two different script tags that operate on HTML code sandwiched in the middle. Let's look at the HTML portion first: Parcel Number: Owner: Year Built: As with ColdFusion, this is standard HTML plus a few variables. ASP variables use the standard ASP script tags (), as well as an equal sign that tells ASP to substitute the actual value for the variable. In this case, the value is a field in your map resource database. For example, RS("APN") is the APN column in the database represented by the RS object you created earlier. Without the accompanying script tags, the HTML would display the APN, Owner_Name, and Year_Built fields for only the first record in the database: Parcel Number: 941-0103-003-01 Owner: James P & Bonnie G Reed Year Built: 1963 Creating Report Scripts with ASP | 113