DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Helson Guest

    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

  2. #2
    sensei Guest

    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



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links