%@ Language=VBScript %> <% strPage="DSN's"%>
Using a System DSN
To connect using a System DSN, you'd do something like the following. Be sure to replace DSNName with your DSN name.
|
<%
Dim MyConn ' Connection Name SQL="Select fieldname1, fieldname2 From tablename [Where conditions]" ' Execute the SQL statement and get Data in Recordset %> |
If you have used the code above, when you want to display fields on your page, you'd simply do this:
| <%=RS("email")%> <%=RS("email")%> <%=RS("fieldname")%> |
That code would display whatever the field contents are.
Please be sure that you close your database connection at the end of the page:
| <% RS.Close Set Rs = Nothing MyConn.Close %> |
If you need to learn more about using databases and DSNs, there are several good reference sites out there. Two good places to start are www.msdn.microsoft.com and www.4guysfromrolla.com.