Strange Error

Discussion in 'ASP General' started by Jack, Nov 8, 2004.

  1. Jack

    Jack Guest

    Hi,
    I got an asp page in a test database which works fine first time it is
    loaded. However, when I try to refresh the page, it gives me the following
    error:

    Provider (0x80004005) Unspecified error

    Error in line 17

    Incidentally, Line 17 is the following:
    CN.Open myDSN

    I appreciate any advise/help in advance.


    CODE:
    <%@ Language=VBScript %>
    <!-- #include file="adovbs.inc" -->

    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE>Sailors Web Site</TITLE>
    </HEAD>
    <BODY>

    <%
    myDSN="DRIVER={Microsoft Access Driver (*.mdb)}; "
    myDSN=myDSN & "DBQ=C:\____SAILORS\Sailors.mdb"

    set CN=server.createobject("ADODB.Connection")
    set RS=server.createobject("ADODB.Recordset")
    CN.Open myDSN

    RS.ActiveConnection=CN
    SQL = "qAllClubs"

    RS.Open SQL
    %>
    <DIV ALIGN=CENTER>
    <BIG> <BIG><FONT COLOR=navy>Sailors Case Study</FONT></BIG></BIG>
    </DIV>
    <BR><BR>
    <FORM ACTION=registrationconfirmation.asp method=POST NAME = frmRegister>
    <TABLE>
    <TR>
    <TD HEIGHT=50 COLSPAN=2><FONT COLOR=navy>Registration Screen</FONT></TD>
    </TR>

    <TR>
    <TD>First Name</TD>
    <TD><INPUT TYPE=text NAME=txtFirstName SIZE=15></TD>
    <TD><WIDTH=100></TD>
    <TD>&nbsp;</TD>
    <TD>Last Name</TD>
    <TD><INPUT TYPE=text NAME=txtLastName SIZE=15></TD>
    </TR>

    <TR>
    <TD>State</TD>
    <TD><INPUT TYPE=text NAME=txtState SIZE=2></TD>
    <TD> <WIDTH=50></TD>
    <TD> </TD>
    <TD>Date of Birth</TD>
    <TD><INPUT TYPE=text NAME=txtDateofBirth SIZE=8></TD>
    </TR>

    <TR>
    <TD>Referee</TD>
    <TD><INPUT TYPE=checkbox NAME=chkReferee VALUE=1></TD>
    </TR>

    <TR>
    <TD>Professional Class</TD>
    <TD COLSPAN=4>
    <INPUT TYPE=radio NAME=optClass VALUE=1 checked>Professional
    <INPUT TYPE=radio NAME=optClass VALUE=2>Ranked Amateur
    <INPUT TYPE=radio NAME=optClass VALUE=3>Other
    </TD>
    </TR>

    <TR>
    <TD>Club Name</TD>
    <TD COLSPAN=3>


    <SELECT NAME="lstClubs" SIZE = "1">
    <%
    Do while Not RS.EOF
    Response.Write "<OPTION VALUE='" &RS("clubname") & "'>"
    Response.Write RS("clubname") & "</OPTION>"
    RS.MoveNext
    Loop
    RS.Close
    Set RS = Nothing
    %>
    </SELECT></TD>
    </TR>

    <TR>
    <TD>&nbsp;</TD>
    </TR>

    <TR>
    <TD><INPUT TYPE=button NAME=btnSubmit VALUE=Submit></TD>
    </TR>


    </TABLE>
    </FORM>


    </BODY>
    </HTML>
     
    Jack, Nov 8, 2004
    #1
    1. Advertising

  2. > Provider (0x80004005) Unspecified error
    > Error in line 17


    Stop using ODBC. Stop using ADOVBS.Inc. And stop using ADODB.Recordset.

    <HTML>
    <HEAD><TITLE>Sailors Web Site</TITLE></HEAD>
    <BODY>

    <%
    myDSN="Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\____SAILORS\Sailors.mdb"
    set conn = Server.CreateObject("ADODB.Connection")
    conn.open myDSN

    ...
    ' don't open this until you're ready to use it!
    set rs = conn.execute("EXEC qAllClubs")
    Do while Not RS.EOF
    Response.Write "<OPTION VALUE='" &RS("clubname") & "'>"
    Response.Write RS("clubname")
    RS.MoveNext
    Loop
    RS.Close: Set RS = Nothing
    ' always close the connection too!!!
    conn.close: set conn = nothing
    %>

    Please see the following URLs to see why I corrected all of these issues:

    http://www.aspfaq.com/2126
    http://www.aspfaq.com/2112
    http://www.aspfaq.com/2191
    http://www.aspfaq.com/2435
    http://www.aspfaq.com/2424#db
     
    Aaron [SQL Server MVP], Nov 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Panic
    Replies:
    2
    Views:
    5,247
    Marc Guardiani
    Oct 24, 2003
  2. kwaj
    Replies:
    1
    Views:
    428
    Egbert Molenkamp
    Mar 7, 2004
  3. Jan
    Replies:
    2
    Views:
    1,439
    Mike Treseler
    Dec 16, 2004
  4. Harvey Twyman
    Replies:
    8
    Views:
    570
    August Derleth
    Oct 25, 2003
  5. Sam
    Replies:
    2
    Views:
    145
    Bob Barrows [MVP]
    Nov 16, 2007
Loading...

Share This Page