|
Basic ADO database connection
| Language: |
ASP |
Unrated
Rated by 0 Users
1 Star = Horrible 5 Stars = Perfect
Rate Code Now
|
| Posted By: |
blake |
| Author Website: |
Differences between ASP and PHP |
| Posted On: |
6/30/2007 |
| Code Views: |
2594 |
This just shows how to connect to a database file with ASP. There are many ways to do connect but this is just one simple example.
|
<% dim MC, RS set MC = Server.CreateObject("ADODB.Connection") MC.Provider="Microsoft.Jet.OLEDB.4.0" MC.Open "../path/to/db.mdb"
set RS = Server.CreateObject("ADODB.recordset") RS.Open "SELECT * FROM Users WHERE name = 'Tim';", MC ' Do something with the data RS.Close SET RS = Nothing
MC.Close SET MC = Nothing %>
View code in Textarea
This code has not been tested by Your WebCode. Use it at your own risk.
Please report any copyright violations.
|
|