Consulting

Results 1 to 4 of 4

Thread: ...and back to XSD

  1. #1
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location

    ...and back to XSD

    Access 2003 incorporates 2 methods to export and import xsd, xml, or both to and from tables. You can use the attached mdb and this code to create an export:
    [vba]
    Sub xsd()
    cXML = ActiveWorkbook.Path & "\employees.xml"
    cXSD = ActiveWorkbook.Path & "\employees.xsd"
    cMDB = ActiveWorkbook.Path & "\sample1.mdb"
    If Dir(cMDB) = "" Then Exit Sub
    If Dir(cXML) <> "" Then Kill cXML
    If Dir(cXSD) <> "" Then Kill cXSD
    cTable = "Employees"
    Set oMDB = CreateObject("Access.Application")
    oMDB.Visible = 1
    oMDB.Application.OpenCurrentDatabase cMDB
    'exports xml and embeds schema
    oMDB.Application.ExportXml ObjectType:=acExportTable, DataSource:=cTable, DataTarget:=cXML, OtherFlags:=1
    'export schema only
    'oMDB.Application.ExportXML ObjectType:=acExportTable,DataSource:=cTable,SchemaTarget:=cXSD
    oMDB.Application.CloseCurrentDatabase
    Set oMDB = Nothing
    End Sub

    [/vba]

    curious though the xsd data types are validated by the namespace and I have wondered if there is a way to code in some interoperability [say to move Access xsd into an SQL Server table] without resort to purchasing a third party product. There is a freeware version of FoxXML, but it is more concerned with validation.

    If anyone comes across any refererence/links to interpreting xsd/xml I would appreciate your posting them. It is easy enough to say "Why go through all the trouble with xsd/xml when you can use transferdatabase() or ado methods?".... and that surely misses the point.

  2. #2
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

    that is pretty useful, but I am unfamiliar at this point.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  3. #3
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    Quote Originally Posted by XLGibbs
    that is pretty useful, but I am unfamiliar at this point.
    Well, if you get a moment look at http://www.sifinfo.org/

    especially the SIF specifications. This is pretty slick stuff, and as a former contractor who worked with the SIMS and SASI systems currently employed in many US Public Schools (which make Cobol look inviting) and some slick marketing to get funding.... there is a need..

    while unemployed in early 2007 I was approached by a small company that provided alert systems for schools (for bomb threats, snow days, and other reasons schools shut down in a hurry) who were thinking they would soon need to import SIF into their callout db. Fortunately for them education efficiency is an oxymoron so they said we'll catch you later... but I have since noticed a lot more xsd references...

    Oh, and I had recently been dowsized again; hence my earlier post on the other forum about the 2 %^&$#ers who tried to take me for a free ride. I subscribe to a couple of other NG's where the 'help me with my homework' and 'help me with my job - for free' are less tolerated... ahh... sorry about the rant

  4. #4
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Quote Originally Posted by stanl

    Oh, and I had recently been dowsized again; hence my earlier post on the other forum about the 2 %^&$#ers who tried to take me for a free ride. I subscribe to a couple of other NG's where the 'help me with my homework' and 'help me with my job - for free' are less tolerated... ahh... sorry about the rant
    no rant apology necessary. It is the reverse of caveat emptor. I would embed "extra features" in code and just not remove them until they paid up anyway.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




Posting Permissions

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