Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Very Basic Simple Script that should work but it doesn't

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-28 : 09:01:27
Javier writes "SQL Server 2000
Version of Windows: Unknown Using Remote Host

I've been coding ASP sites for a while and one day I wrote a simple script that would display a photo and some data. Everything worked fine till I added a couple lines of code that would add one to the "Hits" column of the Table. This is the block that I added to the end of the script after the page had been built.



'Add one to the hits Variable then update the column in WTHSS_PhotoData table

Hits = Hits + 1

hitsstr = "UPDATE WTHSS_PhotoData SET HITS ="&Hits&" WHERE
PhotoID ="

hitsstr = hitsstr & PhotoID

conn.Execute(hitsstr)

I run the page. And everything works perfectly. The page shows up fine and the error cathcing script I have at the very end catches no errors. Except when I check the database. No Updated field.
All the proper variables and the connection object are declared preivously in the script. In fact there is another UPDATE statement I use earlier in the script that mirrors this one exactly except with different variables.
If you could give any insight into my problem it would be greatly appreciated."
   

- Advertisement -