Re: adodb.recordset.save and back

From: Peter Plumber (klempner_at_gmxdot.net)
Date: 02/24/04


Date: Tue, 24 Feb 2004 14:28:58 +0100

Hi again,

could anyone please at least tell me that it is no magic function for:

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=db1.mdb"
cn.Open

rs.Open Source:="tblUser.xml", Options:=adCmdFile

magic_function rs, cn ' writes the rs to the datasource opened with cn

rs.Close
cn.Close

this is part of my "Not_So_Magic_Function":

    Do Until rsSrc.EOF
        rsDst.AddNew

        For Each fld In rsSrc.Fields
            rsDst.Fields(fld.Name).Value = fld.Value
        Next fld

        rsDst.UpdateBatch adAffectCurrent

        rsSrc.MoveNext
    Loop

    this works but is rather slow compared to
    rs.Save "tblUser.xml", adPersistXML

thx

Peter

"Peter Plumber" <Klempner@gmxdot.net> schrieb im Newsbeitrag
news:eGc15yY#DHA.2524@TK2MSFTNGP11.phx.gbl...
> This is what I have:
>
> Dim cn As New ADODB.Connection
> Dim rs As New ADODB.Recordset
>
> cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=db1.mdb"
> cn.Open
> rs.Open "SELECT * FROM tblData", cn
> rs.Save "tblUser.xml", adPersistXML
> rs.Close
> cn.Close
>
> and a very nice "tblUser.xml"-file with all the data from tblData
>
> is there a fast way to get the data back from the xml-file into the table



Relevant Pages

  • Re: VB 6.0 to Launch excel
    ... Jason V ... "Peter T" wrote: ... Dim xlapp As Excel.Application 'The Excel application object ...
    (microsoft.public.excel.programming)
  • Re: Re: Problem by sendig a fax
    ... Sorry Peter, I think I'm helpless here unless I can repro the problem ... But I don't have ASP expertise. ... > Dim A2kApp ... > - acting with the faxserver over an office component?? ...
    (microsoft.public.win2000.fax)
  • Re: Making a fax merge
    ... Thanks again for the help Peter. ... > for each record in the data source) you could try the following macro. ... > Dim bFaxServerAvailable As Boolean ... > Set oFaxPorts = Nothing ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Copy and Paste Charts as Picture in Different Workbook
    ... Peter, ... Sub CopyChartsToPictures(wsSource As Worksheet, wsDest As Worksheet) ... containing charts. ... Dim chtObj As ChartObject ...
    (microsoft.public.excel.programming)
  • Re: Help with Postal Code VBA macro (Peter Jamieson)
    ... Thanks Peter for postnng the entire macro. ... Here'sthe code with the oMMMD stuff inserted. ... > Dim oFileSystemObject As Scripting.FileSystemObject ... > Exit Sub ...
    (microsoft.public.word.mailmerge.fields)