Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
ASP sample code which shows how to connect to a da...
Author:
Peter Riley
E-mail:
Click to e-mail author
Submitted:
2/13/2001
Version:
ASP
Compatibility:
ASP
Category:
ASP
Views:
19978
ASP sample code which shows how to connect to a database, create a recordset containing data from a table, and then display the results.
Declarations:
Dim Conn AS ADODB.Connection Dim rs AS ADODB.Recordset
Code:
<% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "mydatabase" 'DSN SQL = "SELECT * FROM tblEmployee where Age < 50 order by Name" Set rs = Conn.Execute(SQL) %> 'Display results <% do while not rs.EOF %> <% =rs("Name") %>, <% =rs("Surname") %>, <% =rs("Age") %>
<% rs.movenext loop %> <% rs.close set rs = nothing %>
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement