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
http://www.profsoftware.com/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

http://www.hitsw.com

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.

Regards

Leigh

LVL 1
LeighWardleAsked:
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.

nachiketCommented:
hi

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

http://go.microsoft.com/fwlink/?LinkId=3999

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

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/766/msdncompositedoc.xml 

nachiket
0
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?

Regards

Leigh
0
nachiketCommented:
LeighWardle

well

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

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/766/msdncompositedoc.xml 

nachiket
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mdouganCommented:
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
    .Open
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
        RS.save Dom, adPersistXML
        Dom.save sFileName
    End If
End If

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

0
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!!!!

Regards

Leigh
0
mdouganCommented:
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.
0
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
0
mdouganCommented:
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
objRecordset.Close
Set objRecordset = Nothing
...
objRecordset.Open "C:\Myfile.xml"

Here are some links:
http://www.vbxml.com/xml/guides/developers/ado_persist_xml.asp

http://www.devguru.com/Technologies/ado/quickref/recordset_save.html

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdconpersistdata.asp

0

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
MoondancerCommented:
Please finalize this question, open today.
Thanks,
Moondancer - EE Moderator
0
DanRollinsCommented:
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
0
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.