FLL
Jul 10th, 2000, 09:58 PM
Hello, all. I have posted a question or two in here before concerning a program that I am writing (as I teach myself VB6 Database programming). I have learned how to use ado and have it do what I want it to, but when I try to use the data environment, I am running into some problems. I am manipulating the commands in code instead of entering them in when the data environment is created. When the form loads, I have the code that sets the command text:
DataEnvironment1.Commands("Command1").CommandText
= "Select * From Customers" (The text is on
one line here)
For the click event for a command button I have:
DataEnvironment1.Command1 (to execute command)
Then there is the code to set the properties of the text boxes to display the query results.
I think the fundamental problem is a misunderstanding of how the recordset object works within the Dataenvironment.
Could someone please give me some direction here, preferably by a coding example of what to do when one has a dataenvironment, wants to set the command text in code, wants to use a command button to execute this command, and have the recordset returned to a few text boxes on the form? The small amount of coding I provided above omitted setting the recordset object, because I am lacking understanding of how that worked. Thanks a lot!
FLL
DataEnvironment1.Commands("Command1").CommandText
= "Select * From Customers" (The text is on
one line here)
For the click event for a command button I have:
DataEnvironment1.Command1 (to execute command)
Then there is the code to set the properties of the text boxes to display the query results.
I think the fundamental problem is a misunderstanding of how the recordset object works within the Dataenvironment.
Could someone please give me some direction here, preferably by a coding example of what to do when one has a dataenvironment, wants to set the command text in code, wants to use a command button to execute this command, and have the recordset returned to a few text boxes on the form? The small amount of coding I provided above omitted setting the recordset object, because I am lacking understanding of how that worked. Thanks a lot!
FLL