error mystery with dbconnect

Results 1 to 3 of 3

Thread: error mystery with dbconnect

  1. #1
    Join Date
    Dec 1969

    Default error mystery with dbconnect

    Can anyone please help with this error message. Normally it is easy to resolve, but in this case I have NO IDEA whats going on. The database is there, and the path is absolutely correct.<BR><BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified <BR><BR>/properties/query.asp, line 16 <BR>============================================== ==<BR><BR>Below is my code.<BR><BR>===================================== ===========<BR><BR><BR><BR>&#060;%<BR>Dim iID &#039;variable will hold the value passed to this page<BR><BR>iID = Request.Form("form1")<BR><BR><BR><BR>&#039;This function sets up our database connection<BR>Function DBConnect(propdb) <BR>Set DBConnect = Server.CreateObject("ADODB.Connection")<BR> <BR><BR>&#039; define connection string<BR>strProvider="Provider=Microsoft.Jet.OLED B.4.0;Data Source=" & Server.MapPath("properties") & "propdb.mdb;" <BR>DBConnect.Open &#039;this is line 16 where error occurs<BR>End Function <BR><BR><BR>&#039;call our function and pass to database name <BR>Set ConnSQL = DBConnect(Application("propdb")) <BR> <BR><BR>&#039;Building our SQL string <BR>sqlDynQuery = "SELECT homestyle, bedrooms, bathrooms FROM proptable "<BR>sqlDynQuery = sqlDynQuery + "WHERE ID = " & iID <BR><BR><BR>&#039;Creation of RecordSet to hold data <BR>Set RS = server.CreateObject("adodb.recordset") <BR><BR>&#039;Executing SQL string and placing it into RecordSet<BR>Set RS = ConnSQL.execute(sqlDynQuery)

  2. #2
    Erik Smith Guest

    Default RE: error mystery with dbconnect

    I think you need to put the connection string after the Open method.<BR><BR>So try:<BR>DBConnect.Open strProvider

  3. #3
    Join Date
    Dec 1969

    Default RE: thankyou i'll give it a shot

    thanks! i&#039;ll try it.

Posting Permissions

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