Connect the asp to ms.access database?

angel

New member
I'm using windows vista and I'm trying to open the database through the ss.asp, but every time there come out this error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/The Code/ss.asp, line 3


Here is my code:
<% Set DataConn = Server.CreateObject

("ADODB.Connection")
DataConn.Open "Driver=Microsoft Access Driver

(*.mdb)};DBQ=" & Server.MapPath("/mia.accdb")

Set cmdTemp = Server.CreateObject

("ADODB.Command")
Set rstContacts = Server.CreateObject

("ADODB.Recordset")

cmdTemp.CommandText = "Select * From

Contacts"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn

rstContacts.Open cmdTemp, , 1, 3

rstContacts.Move CLng(Request("Record"))

Response.write "Name=" & Server.URLEncode

(rstContacts("Name")) & "&"
Response.write "Telephone=" &

Server.URLEncode(rstContacts("Telephone")) & "&"
Response.write "City=" & Server.URLEncode

(rstContacts("City")) & "&"
Response.write "Notes=" & Server.URLEncode

(rstContacts("Notes")) & "&"
Response.write "TotalRecords=" &

rstContacts.RecordCount

rstContacts.Close
DataConn.Close

%>

Please help me??
 
Back
Top