Daron
Thu Jun 26 08:32:26 CDT 2008
On Jun 25, 4:07=A0pm, "McKirahan" <N...@McKirahan.com> wrote:
> "Daron" <Daron.Low...@gmail.com> wrote in message
>
> news:152c3dbd-b5fa-475b-bd57-b514c032094d@r66g2000hsg.googlegroups.com...
>
>
>
> > On Jun 25, 2:46 pm, "McKirahan" <N...@McKirahan.com> wrote:
> > > "Daron" <Daron.Low...@gmail.com> wrote in message
>
> > >news:9b487a20-a038-45bb-9328-fe931858c886@34g2000hsf.googlegroups.com.=
..
>
> > > > I need to update a text file.
>
> > > > My current attempt is to create a recordset from the text file, whi=
ch
> > > > I am thinking I would have to disconnect to make it updatable. Here=
is
> > > > my code sample:
>
> > > > sql_Regents =3D "SELECT * FROM [" & str_PlanName & ".csv]"
>
> > > > 'Connect to the text file, and create our base RecordSet
> > > > Set rs_regents =3D CreateObject("ADOR.RecordSet")
> > > > rs_regents.Open sql_Regents, strCon', adOpenForwardOnly,
> > > > adLockBatchOptimistic
>
> > > > 'disconnect the recordset to update it
> > > > Set rs_Regents.ActiveConnection =3D Nothing
>
> > > > str_PlanName & ".csv" is an existing file. I get the following erro=
r
> > > > at the "Set rs_Regents.ActiveConnection =3D Nothing" line:
>
> > > Why use a recordset to update a text file.
>
> > > Why not use the FileSystemObject.
>
> > > How are you updating it -- adding,changing, deleting lines?
>
> > I am updating sets of the records. I need to be able to filter out
> > certain sets of the records based on a date field, update those
> > records, and then go on to the next filtered subset.
>
> > I could walk thru the file line-by-line, but with potentially 10's of
> > thousands of records, and multiple files, I am hoping that using a
> > recordset would be faster.
>
> > Does this help?
>
> A Google of "ado csv recordset update" I found these links:
http://forums.=
devx.com/showthread.php?t=3D46068
> <UR:
http://www.eggheadcafe.com/forumarchives/VisualBasicdatabaseado/Nov20=
05/
> post24246438.asp>
>
> If not look into disconnected recordsets...
That is what the original post is about, an error with the
disconnected recordset. I would still appreciate help on this error if
possible.
I will look at the links suggested as well.