DB Connection Error

Results 1 to 2 of 2

Thread: DB Connection Error

  1. #1
    Join Date
    Dec 1969

    Default DB Connection Error

    I am trying to add the data from online form to backend Access Database. My code here is:<BR><BR>&#039;Create an ADO connection object<BR>Set strconn = Server.CreateObject("ADODB.connection")<BR>&#039;S et an active connection to the Connection object <BR>strconn = "Provider = microsoft.jet.oledb.4.0; Data Source = " & Server.MapPath("_private
    eport.mdb")<BR><BR>I get the error message:<BR>error &#039;80004005&#039; <BR>Unspecified error <BR>/dbresult.asp, line 39 <BR><BR>if I write in the other way like:<BR>strconn.Open "DRIVER = {Microsoft Access Driver (*.mdb)}; DBQ =" &Server.MapPath("_private
    eport.mdb")<BR>I get the error message:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR>/dbresult.asp, line 24 <BR><BR>Can anybody help me with this? Thank you so much for the attention!<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DB Connection Error

    Notice below, I first create the dbase connection (first line), then open the dbase connection (second line). This is assuming you have used the appropriate namespaces in the top of the aspx page. My database name is "alum.mdb"<BR><BR>Dim conn As OleDbConnection <BR>conn = New OleDbConnection ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" & server.MapPath("/alum.mdb"))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts