Connecting Tech Pros Worldwide Forums | Help | Site Map

New with ADO in vb6 (Problem with .Edit)

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 9 '08
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.Connection '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.Connection
PathLoc.Open "Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\database.mdb;" & _
"Jet OLEDB:Database Password=GODisgoodandgreat;"
End Sub


Private Sub cmdok_Click()

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

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 plzzzzzzzzzzzzzzzzzz

Expert
 
Join Date: Mar 2008
Location: Firestone, CO
Posts: 112
#2: Aug 12 '08

re: New with ADO in vb6 (Problem with .Edit)


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.
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#3: Aug 12 '08

re: New with ADO in vb6 (Problem with .Edit)


please tell me what do you ubderstand by this editmode ?
Newbie
 
Join Date: Dec 2007
Posts: 15
#4: Aug 12 '08

re: New with ADO in vb6 (Problem with .Edit)


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