Re: How to create editable recordset without using a database tabl



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.

.



Relevant Pages

  • Null
    ... In my vb code I return a recordset from a sql database. ... recordset contains a variety of fields with varing data types. ... My client now wants to import that text file into their own SQL database. ...
    (microsoft.public.vb.syntax)
  • Recordset or Object is closed HELP PLEASE!
    ... I am qeurying the SQL database from Excel but I ... I am getting this stubborn error anytime I try to do ... I don't understand why this recordset is closed no matter ... Set adoCn = New ADODB.Connection ...
    (microsoft.public.sqlserver.programming)
  • Re: Recordset or Object is closed HELP PLEASE!
    ... I am qeurying the SQL database from Excel but I ... > I don't understand why this recordset is closed no matter ... > Set adoCn = New ADODB.Connection ... > MsgBox adoRs.State ...
    (microsoft.public.sqlserver.programming)
  • Re: Selecting record to edit using ADO
    ... Microsoft MVP [Windows] ... "Ken Valenti" wrote: ... |I am using ADO to edit data in a SQL database. ... | Using "Find" on the recordset works, ...
    (microsoft.public.excel.programming)
  • Just connect to a SQL table, and pull some data!
    ... It use to be so easy in ASP, but now in ASP.NET i'm lost and confused. ... I'm trying to connect to a SQL database, open a table via a SQL string. ... take the returning recordset and do what I want to it: pull two fields, ... all fields, loop through the recordset, etc. ...
    (microsoft.public.dotnet.framework.aspnet)