Re: How to create editable recordset without using a database tabl
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Tue, 18 Mar 2008 09:58:51 -0400
Haritha wrote:
I have created a disconnected recordset but I want to insert the
recordset data finally into my sql database table.
I have a table with two columns OrderNumber and EnrolledCourseId. On
the ASP form the user could select mutliple courses. So I am
identifying all the courses selected and inserted them into
disconnected recordset created. But finally I want to insert this
recordset data into my sql table.
Is it possible using Classic ado?
Any help is highly appreciate.
There are two types of recordsets that people tend to call "disconnected":
1. A true disconnected recordset which is opened on a database table or
query and then disconnected by setting its ActiveConnection property to
Nothing. This type of disconnected recordset can subsequently be reconnected
to the database by setting its ActiveConnection property to a variable
referencing an open Connection object. If the recordset was opened using the
adLockUpdateBatch setting, any changes made to the data in the recordset
while disconnected can be sent to the database with a single call to
UpdateBatch.
2. A recordset that is created entirely in code without ever being connected
to a database. I like to refer to this type of recordset as an "ad hoc"
recordset in order to distinguish it from the true disconnected recordset.
Since an ad hoc recordset was never connected to a database, it lacks all
the metadata information that would allow it to be connected to a database.
So, if you want to update a database table with the data in an ad hoc
recordset, you need to loop through the recordset, build the DML statements
needed, and execute them with a connection object.
You would do well to read about these topics in the documentation which can
be found here:
http://msdn2.microsoft.com/en-us/library/ms675532.aspx
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- Prev by Date: Re: How to create editable recordset without using a database tabl
- Next by Date: Fron DataSet to SQL
- Previous by thread: Re: How to create editable recordset without using a database tabl
- Next by thread: Fron DataSet to SQL
- Index(es):
Relevant Pages
|
Loading