Helpful Information
 
 
Category: ASP
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:


<%
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!

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.

From the JETSQL40.CHM docs: :D

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.

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.

:o

Whatta dork.

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

Got it sorted, though. Thanks! :)

Jer!










privacy (GDPR)