How can I change SQL of DED in running time..?

How can I change SQL of DED in running time..?

Post by Junge-seok Le » Wed, 09 Feb 2000 04:00:00



Hi All,

I am trying to change SQL statement of DED in run time.
How can I do that?
Tool :Visual Basic 6 Enterprise Edition
Step I worked :
1.Using DataEnvironment Designer
2.Made Connection1 in DED
3.then made Command1 in DED
4.then Set SQL statement in DED
5.Put Button and DBGrid on the Form
Now, I can execute this program.
But I can't change the SQL of Commnad1 in the running time.
Pressing button, I want to change the SQL of Command1.
Help me, I appreciate you..
Thanks.

 
 
 

How can I change SQL of DED in running time..?

Post by amit neg » Tue, 09 May 2000 04:00:00


Hi  Junge-seok Lee

Try this code :
I have tried this one and it worked well.
Private Sub Form_Load()
Dim DE As New DataEnvironment1
DE.Commands("command1").CommandText = "SELECT *  FROM TABLE_NAME"
DE.Command1
Do While DE.rsCommand1.EOF = False
Debug.Print DE.rsCommand1.Fields(0).Value
DE.rsCommand1.MoveNext
Loop
End Sub

Regards

Amit Negi


> Hi All,

> I am trying to change SQL statement of DED in run time.
> How can I do that?
> Tool :Visual Basic 6 Enterprise Edition
> Step I worked :
> 1.Using DataEnvironment Designer
> 2.Made Connection1 in DED
> 3.then made Command1 in DED
> 4.then Set SQL statement in DED
> 5.Put Button and DBGrid on the Form
> Now, I can execute this program.
> But I can't change the SQL of Commnad1 in the running time.
> Pressing button, I want to change the SQL of Command1.
> Help me, I appreciate you..
> Thanks.