How to create empty recordset 
Author Message
 How to create empty recordset

I am using a recordset to pass data between the different tiers of my 3-tier
app.  My problem is when I add a new record, I first need to create an empty
recordset so that I can fill in the new data.  The most expensive method is
to create the empty recordset from the database.  Another method is to save
a copy of the recordset in a file on the client.  The next time I need to
create an empty recordset, I create it from the local copy and save on a
roundtrip.

I am interested in how fellow developers solve the above issue?  Thanks

Bobx



Tue, 07 Sep 2004 15:28:50 GMT  
 How to create empty recordset
Hi,

If you need to get empty recordset with most recent
possible changes in database, then you need to use SELECT
statement for that

SELECT * FROM MyTable WHWRE 1=0

In that case if you have some changes in datatypes/length
of fileds (which is possiblem but not desirable), then you
will see then if your recordset.
If you are sure that structure will not be changed, then
you can create recordset on cliuent side without roundtrip
to server.

Val

Quote:
>-----Original Message-----
>I am using a recordset to pass data between the different
tiers of my 3-tier
>app.  My problem is when I add a new record, I first need
to create an empty
>recordset so that I can fill in the new data.  The most
expensive method is
>to create the empty recordset from the database.  Another
method is to save
>a copy of the recordset in a file on the client.  The
next time I need to
>create an empty recordset, I create it from the local
copy and save on a
>roundtrip.

>I am interested in how fellow developers solve the above
issue?  Thanks

>Bobx

>.



Tue, 07 Sep 2004 21:57:06 GMT  
 How to create empty recordset

I am using a recordset to pass data between the different tiers of my 3-tier
app.  My problem is when I add a new record, I first need to create an empty
recordset so that I can fill in the new data.  The most expensive method is
to create the empty recordset from the database.  Another method is to save
a copy of the recordset in a file on the client.  The next time I need to
create an empty recordset, I create it from the local copy and save on a
roundtrip.

I am interested in how fellow developers solve the above issue?  Thanks

Bobx

You can also create a disconnected Recordset which incurs very little overhead.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q184397


Microsoft MVP (Visual Basic)



Tue, 07 Sep 2004 23:11:53 GMT  
 How to create empty recordset
Here is a sample to create a empty recordset without a connection object:

Dim rs As New Recordset

rs.Fields.Append "id", adInteger

rs.Fields.Append "name", adBSTR

rs.Open

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Fri, 10 Sep 2004 17:33:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Create Empty Recordset

2. Creating an empty ADO Recordset

3. How do I create an empty recordset

4. Can you create an empty recordset?

5. Recordset BOF adoEOF indicate that it is empty but it is not empty

6. when recordset is empty

7. Write Empty string to Recordset

8. Empty recordset

9. How to trap empty recordset error 3146?

10. Empty Recordsets?

11. Trapping empty recordsets problem

12. Test if a recordset is empty

 

 
Powered by phpBB® Forum Software