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.

The Database Forum


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



Reply
Updating a yes/no field in access table
Old 08-30-2005, 12:25 PM Updating a yes/no field in access table
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 08-30-2005, 12:55 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
No brackets needed around the WHERE clause.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 12:59 PM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 01:04 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
any errors ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 01:07 PM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
No, It processes fine. Just doesnt update the record.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 01:18 PM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
ok, thanks for you time. It seems to be a selection issue and not a sql update problem.
cheers
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 08-30-2005, 01:26 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-30-2005, 01:27 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
ok missed your last post before writing mine out
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Updating a yes/no field in access table
 

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 2.70452 seconds with 12 queries