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

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.



Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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

LeighWardleAuthor Commented:
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?




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 

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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.

LeighWardleAuthor Commented:
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!!!!


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.
LeighWardleAuthor Commented:
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
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:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Please finalize this question, open today.
Moondancer - EE Moderator
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
per recommendation

Community Support Moderator @Experts Exchange
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.