ADODB.Recordset save command creates local file!?

  • Thread starter Thread starter The Dude
  • Start date Start date
T

The Dude

Hello everyone,

I had a question regarding the use of an ADODB.Recordset variable.

When I add a new record to a table using it, it creates a local file at the
moment the code runs the .save command. The file is named exactly like the
table the Recordset was opened on, and is located in the MyDocuments folder.
The file remains even after '.close' or 'Set X = nothing' flush commands.

Note that it does not occur when using the .update command; which I now use.
Nevertheless, I was wondering why it would happen.

Thanks ;)
T_D
 
The Dude said:
Hello everyone,

I had a question regarding the use of an ADODB.Recordset variable.

When I add a new record to a table using it, it creates a local file at
the
moment the code runs the .save command. The file is named exactly like the
table the Recordset was opened on, and is located in the MyDocuments
folder.
The file remains even after '.close' or 'Set X = nothing' flush commands.

Note that it does not occur when using the .update command; which I now
use.
Nevertheless, I was wondering why it would happen.


The Save method of the ADO Recordset is specifically for saving a copy of
the recordset to a file or stream -- it is not in any way equivalent to the
Update method. If you don't specify the output file location, the Save
method defaults to creating a file with a name that comes from the Source
property of the recordset.

Unless your intention is to create an external copy of the recordset, you
should not be calling the Save method. The Update method is the one that
saves your changes to the current record.
 
Ok, thank you Dirk.
I will use the update function from now on; note that I'm glad to have the
explanation on the save function... might be helpful someday.

Thanks ;)
T_D
 
Back
Top