MS Access XML with CF....

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default MS Access XML with CF....

    A user has an access database that they want to export an xml file out of, and
    through cf, upload the file and have the contents inserted into the sql server
    db. No problem, I know how to do this. The problem is that the xml elements are
    not consistent. For example, if the contact field is null in one of the
    records, then the xml file doesn't generate <Contact></Contact>. It drops it
    altogether. So, how can this be cared for in CF? Code such as: <cfoutput>
    <tr> <td>#mydoc.dataroot.tblMfgReps_Web.Region[1].XmlText#</td>
    <td>#mydoc.dataroot.tblMfgReps_Web.Company[1].XmlText#</td>
    <td>#mydoc.dataroot.tblMfgReps_Web.Contact[1].XmlText#</td> </tr>
    </cfoutput> will not work. It throws this error: The index of a child element
    is out of range. There are only '1' children under this node. Therefore
    index '2' is out of the allowed range [1-1]. Text Any ideas? Thanks, Gary

    ghoukster Guest

  2. Similar Questions and Discussions

    1. Web Service + Anon Access, but getting 401 Access Denied Error
      I have a simple webservice that just returns a string. The security for this is set to windows authentication in IIS (XP Professional) and anonymous...
    2. Network File access using anonymous access
      I have seen a number of entries related to accessing remote resources (files in my case) that need to reside on a remote server. We must leave our...
    3. Access 2002 PDFWriter VBA Code w/WinXP does not work like Access 2000
      I am trying to print an Access 2002 report (Windows XP OS) as a PDF. I had success with Access 2000 in a Windows 2000 environment, but as soon as I...
    4. Access Violation when using Visual Interdev to access Oracle
      I am running Windows 200 Pro, IIS 5.0 and trying to connect to an Oracle 8.1 database. Prior to applying a security patch to W2k, the ASP...
    5. Access denied when creating Access application object
      In an ASP file I am running the following in VBScript in order to extract data from an Access 2002 MDB file which is physically located in the...
  3. #2

    Default Re: MS Access XML with CF....

    Gary -

    I have only read the CF 6 documentation on XML data. I thought there is a
    tag or function to read XML data. Is that row's Contact information NULL? If
    yes, then at least you have a placeholder for your Contact column in that
    row. Otherwise, it sounds like your code needs to check for the existence of
    each column in each row. Maybe someone has a better solution.

    -brian

    "ghoukster" <gary@garyhouk.com> wrote in message
    news:d1fks6$6k9$1@forums.macromedia.com...
    > A user has an access database that they want to export an xml file out of,
    and
    > through cf, upload the file and have the contents inserted into the sql
    server
    > db. No problem, I know how to do this. The problem is that the xml
    elements are
    > not consistent. For example, if the contact field is null in one of the
    > records, then the xml file doesn't generate <Contact></Contact>. It drops
    it
    > altogether. So, how can this be cared for in CF? Code such as: <cfoutput>
    > <tr> <td>#mydoc.dataroot.tblMfgReps_Web.Region[1].XmlText#</td>
    > <td>#mydoc.dataroot.tblMfgReps_Web.Company[1].XmlText#</td>
    > <td>#mydoc.dataroot.tblMfgReps_Web.Contact[1].XmlText#</td> </tr>
    > </cfoutput> will not work. It throws this error: The index of a child
    element
    > is out of range. There are only '1' children under this node. Therefore
    > index '2' is out of the allowed range [1-1]. Text Any ideas? Thanks,
    Gary
    >

    Brian Hogue Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139