hello!!!
I am a new comer in ASP and want to connect my DataBase in Access with ASP.Please help me how to do it??
Printable View
hello!!!
I am a new comer in ASP and want to connect my DataBase in Access with ASP.Please help me how to do it??
Hi,
First you need to set up a connection:
Once you hace the connection open you can then retrieve recordsets, send SQL statements etc..Code:'Open connection to Access database using
'DSN-less connection
Dim CN
Set CN = Server.CreateObject("ADODB.Connection")
CN.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=C:\My Documents\YourDatabase.mdb"
CB.Open
Example recordset:
Don't forget to clear your object's when you have finished with them:Code:dim RST
Set RST = Server.CreateObject("ADODB.Recordset")
RST.Open "MyFriends",CN,,,adCmdTable
Do While Not RST.EOF
Response.Write "<B>" & RST("Name") & "</B>"
Loop
Hope this helps you get startedCode:RST.Close
Set RST=Nothing
CN.Close
Set CN = Nothing
Shaun