-
Data Environment Add, Save, Delete Code
I am a little new within the visual basic 6 community, I am trying to make
my database created with DATA ENVIRONMENT to Add, Save or Delete a record,
but I am stuck because using the ADO all I have to do data.recordset.addnew
and Wallah! it works but it doesn't work this way with DataEnvironment, any
suggestion will be received with much gratitude.
Helson Morales
Ps
Alternative email: moesoftware@hotmail.com
-
Re: Data Environment Add, Save, Delete Code
Helson,
If you could perhaps describe in a little more detail your problem.
I'm assuming you have a form with various controls (text boxes, labels, check
boxes, etc) which are bound to a command in the DataEnvironment.
ex:
Here are some textboxes you might have on the form:
txtName.datafield = "name"
txtName.datasource = deMyDatabase
txtName.datamember = "cmdCustomers"
txtAddress.datafield = "address"
txtAddress.datasource = deMyDatabase
txtAddress.datamember = "cmdCustomers"
Your DataEnvironment would have:
deMyDatabase
- conMyConnection
- cmdCustomers
(under here would appear all your fields)
Then the code for the form would go something like this:
Private Sub cmdAdd_Click()
deMyDatabase.rscmdCustomers.AddNew
End Sub
>> Now you type whatever into all the fields and click on the "Update" button
Private Sub cmdUpdate_Click()
deMyDatabase.rscmdCustomers.Update
End Sub
>>>There! Now you have a new record in your database.
I now this is pretty general, but if you give me more specifics on what exactly
your error/problem(s) are then I'll be more specific.
Hope this helps.
Sensei
"Helson" <herminia@centennialpr.net> wrote:
>
>I am a little new within the visual basic 6 community, I am trying to make
>my database created with DATA ENVIRONMENT to Add, Save or Delete a record,
>but I am stuck because using the ADO all I have to do data.recordset.addnew
>and Wallah! it works but it doesn't work this way with DataEnvironment,
any
>suggestion will be received with much gratitude.
>
>Helson Morales
>
>Ps
>Alternative email: moesoftware@hotmail.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks