Re: How to create editable recordset without using a database table?



John Dalberg wrote:
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.

Sure. I call it an ad hoc recordset, although many refer to it as a
disconnected recordset (which IMO is a different thing).

Quick example:

const adInteger=3
const advarchar=200
set rs=createobject("adodb.recordset")
with rs.Fields
.Append "col1",adInteger
.Append "col2",advarchar,200
End With
rs.open
rs.AddNew
rs(0)=258
rs(1) = "test"
rs.Update

--
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.


.



Relevant Pages

  • Re: Median calculation
    ... Already answered in another newsgroup to which you posted the same question. ... Dim rs As DAO.Recordset ... 'Open a recordset on the table. ... DMedian = rs ...
    (microsoft.public.access.queries)
  • Re: Access sending data to Word VBA Userform
    ... To get assistance on that, it would be best to ask in an Access newsgroup, ... Doug Robbins - Word MVP ... Dim rs As DAO.Recordset ... ' Set the number of Columns = number of Fields in recordset ...
    (microsoft.public.word.vba.userforms)
  • Re: Binding Data to Forms, Textboxes etc.
    ... I intended to post this to the .net forms newsgroup, and yes I may be mixing ... > Windows applications are a very different animal to Access forms. ... The terms 'Row Source' and 'Recordset' are not used ... >> "A bound form means that you have identified a Row Source for your form. ...
    (microsoft.public.access.formscoding)
  • Re: DSN Less Connection to SQL Server
    ... Simply remove the word "server." ... > ' Use the diconnected recordset here. ... >> Bob Barrows ... >> a quicker response by posting to the newsgroup. ...
    (microsoft.public.scripting.vbscript)
  • Re: ASP Tables + strange stuff
    ... This is the ASP.Net newsgroup. ... > Set objRS = Nothing ... > The actual code invloves alot more columns/rows and the recordset is ... > I felt like I was losing my mind. ...
    (microsoft.public.dotnet.framework.aspnet)