New with ADO in vb6 (Problem with .Edit)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • atzthegreat
    New Member
    • Aug 2008
    • 2

    New with ADO in vb6 (Problem with .Edit)

    hi guys i really need your help.. i have a big problem with coding in vb6. i used ADO.. i try to make an edit function but it is not in menu

    please check my codes maybe there something wrong...

    Option Explicit

    Private PathLoc As adodb.Connectio n 'this is the connection
    Private PathRec As adodb.Recordset 'this is the recordset

    Private Sub Form_Load()
    Set PathLoc = Nothing
    Set PathRec = Nothing

    Set PathLoc = New adodb.Connectio n
    PathLoc.Open "Provider = Microsoft.Jet.O LEDB.4.0;" & _
    "Data Source=" & App.Path & "\database.mdb; " & _
    "Jet OLEDB:Database Password=GODisg oodandgreat;"
    End Sub


    Private Sub cmdok_Click()

    Set PathRec.Open = "SELECT * FROM users where username = '" &_
    txtusername.Tex t & "'"

    With PathRec
    .editmode ' there is no edit in the menu only editmode ... whats wrong

    .Fields("status ") = "Disabled"
    .Update 'this updates the recordset etc.
    End With
    End If
    End If
    End If
    End If
    End Sub

    please help..... thanks a lot plzzzzzzzzzzzzz zzzzz
  • janders468
    Recognized Expert New Member
    • Mar 2008
    • 112

    #2
    Is this not updating? If it isn't it has to do with the options you gave it when you opened the recordset. ADO does not have an edit mode. If you open the recordset with the ability to update you should be able to do what you are doing and then when you tell it to update it should.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      please tell me what do you ubderstand by this editmode ?

      Comment

      • IceBower
        New Member
        • Dec 2007
        • 15

        #4
        If your trying to do what i think you are then the .Update should sufice. There shouldnt be any need to enter 'Edit Mode'

        Comment

        Working...