dbTalk Databases Forums  

Update problem with numeric type:

comp.databases.ms-access comp.databases.ms-access


Discuss Update problem with numeric type: in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chumley
 
Posts: n/a

Default Update problem with numeric type: - 03-04-2010 , 12:43 PM






Using vbscript w/ MsAccess, I am trying to update a column that is a
numeric data type, where i have one sql statement in my script that
works perfectly:
''''''''
dim strSQL,rsPoll, SQLco,rsCo
strSQL="UPDATE FLO set answer1 = " & Request.Form("txtOption") & " + 1
WHERE ID = " & ID
SET rsPoll=adoCon.execute(strSQL)
''''''''
SQLco = "update FLO set auxx = " & request.Form("qco")) &" + 1 WHERE
ID=" & ID & ""
SET rsCo=adoCon.execute(SQLco)

both answer1 and auxx columns are number types, default value set at
0. The answer1 column gets its updated value no problem, but auxx ONLY
shows a zero (0) when the update statement runs, does NOT get its new
numeric value.

??
chumley

Reply With Quote
  #2  
Old   
Rich P
 
Posts: n/a

Default Re: Update problem with numeric type: - 03-04-2010 , 03:21 PM






You are using two different recordset objects -- rsPoll and rsCo -- to
update the same table -- FLO. Try using the same recordset object --
the one which appears to work correctly -- rsPoll.

Additionally, if you are updating these fields on the same button click
- you should combine the updates

Update FLO Set Anser1 = " & ... & ", auxx = " & ... " Where ID = " & ID

Lastly, you end one statement like this: Where ID = " & ID

and the sencond statement like this: Where ID = " & ID & ""

You should end it like the first statement as I am guessing ID is an int
field and does not require delimiting.

Rich

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.