[AccessD] XML Import Sample File

Shamil Salakhetdinov shamil at users.mns.ru
Tue Nov 28 10:18:20 CST 2006


Hello Greg,

It works well here with MSXML v.6.0 - data are imported:

Public Function Parse(ByVal vstrURL As String, ByVal vstrTableName As
String, ByVal vavarFields As Variant)
Dim reader As SAXXMLReader60 '30
    mavarFields = vavarFields
    mstrTableName = vstrTableName
    mintFieldIndex = -1
    mintFieldsCount = 0
    Set reader = New SAXXMLReader60 '30
    Set reader.contentHandler = Me
    Set reader.errorHandler = Me
    reader.parseURL vstrURL
End Function

I have no clear idea why it doesn't work there on you PC.
Try to put breakpoints and debug/trace it...

--
Shamil
 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Greg Smith
Sent: Tuesday, November 28, 2006 6:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] XML Import Sample File

Shamil:

That is where the issue was.  I changed the SAXXMLReader40 to
SAXXMLReader60 in both places and now it runs without error.  HOWEVER, it
does not do anything.  The table remains empty...nothing is imported. 
Samples 1 & 2 both import from the text files, but neither 3 nor 4 import
anything.  The table, if it has any contents, the contents are deleted and
the table stays empty.

Maybe SAXXMLReader60 will not work?

Thanks!

Greg


=============================
Greg,

I did try sample code with MSXML 6.0 and it worked OK.

Try to debug/trace this function:

My guess the problem is in this function:

Public Function Parse(ByVal vstrURL As String, ByVal vstrTableName As
String, ByVal vavarFields As Variant)
Dim reader As SAXXMLReader40
    mavarFields = vavarFields
    mstrTableName = vstrTableName
    mintFieldIndex = -1
    mintFieldsCount = 0
    Set reader = New SAXXMLReader40
    Set reader.contentHandler = Me
    Set reader.errorHandler = Me
    reader.parseURL vstrURL
End Function

--
Shamil

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Greg Smith
Sent: Tuesday, November 28, 2006 12:54 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] [Access-D] XML Import Sample File

Hi Shamil:

I'm currently set at MSXML 6 (MSXML6.dll).

Greg

> Hello Greg,
>
> Try to change reference to MSXML v.4.0 or above....
>
> --
> Shamil
<snip>

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list