In addition to John's suggestions, an alternative that may be worth
investigating is that ADO can save a recordset as an XML file, or open a
recordset from an XML file or ADO Stream object. You're likely to have to
use XSLT to transform between the ADO schema and the schema of whatever
application you're sharing data with, though.
Public Sub SaveRecordset()
Dim rst As New ADODB.Recordset
With rst
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.Open "SELECT CategoryID, CategoryName, Description FROM Categories"
.ActiveConnection = Nothing
'After running this procedure once, you'll need to uncomment the
following commented
'lines, or manually delete the Categories.xml file, if you want to
run it again.
'On Error Resume Next
'Kill CurrentProject.Path & "\Categories.xml"
'On Error GoTo 0
.Save CurrentProject.Path & "\Categories.xml", adPersistXML
.Close
End With
End Sub
Public Sub CountRecords()
Dim rst As New ADODB.Recordset
rst.Open CurrentProject.Path & "\Categories.xml"
Debug.Print rst.RecordCount
rst.Close
End Sub
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.