Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 12:00 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: UPDATE statement with Database
PostPosted: May 15th, 2007, 3:41 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Anyone please help
I'm using Database and doing everything well,but when using Update I can use it only with numbers if I use variable it doesn't update
example
RecSet = db.ExecuteSQL("UPDATE Table1 SET Sales=400 WHERE City='DDD' ");
This is working perfectly
BUT

RecSet = db.ExecuteSQL("UPDATE Table1 SET Sales=myValue WHERE City='DDD' ");
(myvalue is a variable) it doesn't work
The variable is declared as public and has an input box on the same page


Top
 Profile  
 
 Post subject: Re: UPDATE statement with Database
PostPosted: May 15th, 2007, 5:31 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
opuslover wrote:
RecSet = db.ExecuteSQL("UPDATE Table1 SET Sales=myValue WHERE City='DDD' ");
(myvalue is a variable) it doesn't work
The variable is declared as public and has an input box on the same page

The variable will not be expanded as you have included it in the string. You need to do this:
Code:
RecSet = db.ExecuteSQL("UPDATE Table1 SET Sales=" + myValue + " WHERE City='DDD' ");

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 15th, 2007, 8:13 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Thanks Duncan for your reply
it's working


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group