Reply
Updating a yes/no field in access table
Old 08-30-2005, 11:25 AM Updating a yes/no field in access table
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
Hi all,

Im using the below code,

strSQL = "UPDATE comments SET closed = 'yes' WHERE (id = " & iRecordId & ")"

to update a records yes/no field in table with 'yes'. Nothing is happening though.

Could anyone tell me what i am doing wrong.

steve

ps. i know the connection is ok, it comes down to the SQL i think.
cheers
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
When You Register, These Ads Go Away!
     
Old 08-30-2005, 11:55 AM
chrishirst's Avatar
Super Moderator

Posts: 12,442
Location: Blackpool. UK
No brackets needed around the WHERE clause.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 11:59 AM
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
That still doesnt make any difference although I would have been surprised if it did.
My code is (i have changed yes/no in db to true/false for below example)

Code:
iRecordId = cInt(Request.Form("id"))
		strSQL = "UPDATE comments SET closed=True WHERE id = " & iRecordId 

		Set cnnDBEdit = Server.CreateObject("ADODB.Connection")
		cnnDBEdit.Open Conn
		cnnDBEdit.Execute strSQL
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 12:04 PM
chrishirst's Avatar
Super Moderator

Posts: 12,442
Location: Blackpool. UK
any errors ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 12:07 PM
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
No, It processes fine. Just doesnt update the record.
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 12:18 PM
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
ok, thanks for you time. It seems to be a selection issue and not a sql update problem.
cheers
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 12:26 PM
chrishirst's Avatar
Super Moderator

Posts: 12,442
Location: Blackpool. UK
Can't see anything wrong with the query as it stands. Response.write it out before the .execute to see if it is what you would expect.

You can paste the result into the Access query designer see if it works there.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 12:27 PM
chrishirst's Avatar
Super Moderator

Posts: 12,442
Location: Blackpool. UK
ok missed your last post before writing mine out
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Updating a yes/no field in access table
 

Thread Tools

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
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.15012 seconds with 13 queries