PDA

View Full Version : ASP help


ArcticFox
09-01-2001, 19:43
Im trying to get this damn script up and running and all i get is a damn error, i can seem to fathom whats wrong,

This is the error i get:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/review/admin/newreview.asp, line 27

Heres the code that im using:

<%@ LANGUAGE="VBSCRIPT" %>
<% Response.Buffer= true%>
<!-- #include FILE="adovbs.inc" -->
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Stuff">
<META HTTP-EQUIV="Content-Type"CONTENT="text/html;CHARSET=iso-8859-1">
<TITLE>Add a Review to the database </TITLE>
</HEAD>

<%
REM Open a connection to the database and set up a recordset.
ReviewData = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\cgi-bin\reviews.mdb")
' Create and establish data connection
Set DataConn = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")
DataConn.Open ReviewData

REM Get the values entered about the Review.
Name = request.form("Name")
Genre = request.form("Genre")
Players = request.form("Players")
Price = request.form("Price")
Score = request.form("Score")
Review = request.form("Review")

RS.Open "SELECT Name from Review ORDER BY Name ASC", DataConn, adOpenStatic, adLockReadOnly, adCmdText
RS.MoveFirst
namecheck = Ucase(Name)
found = false
While Not RS.EOF
Review = Ucase(trim(RS.Fields("name").Value))
if Review = namecheck then
found = true
end if
RS.MoveNext
WEND
RS.close

If found = false then
'Access connection code
RS.Open "Review", DataConn, adOpenKeyset, adLockPessimistic, adCmdTable

RS.Addnew
RS.Fields("Name") = Name
RS.Fields("Genre") = Genre
RS.Fields("Players") = Players
RS.Fields("Price") = Price
RS.Fields("Score") = Score
RS.Fields("Review") = Review
RS.update
RS.close
%>


Plz can u see whats the problem,

cheers

SPAWNO
09-01-2001, 21:49
ill have a good look tonight m8, see if i can sort it :)

- S

[PAR]DI55
11-01-2001, 21:43
I think it's just that you did:

Set oRs = Server.CreateObject("ADODB.Recordset")

but use stuff like:

RS.MoveFirst

in the rest of it.

The two bit's just need to match so the easiest thing would be to change:

Set oRs = Server.CreateObject("ADODB.Recordset")

to:

Set RS = Server.CreateObject("ADODB.Recordset")

Bye-ee :)