Active Server
Pages Quick Reference Sheet |
||
Include Files | #include
file="adovbs.inc" #include file="subConn.inc" or #include virtual="/includes/adovbs.inc" #include virtual="/includes/subConn.inc" |
|
Opening the Connection Closing the Connection (uses the include file) |
openCN closeCN |
|
SELECT Queries | sql="SELECT fieldname FROM
tablename " sql=sql&"WHERE fieldname=value " sql=sql&"ORDER BY fieldname" |
|
Opening a Recordset Closing a Recordset |
rs.Open sql,cn,[AdOpenKeyset] rs.Close |
|
Getting data from the Recordset | <%=rs("fieldname") or <% response.write rs("fieldname") %> |
|
UPDATE Queries | sql="UPDATE tablename SET " sql=sql&"fieldname1=value, fieldname2=value " sql=sql&"WHERE fieldname=value" |
|
INSERT Queries | sql="INSERT INTO tablename " sql=sql&"(fieldname1, fieldname2, fieldname3 . .) " sql=sql&"VALUES (value1, value2, value3)" |
|
DELETE Queries | sql="DELETE * FROM tablename
WHERE fieldname=value" |
|
Executing a Query (for updates, inserts, and deletes) |
cn.execute sql | |
Datatypes in SQL | strings | "'" & strVariable & "'" |
numbers | intVariable | |
dates | "#" & dateVariable & "#" |