Empty ADO recordset based on a table for writing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have seen a lot of good examples where one would open a recordset by
running a query and then add or change records. However, I would like to open
an empty tecordset based on an access table. Is there a nice way to do this
without having it run a query you know will return 0 results? That trick
works but seems to be a bit of an odd way to go about it.
Thanks in advance.
 
The easiest way is to do the following.

Dim rst as New ADODB.Recordset

rstGLClass.Open "MyTable", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic

And then you off and running.
 
However, I would like to open
an empty tecordset based on an access table

SELECT FieldOne, FieldTwo, FieldThree
FROM MyTable
WHERE FALSE;


Hope that helps


Tim F
 
So if I understand this correctly: adOpenKeyset assures that the recordset
will not be loaded with the table's contents, only it's structure?
 
Thanks. However that is the workaround I have been using so far. Seemed
logical that there was a "clean" way to do this though. I hope Conrad's
solution does the job.
 
Back
Top