Results 1 to 6 of 6

Thread: Totally random Provider error '80004005' unspecified error

  1. #1

    Thread Starter
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Can't tell much w/o code...
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  2. #2
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Here is the Code

    This is what i'm using to set-up the connection and get the recordset :

    <%
    Set Con = Server.CreateObject ("ADODB.Connection")
    Con.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=d:\InetPub\wwwroot\development\News.mdb"

    set rs = Server.CreateObject("ADODB.RecordSet")
    rs.Open "SELECT Title, ID FROM NewsArticles WHERE ID > ((SELECT MAX(ID) from NewsArticles)-3) ORDER BY ID DESC", Con, 3, 3
    %>

    This is how the recordset is used :

    <font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>
    <p><a href="newsarticle.asp?ID=<%=rs("ID")%>"><%=rs("Title")%></a></p>
    <%rs.MoveNext%>
    <p><a href="newsarticle.asp?ID=<%=rs("ID")%>"><%=rs("Title")%></a></p>
    <%rs.MoveNext%>
    <p><a href="newsarticle.asp?ID=<%=rs("ID")%>"><%=rs("Title")%></a></p>
    </b>
    </font>

    I then close recordset and connection at the end of the page :

    <%
    rs.Close
    Con.Close
    %>

  3. #3
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45
    Ok i think i found the problem, there was a problem with the database that was causing only 2 records to be retreived and not 3 like the page was expecting, this was causing the page to error and not get to the end and hence not close the database connection etc.

    Thats what i THINK was going on anyway ...

  4. #4

    Thread Starter
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    For starters, why are you using the ODBC driver for Access instead of the OLEDB provider?

    Code:
    Con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\InetPub\wwwroot\development\News.mdb;Persist Security Info=False" 
    
    
    'Loop through the recordset:
    
    <font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b> 
    <%Do until rs.EOF%>
        <p><a href="newsarticle.asp?ID=<%=rs.Fields("ID")%>"><%=rs.Fields("Title")%></a></p> 
        <%rs.MoveNext
    Loop%>
    </b></font>
    Also your ORDER BY clause needs a comma to deparate ID and DESC.


    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  5. #5
    Member
    Join Date
    Oct 2000
    Location
    Sussex, England
    Posts
    45

    Thanks for the info, looping through the recordset is a good idea and would have actually solved my problem, i really have no excuse for not thinking of it in the first place !

    One thing i don't get though ... can you explain what the difference is between my connection string and the one you suggested as what I am using IS working, would the be a benefit to doing it your way?

    Best Regards
    Ian.

  6. #6

    Thread Starter
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    ODBC is slower than OLEDB.

    In fact, I can't think of ANY reason to use the Access ODBC driver... not even sure why they supply one for windows based platforms...

    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width