List Info

Thread: ado update sql




ado update sql
user name
2006-08-29 12:28:51

update tablename set a=1, b=2 where m=3

should do it. Remember you must enclose text fields in single quotes:

update ch set picture = 'ch1.jpg'

using params with suitable types would sort out the quoting issues
'automagically'.

Dave

tony_bat wrote:

>I am new to ado. I have been writing sql statements for years. I can
>retrieve info now using ado query. My problem is I can not format a
>update statement that works either using adoquery or adocommand. Would
>someone please send me a simple sql statement that works please no
>parms just simple Update table a set field b = x, field c = y, field d
>= z where field m = 1.
>
>example of code Update ch set picture = ch1.jpg
>gives error too few parameters. expected 1
>
>example of code Update ch set picture = "ch1.jpg"
>gives error Invalid bracketing of name {ch1.jpg]
>
>using d7 professional
>xp sp2
>
>Thanks in advance
>Tony
>
>
>
>
>
>
>-----------------------------------------------------
>Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: delphi-en-unsubscribeyahoogroups.com
>Yahoo! Groups Links
>;
>
>
>
>
>
>
>
>

__._,_.___
.

__,_._,___
ado update sql
user name
2006-08-29 12:42:26

Duh I was using double quotes. Some times you can't see the forest for the trees.
Thanks Tony

Dave Sellers <davereddoorsoftware.co.uk> wrote:
update tablename set a=1, b=2 where m=3

should do it. Remember you must enclose text fields in single quotes:

update ch set picture = 'ch1.jpg'

using params with suitable types would sort out the quoting issues
'automagically'.

Dave

tony_bat wrote:

>I am new to ado. I have been writing sql statements for years. I can
>retrieve info now using ado query. My problem is I can not format a
>update statement that works either using adoquery or adocommand. Would
>someone please send me a simple sql statement that works please no
>parms just simple Update table a set field b = x, field c = y, field d
>= z where field m = 1.
>
>example of code Update ch set picture = ch1.jpg
&gt;gives error too few parameters. expected 1
>
&gt;example of code Update ch set picture = "ch1.jpg"
>gives error Invalid bracketing of name {ch1.jpg]
>
>using d7 professional
>xp sp2
>
>Thanks in advance
&gt;Tony
&gt;
>
&gt;
>
>
>
>-----------------------------------------------------
&gt;Home page: http://groups.yahoo.com/group/delphi-en/
>To unsubscribe: delphi-en-unsubscribeyahoogroups.com
>Yahoo! Groups Links
>;
>
&gt;
>
>
&gt;
>
&gt;
>


---------------------------------
How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )