[V4RB] How should I use UpdateAll?

Richard Altenburg valentina at brainchild.nl
Thu Mar 20 15:30:20 CST 2003


On 20-03-2003 15:14, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

>> Anyhow, whatever I did, this did not work, so I got to using a loop in which
>> I fill the value of the type-casted ObjectPtr-field with a numeric form of
>> the ID in the staticText. That works, but slower.
>> 
>> Can you tell me then how to do the UPDATE in SQL and get a proper numeric
>> value into the ServerRecID instead of a string value?
> 
> Why you say that you work with string value ???
> You get query as
> 
>   UPDATE AvailableGroup SET ServerRecID=5
>   WHERE ServerRecID=0
> 
> Where you see strings?
> 
> Yes, staticTextID.Text is string, but this is because we build SQL STRING
> for query.
> 
> In SQL strings are quotes, e.g.
> 
>       field = '5'  // this is really STRING '5'
>           
> Query 
> 
>   UPDATE AvailableGroup SET ServerRecID=5
>   WHERE ServerRecID=0
> 
> Must works!
> 
> Does it work for you ?

NO!

When I do the UPDATE like you suggest ("SET ServerRecID="+staticTextID.Text)
then the value actually present in the database becomes '5' instead of 5.

So I can only get the records back by querying with a string value, but that
is not what a RecID is, so there is no relation in that case.

I don't know what is wrong, I do what I should do, but it will not work.

I must try maybe with other fields, not just a staticText.

So I have some more work to do... And that is fine with me, as long as it
solves the problems fast and secure. I will let you know how it went. Also I
will try the BaseObject method suggestion you gave me the other day...



More information about the Valentina mailing list