Simple question on accessing a Database Recordset

Simple question on accessing a Database Recordset

Post by Modiglian » Sat, 13 Jul 2002 08:36:46

You're going to have to find a reference source. Getting the info you need
like this, one problem at a time, is just too slow. And you need to get up
too speed on some of the basic concepts. Persevere with the online help.

But, for what it's worth --

You don't update columns independently. You add a new row (record) to the
recordset, then update the columns in that row.
There are two basic methods:

MyRecordset("Col1") = new value
MyRecordset("Col2") = new value


SQL = "INSERT INTO Summary (Field1, Field2) VALUES (v1, v2);"
DB.execute SQL

But there's a lot more to it that you need to know about.

Quote:> I am using a table from an access database
> called "Summary".  Within this table there are two
> columns, "configuration" and "data".  I've created a
> recordset to the summary table:
> Set RSSummary = DB.OpenRecordset("Summary")
>   Set datSummaryRS.Recordset = RSSummary

> but what is the correct syntax for adding new elements to
> each of my columns??
> This is what i tried for updating the configuration column:
> datSummaryRS.Recordset.configuration.AddNew() = strConfig
> datSummaryRS.Recordset.Update

> alternatively i tried:
> datSummaryRS.Recordset.AddNew(![configuration]) = strConfig

> I don't have a VB book and the online library is rather
> hard to peruse!
> Thanks,
> C