msflexgrid in vb 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sreedivya
    New Member
    • Jul 2007
    • 14

    msflexgrid in vb 6.0

    im new to vb 6.0

    As im using MSflexgrid in my project

    i dont know how to save and edit the grid values into database

    please anyone help me out
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    How the grid control is getting populated ?

    Comment

    • sreedivya
      New Member
      • Jul 2007
      • 14

      #3
      Originally posted by debasisdas
      How the grid control is getting populated ?
      grid is populated as
      i have inserted a combobox in grid and seleted the values from combobox

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        Open an ADO connection to your Database,
        Open a Recordset, Loop through the Grid rows/ column, and add records..

        Some thing like this :

        [code=vb]
        Dim Conn As New ADODB.Connectio n
        Dim RS As New ADODB.Recordset
        Dim i As Integer
        '
        'Open Connection here
        RS.Open "Select * From MyTable",Conn, adOpenDynamic, adOpenLockOptim istic
        For i = 1 To Grd.Rows-1
        RS.AddNew
        RS("Fld1") = Grd.TextMatrix( i,0)
        RS("Fld2") = Grd.TextMatrix( i,1)
        RS("Fld3") = Grd.TextMatrix( i,2)
        RS("Fld4") = Grd.TextMatrix( i,3)
        RS.Update
        Next
        [/code]

        Or else, use DATAGRID


        Regards
        Veena

        Comment

        • larix
          New Member
          • Nov 2008
          • 1

          #5
          Originally posted by sreedivya
          im new to vb 6.0

          As im using MSflexgrid in my project

          i dont know how to save and edit the grid values into database

          please anyone help me out
          Hi Vidhya,
          Just view the opensource of Editable Flexgrid from wbcsoftwarelab, which I use. Hope your doubts are cleared.

          Comment

          Working...