Keyline IT Solutions PVT Limited
Please Login or Register

Knowledgebase

Connect to a msaccess database using a dsn-less connection via asp

Following demonstrates on how to make and use the Access database connection:
 
01. <% 
02. Dim objConn as ADODB.Connection
03. Dim objRS as ADODB.Recordset
04. Dim strConn as String
05. Dim strSQL as String
06. Set objConn = New ADODB.Connection
07. Set objRS = New ADODB.Recordset
08. strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DatabasePhysicalPath"
09. objConn.Open strConn
10. strSQL = "Select * from tbAddresses "
11. objRS.Open strSQL, objConn
12. %>
 
 
Exaplanation According to Line:
 
01. Open ASP tag
02. Declare a ADODB.Connection type variable
03. Declare a ADODB.Recordset type variable
04. Declare a String type variable
05. Declare a String type variable
06. Set new instance for ADODB.Connection
07. Set new instance for ADODB.Recordset
08. Set connection string into strConn
09. Open connection using strConn
10. Set query statement
11. Query from database
12. Close ASP tag


Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article


Powered by WHMCompleteSolution

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search