Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble Updating table with ADO 1

Status
Not open for further replies.

lbrechler

Programmer
May 17, 2001
44
US
Having trouble connection to an Access table to update a specific record. Here's what I'm trying (most recently):
Set rstUser= New ADODB.Recordset
SQLst = "SELECT * FROM USER where PID=2"
rstUser.Open SQLst

If rstUser.EOF Then
MsgBox ("Add New User")
rstUser.AddNew
Else
MsgBox ("Update Existing User")
rstUser.Edit
End If
I get an error that says "Method or data member not found". I've tried ".EditMode" but that isn't it either.

Any suggestions?

Thanks in advance,
~L
 
ADO does not have an edit. You simply issue an .update when you have updated the fields. Your major problem is that the ado recordest default is read-only.

rstUser.Open SQLst,yourconnection, adOpenKeyset, adLockOptimistic, adCmdText

This should get you an updateable recordset.
David Paulson


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top