PDA

Click to See Complete Forum and Search --> : Update records with Dataenvironment


leontro
Jun 4th, 2000, 03:20 PM
Dear Friends,

I have a dataenvironment as DE, a connection as cnn, a command as cmdOgrenci and it has a text field "CLASS".

First, how can I update the field CLASS with an sql UPDATE statement on Dataenvironment? I want to change the first character of the field (e.g. 1-A ==> 2-A) while ignore the records begin with "A" and "Y" (ANA, YUVA etc.)

Second what are the adv. and disadv. between ADO and Dataenvironment

Thanks,

lenin
Jun 6th, 2000, 02:32 PM
Leontro,
if you add a new command to the data environment and choose SQL statement option. Add a general update command to the SQL textbox( anything will do ). Then build the SQL command you want to execute as a string. If for example the command is called "comm_Update", and the string is ls_SQL then the following should work:


DE.commands("comm_Update").commandText = ls_SQL
call DE.comm_Update

This should do the trick.

HTH

Lenin

lenin
Jun 14th, 2000, 08:50 PM
Leontro,
programming with ADO has a couple of advantages in my opinion.

1. You can built tranaction based components with ADO, not with DE.
2. I feel that using the DE adds another layer of abstraction to the programmer, so evwen though it is very simple to implement, you are removed from the "nuts and bolts" of what is going on.
3. DE is excellent for knocking together very quick db applicaitons at the expense of insight.

If you need anything else let me know.

Lenin