Need library to import/export XML from VB 6.0 app that uses DAO databases in .mdb format

Posted on 2002-04-21
Last Modified: 2012-05-04
Hi all,

Our requirement in the short term is to be able to import/export XML from our Visual Basic 6.0 applications (which use DAO interfaces to databases in .mdb format)
I don't want to write much code- I would like some sort of library that does most of the grunt work.

I have done quite a bit of searching on the web for a commercial strength product.
So far I have found:

1.  DbTkXml

This has a C++ API.  The standalone app seems to work OK.
I have asked the vendor if he has any VB 6.0 sample code.

2. WinAllora, WinAllora Express

I have only just seen a press release on WinAllora Express (US$199) and it sounds promising.
I have applied for an evaluation copy.

Any further suggestions would be much appreciated.



Question by:LeighWardle
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3

Expert Comment

ID: 6959093

microsoft has its own XML library nad parser... currently latest version of that is available is 4..  search for MSXML4 on microsoft website or google

following link may help... i m not sure.. but it should

i think the below link is what u r looking for... 


Author Comment

ID: 6959138
nachiket, thanks for your suggestions.

I really want a library or componet that will automatically initiate an import or export at the Table level, simply by specifying the .mdb file name, Table or Query name and the .XML file name.  

I do not want to write code to handle each field in the table/query/XML file.

Would MSXML4 offer this?



Expert Comment

ID: 6959169


i don't know really will it help or not... y don't u download the whole SDK around 5 mb... it has excellent help file assoiciated with that... if microsoft provides n e help with this( if it is related to XML) this SDK will have it... and i guess if ur application is very obvious microsoft must have provided!! so better u check the documentation ur self

again this link might help u d/ling the SDK 

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

LVL 18

Expert Comment

ID: 6960972
before you give up on nachiket's idea, here are some specifics.

If you have the option of switching to ADO instead of DAO, then, it's possible to Save a Recordset to a Microsoft DOM document using the Recordset SAVE method (you actually might be able to save straight out to a file with this method, but I've always done it through the DOM).  Then, the DOM object has a .XML property that you can manually write out to a file if you want, or it also might have a .SAVE method to save to the file.  So, with just a few lines of code you can do this.

Dim Conn As ADODB.Connection
Dim Cmd As ADODB.Command
Dim Dom As MSXML2.DOMDocument
Const MY_DATABASE = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=H:\Code\MY.mdb"

Private Sub Form_Load()
Set Conn = New ADODB.Connection
With Conn
    .ConnectionString = MY_DATABASE
    .CursorLocation = adUseClient
End With

End Sub

Private Sub cmdExport_Click()
     ExportTable "Employees", "C:\Temp\Emp.xml"
End Sub

Private Sub ExportTable(sTableName as String, sFileName as string)
Dim sSQL As String
Dim fHandle As Long

    sSQL = "SELECT * FROM " & sTableName

If Conn.State = adStateOpen Then
    Set Cmd = New ADODB.Command
    With Cmd
        .ActiveConnection = Conn
        .CommandType = adCmdText
        .CommandText = sSQL
    End With
    Set RS = Cmd.Execute
    If RS.State = adStateOpen Then
        Set Dom = New DOMDocument Dom, adPersistXML sFileName
    End If
End If

Set RS = Nothing
Set Cmd = Nothing
Set Dom = Nothing

End Sub

To get this sample to work, you'd have to reference the Microsoft Active Data Objects 2.5 (or better) object library, and the Microsoft XML, 3.0 (or better) parser.

You can download the parser for free from Microsoft.


Author Comment

ID: 6970271
Thanks, mdougan, for your suggestion.

Is there anything analogous that will read XML into an ADO dataset?

By the way I have been experimenting with VB.NET- have been able to do the XML import/export stuff with just one line of code for each!!!!


LVL 18

Expert Comment

ID: 6970447
I've seen code where a recordset can Load data from an XML file, after specifying some sort of provider for reading text files... looks a little kludgey, but there may be a way to read into a DOM and then streaming into a recordset from there, which is a little cleaner maybe.

Author Comment

ID: 6970474
Thanks, mdougan, for your suggestion.
Any chance you can point me to the code where a recordset can Load data from an XML file?

Regards, Leigh
LVL 18

Accepted Solution

mdougan earned 200 total points
ID: 6971472
Actually, it might be simpler than I was thinking.  You don't have to use a DOM object (we were using DOM objects to manage the data in XML form)

objRecordset.Save "C:\Myfile.xml", adPersistXML
Set objRecordset = Nothing
objRecordset.Open "C:\Myfile.xml"

Here are some links:


Expert Comment

ID: 7080001
Please finalize this question, open today.
Moondancer - EE Moderator
LVL 49

Expert Comment

ID: 7660629
Hi LeighWardle,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept mdougan's comment(s) as an answer.

LeighWardle, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7755344
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month5 days, 3 hours left to enroll

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question