khurram
Aug 30th, 2000, 07:10 AM
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??
S@NSIS
Aug 30th, 2000, 07:27 AM
Hi,
First you need to set up a connection:
'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
Once you hace the connection open you can then retrieve recordsets, send SQL statements etc..
Example recordset:
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
Don't forget to clear your object's when you have finished with them:
RST.Close
Set RST=Nothing
CN.Close
Set CN = Nothing
Hope this helps you get started
Shaun