Community discussion forum

Basic ADODC Example

This is a comment thread discussing Basic ADODC Example
  • 10 years ago

    This thread is for discussions of Basic ADODC Example.

  • 2 years ago

    hey im new in VB and i downlaoded your code, and i wonder if you could help me on my baby thesis.My problem is just how to edit the records on my database using a command button.Here is my first form:

    http://i69.photobucket.com/albums/i70/lhouwhie/form1.gif

    When i click the "Edit" button the following form loads:

    http://i69.photobucket.com/albums/i70/lhouwhie/form2.gif

    Then when o click on the "Save" button nothing happens, when i go back to the dirst form the records just stays the same.

    Here's my code for the "Save" button (i haven't put trappings yet):

    Private Sub cmdsave_Click()
    Adodc1.Refresh
    Adodc1.Recordset.Fields("Firstname") = txtfname.Text
    Adodc1.Recordset.Fields("Lastname") = txtlname.Text
    Adodc1.Recordset.Fields("Address") = txtaddress.Text
    Adodc1.Recordset.Fields("ContactNumber") = txtcnum.Text
    Adodc1.Recordset.Fields("Birthdate") = txtbirth.Text
    Adodc1.Recordset.Fields("UserLevel") = cmblvl.Text
    Adodc1.Recordset.Fields("Gender") = cmbgen.Text
    Adodc1.Recordset.Update
    Adodc1.Refresh
    End Sub










    thanks in advance and God Bless

     

  • 1 year ago

     How can i search a string inlcuding '  example   'John

  • 1 year ago

    hello..i am wanting to search the access database that i made with the visual data manager.

    I have a search button, datagrid, an adodc connected to the database, its reading the database well alright on the VB 6.0 form.

    I want to be able to click on the search button to fire even if no database has not yet been entered with Data without declaring bookmark within the code.

    Whenever i click on the search button to fire the event to search the database, though it has not yet been populated with data, it flags and debugs the bookmark declaration.

    Here is the code i used on the search button to search the access database on the vb form connected to the adodc.

    Private Sub CmdSearchGrid3_Click(Index As Integer)
    Dim searchvar As String
    Dim sBookMark As String
    searchvar = InputBox("Enter the Country to find")
    searchvar = Trim$(searchvar) ' removes surplus spaces
       If searchvar <> "" Then 'cancel if nothing entered
       With Data1.Recordset
       sBookMark = .Bookmark
       .FindFirst "Country like '" + searchvar + "*'"
         If .NoMatch Then ' record not found
         MsgBox "No matching record"
         .Bookmark = sBookMark
         End If
       End With
       End If
    End Sub

    This code when the search button is fired flags the sBookMark = .Bookmark debug because the database hs no data, well enough.

    Can you help me out here to enable the search button to fire an empty database and return No matching record. I dont know how to get rid of the .Bookmark function?

    cheers

    Paul Martins

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback