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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RECORDSET PRBLEMS

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello

I'm using VB frontend and Access2000 backend. I've set up a connection using ADO.
I can successfully set up the connection and populate the recordset, however, I need help with assigning values from textboxes to the recordset and navigating through the recordset.

To assign values from a text box to the recordset I was going down the lines of:
RS.fields("details.surname") = txtSurname.Text
RS.Update

To navigate through the recordset I used something like the following attached to a command button:

RS.MoveNext
If RS.EOF Then
RS.MoveLast
End If
(nothing happens and no error is generated)

I've set up a similar application using the dataEnvironment object and was able to achieve the above, but would prefer to use ADO objects.

Some examples would be appreciated, Thanks




 
My nifty li'l ADO book has three examples for update -
1.
Code:
objRS("field1").Value = Value1
    objRS("field2").Value = Value2
    objRS.Update
2.
Code:
objRS.Update "field", Value ' for one field update only
3.
Code:
objRS.Update Array("field1", "field2"), _
      Array(Value1, Value2)

It also says "Using any of the
Code:
Move
methods will implicitly call
Code:
Update
."

It also notes that not all recordsets support the Update method. You can check this with an if statement:
Code:
If objRR.Supports(adUpdate) Then
     Debug.Print "Update OK"
  Else
     Debug.Print "Darn!"
  End If


As far as the moving goes, it seems something like

Code:
If RS.EOF Then
  RS.MoveLast
Else
  RS.MoveNext
End If

would make sense.

Hope anything I typed actually helped. Good luck!
~Melissa

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top