Re: How to create editable recordset without using a database tabl
- From: Haritha <Haritha@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Mar 2008 03:38:00 -0700
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.
Thanks
"ekkehard.horner" wrote:
John Dalberg schrieb:.
Is there a way to create a dataset in VBScript without doing a query to a
real table? Can I define the recordset's fields and types through vbscript
only?
I want to use the recordset for memory use only. I can't use database
tables or xml files.
The record set needs to be editable.
John Dalberg
If "dataset" doesn't imply .NET, you can use a "disconnected recordset"
(Classic ADO). This sample code (using such a recordset to sort an array)
Sub sortLinesAdo( aLines )
Const adVarWChar = 202 ' 000000CA
Dim oRS : Set oRS = CreateObject( "ADODB.Recordset" )
Dim nIdx
oRS.Fields.Append "Fld0", adVarWChar, 2000
oRS.Open
For nIdx = 0 To UBound( aLines )
oRS.AddNew
oRS.Fields( 0 ).value = aLines( nIdx )
oRS.UpDate
Next
If Not (oRS.BOF Or oRS.EOF) Then
oRS.Sort = "Fld0"
nIdx = 0
oRS.MoveFirst
Do Until oRS.EOF
aLines( nIdx ) = oRS( "Fld0" ).value
nIdx = nIdx + 1
oRS.MoveNext
Loop
End If
End Sub
shows some important actions that can be done to such a beast. Whether
it will be good for you, depends on what you want to achieve.
- Follow-Ups:
- Re: How to create editable recordset without using a database tabl
- From: Bob Barrows [MVP]
- Re: How to create editable recordset without using a database tabl
- Prev by Date: Re: Filter Property with ADO, VB6 and SQL extremely slow
- Next by Date: Re: How to create editable recordset without using a database tabl
- Previous by thread: Re: Filter Property with ADO, VB6 and SQL extremely slow
- Next by thread: Re: How to create editable recordset without using a database tabl
- Index(es):
Relevant Pages
|
|