Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 06-28-2003, 07:11 PM ASP Update Record
mworld's Avatar
Experienced Talker

Posts: 42
Location: United Kingdom
Trades: 0
I have an update record that brings me the following message:

Quote:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/gangstermatch/go.asp, line 38
I get this error a lot. I think its due to the update column being numerical. I need a work around or something.

Quote:
<%
' this updates the amount of credits the user has
' this sets the new amount of credits
Dim newcred
newcred = ((credits.Fields.Item("credits").Value) + 1)
' this is the update command line
sql = "UPDATE users SET credits = '5' WHERE ID = '" + Request.QueryString("ID") + "'"
' execute the update
Dim MM_editCmd
Dim MM_editConnection
MM_editConnection = MM_gangstermatch_STRING
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = sql
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' ends updating a users credits
%>
Thanks for helping
__________________
Chris Worfolk -
Please login or register to view this content. Registration is FREE
mworld is offline
Reply With Quote
View Public Profile Visit mworld's homepage!
 
 
Register now for full access!
Old 06-29-2003, 10:47 AM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
This can't be the whole code right? We need the whole code so that we can see what line 38 is. Also can you list the fields that you have and what type of data (string, integer, etc) they are. Thanks.
-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
Old 06-29-2003, 12:54 PM
mworld's Avatar
Experienced Talker

Posts: 42
Location: United Kingdom
Trades: 0
The whole page code is:

Quote:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/gangstermatch.asp" -->
<%
Dim credits__MMColParam
credits__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
credits__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim credits
Dim credits_numRows

Set credits = Server.CreateObject("ADODB.Recordset")
credits.ActiveConnection = MM_gangstermatch_STRING
credits.Source = "SELECT * FROM users WHERE ID = " + Replace(credits__MMColParam, "'", "''") + ""
credits.CursorType = 0
credits.CursorLocation = 2
credits.LockType = 1
credits.Open()

credits_numRows = 0
%>
<%
' this updates the amount of credits the user has
' this sets the new amount of credits
Dim newcred
newcred = ((credits.Fields.Item("credits").Value) + 1)
' this is the update command line
sql = "UPDATE users SET credits = '5' WHERE ID = '" + Request.QueryString("ID") + "'"
' execute the update
Dim MM_editCmd
Dim MM_editConnection
MM_editConnection = MM_gangstermatch_STRING
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = sql
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' ends updating a users credits
%>
<html>
<head>
<title><%=gamename%> :: Clocked</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="gangster.css" />
</head>

<body><!--#include file="header.asp"-->
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><p class="t">Clocked!</p>
<p>Well done, you have earned your friend another credit for the game. As
the aim of the game is to get as many credits as possible, this is indeed
a good thing. Want to start your own gang? Sign up here...</p>
</td>
</tr>
</table>
<!--#include file="footer.asp"-->
</body>
</html>
<%
credits.Close()
Set credits = Nothing
%>
Also the data fields are:

Quote:
ID - AutoNumber
Username - text
Password - text
email - text
fullname - text
MSN - text
Yahoo - text
ICQ - number
AIM - text
Bio - memo
credits - number
Admin - text
gang - text
Line 38 is:

Quote:
MM_editCmd.Execute
I think. Thanks
__________________
Chris Worfolk -
Please login or register to view this content. Registration is FREE
mworld is offline
Reply With Quote
View Public Profile Visit mworld's homepage!
 
Reply     « Reply to ASP Update Record
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19863 seconds with 12 queries