Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whats wrong with this code : <%

Status
Not open for further replies.

BigBadDave

Programmer
May 31, 2001
1,069
EU
Whats wrong with this code :

<%
score = Request(&quot;score&quot;)
fname = Request(&quot;fname&quot;)
lname = Request(&quot;lname&quot;)
email = Request(&quot;email&quot;)

data_source = &quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=&quot; & Server.MapPath(&quot;scores.mdb&quot;)
set rspl = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rspl.open &quot;select * from t_scores where ( score = '&quot; & score & &quot;' ) and ( email = '&quot; & email & &quot;')&quot;, data_source

If rspl.EOF and rspl.BOF Then

Set con = Server.CreateObject(&quot;ADODB.Connection&quot;)
con.Open data_source
set rs = server.createobject(&quot;adodb.recordset&quot;)
rs.open &quot;t_scores&quot;, con, 2, 2

rs.addnew

if score=&quot;&quot; THEN
rs(&quot;score&quot;) = NULL
Else
score = Replace(score,vbCrlf,&quot;&quot;)
rs(&quot;score&quot;) = score
END IF

if fname=&quot;&quot; THEN
rs(&quot;fname&quot;) = NULL
Else
fname = Replace(fname,vbCrlf,&quot;&quot;)
rs(&quot;fname&quot;) = fname
END IF

if lname=&quot;&quot; THEN
rs(&quot;lname&quot;) = NULL
Else
lname = Replace(lname,vbCrlf,&quot;&quot;)
rs(&quot;lname&quot;) = lname
END IF

if email=&quot;&quot; THEN
rs(&quot;email&quot;) = NULL
Else
email = Replace(email,vbCrlf,&quot;&quot;)
rs(&quot;email&quot;) = email
END IF

rs.update
rs.movelast
set rs = nothing
set con = nothing

End If

rspl.close
set rspl = nothing
%>

I get the following error :

Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/web/flashgame/send_score.asp, line 9 Regards

Big Dave


** If I am wrong I am sorry, but i'm only trying to help!! **

 
I'm not sure this is the problem but don't you have to specify what you're requesting?

score = Request(&quot;score&quot;)
fname = Request(&quot;fname&quot;)
lname = Request(&quot;lname&quot;)
email = Request(&quot;email&quot;)

You might need to change the above to this type of format depending on what you're requesting.

score = Request.QueryString(&quot;score&quot;)
or
score = Request.Form(&quot;score&quot;)
 
No this isn't the problem, but thanxs for responding. Regards

Big Dave


** If I am wrong I am sorry, but i'm only trying to help!! **

 
I figured out what the problem was, it was because i had delimiters on a number field when I didn't need them. Regards

Big Dave


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top