Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 can someone help me?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Freeman II
Junior Member

232 Posts

Posted - 09 June 2001 :  20:54:07  Show Profile
i made a simple counter using DB
but each time i run it, gives me a syntax error on line 10 in red


<!-- #INCLUDE FILE="config.asp" -->

<%
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET COUNTER = COUNTER "
strSql = strSql & " WHERE CONFIG_ID = 1"

my_Conn.Execute (strSql)

dim rs
strSql2 = "SELECT " & strTablePrefix & "CONFIG.COUNTER "
strSql2 = strSql2 & " FROM " & strTablePrefix & "CONFIG"
strSql2 = strSql2 & " WHERE CONFIG_ID = 1"

set rs = my_Conn.Execute (strSql2)


%><font>
<% =rs("COUNTER")%></font>
<%
rs.Close
%>

if you wanna test it just save as an asp file and copy it to snitz forum dir
thanks

Doug G
Support Moderator

USA
6493 Posts

Posted - 09 June 2001 :  23:45:49  Show Profile
Did you mean SET COUNTER = COUNTER + 1, by any chance?

You update statement appears correct. You can put response.write strSql just above the error to see what you're really sending to the database for a sql statement. Often your problems become obvious when you see the actual data.


======
Doug G
======
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07