Data Environment Add, Save, Delete Code


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Data Environment Add, Save, Delete Code

  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



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center