Re: What's the best way to open a recordset for insert only?
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 8 Apr 2008 17:30:52 -0400
I should have added that you could close that connection while the
recordset was disconnected, and then reopen it just before reconnecting
it.
Spencer wrote:
Just in case you were wondering, the application is now inserting
3000-4000 records in the test environment per tick of the progress
bar/call to BatchUpdate. Setting rs.ActiveConnection to Nothing
between batches doesn't seem to improve that significantly.
"Bob Barrows [MVP]" wrote:
Spencer wrote:
So it was a failed experiment, and it looks like I'll have to use
the recordset. But I'm wondering if there's a way to open the
recordset so that I can call AddNew on it, but doesn't query the
entire table first.
Use a disconnected recordset opened using a sql query that includes
"WHERE 1=2"
rs.CursorLocation = adUseClient
m_rsname = "select <fields> from " & m_rsname & " WHERE 1=2"
rs.Open m_rsname, m_conn, , adLockBatchOptimistic, adCmdText
Set rs.ActiveConnection = Nothing
'add your records, then
Set rs.ActiveConnection = m_conn
rs.UpdateBatch
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- References:
- What's the best way to open a recordset for insert only?
- From: Spencer
- Re: What's the best way to open a recordset for insert only?
- From: Bob Barrows [MVP]
- Re: What's the best way to open a recordset for insert only?
- From: Spencer
- What's the best way to open a recordset for insert only?
- Prev by Date: Re: What's the best way to open a recordset for insert only?
- Next by Date: How to catch a zero net change in a DataSet before Adapter Update?
- Previous by thread: Re: What's the best way to open a recordset for insert only?
- Next by thread: Re: What's the best way to open a recordset for insert only?
- Index(es):
Relevant Pages
|
|