Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Help With Error

  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Central Ohio
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help With Error

    Ok, I can download scripts and sometimes I can get them to work. I've been batting about .500 lately, this is a swing & a miss, though. I got an error.

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]Error in row

    /quotes/quote_submit.asp, line 37
    And the code:

    Code:
    <% 
    	quote = request.form("quotecrt")
    	name = request.form("namecrt")
    	
    	quote = Replace(quote,"&##&","""")
    	name = Replace(name,"&##&","""")
    				
      	Set Conn=Server.CreateObject("ADODB.Connection")
    	Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("/fpdb/quotes.mdb")
    
    	SQL = "Select top 1 * from quotes order by quoteid desc;"
    	
    	Set rs = Server.CreateObject("ADODB.Recordset")
          
    	rs.open sql,conn,1,3
    	  
    
    	if not rs.eof then
    		num = rs("quoteid") + 1
    	else
    		num = 1
    	end if
    
    	flag = false
    	rs.addnew
    	rs("quoteid") = num
    	rs("quotetext") = quote
    	rs("author") = name
    	rs.update
    	
    	rs.close	
    	conn.close
    	set rs = nothing
    	set conn = nothing
    	Response.Redirect "index.asp"
    %>
    Line 37 is the re.update line (I omitted the html tags & such.

    Any help appreciated. Thanks!

    Jer!
    Jers-Web, Inc.
    Ever seen 49,825 Alert Boxes on one page? I have!

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What is the "top 1" in your sql statement? I am not sure what that does but try taking it out and updating.

    If that doesnt work -->
    Comment out all of your :

    rs("quoteid") = num
    rs("quotetext") = quote
    rs("author") = name

    and try updating one at a time:

    See if you can narrow it down to one field and go from there.

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    From the JETSQL40.CHM docs:

    SELECT TOP n [PERCENT] FROM table

    TOP n [PERCENT] Returns a certain number of records that fall at the top or the bottom of a range specified by an ORDER BY clause. Suppose you want the names of the top 25 students from the class of 1994:

    SELECT TOP 25 FirstName, LastName
    FROM Students
    WHERE GraduationYear = 1994
    ORDER BY GradePointAverage DESC;

    If you do not include the ORDER BY clause, the query will return an arbitrary set of 25 records from the Students table that satisfy the WHERE clause.

    The TOP predicate does not choose between equal values. In the preceding example, if the twenty-fifth and twenty-sixth highest grade point averages are the same, the query will return 26 records.

    You can also use the PERCENT reserved word to return a certain percentage of records that fall at the top or the bottom of a range specified by an ORDER BY clause. Suppose that, instead of the top 25 students, you want the bottom 10 percent of the class:

    SELECT TOP 10 PERCENT FirstName, LastName
    FROM Students
    WHERE GraduationYear = 1994
    ORDER BY GradePointAverage ASC;

    The ASC predicate specifies a return of bottom values. The value that follows TOP must be an unsigned Integer.

    TOP does not affect whether or not the query is updatable.

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    btw the '80004005' error in row may mean:

    1 - the fields being passed are not the same as the fields in the data source.

    2 - one or more of the field values being passed contains a null or empty value but the field(s) in the data source is not set to alow null.

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    Central Ohio
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Whatta dork.

    The page wasn't meant to viewed by itself. It was just a 'form handling' page. I feel kinda stoooooopid now.

    Got it sorted, though. Thanks!

    Jer!
    Jers-Web, Inc.
    Ever seen 49,825 Alert Boxes on one page? I have!


  •  

    Posting Permissions

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