Jump to content

pcrist

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About pcrist

  • Rank
    Newbie
  1. I want to append rows from one table to another, however, I want to be able to check a specific row to make sure there aren't duplicates. FirstName LastName VINPeter Smith WDD1Jon Doe WDD2 FirstName LastName VINNAlex Taco WDD3Peter Smith WDD1 For exampled, I'd want to append those two tables together so that it would consist of only three rows (i.e. by not appending the duplicated Peter Smith entry. I'm using this statement as of now: INSERT INTO TableOneSELECT * FROM TableTwo WHERE VIN <> VINN ... However, this asks me to enter a parameter value for VIN. Thanks for any adviec you can give, I'm using SQL within Access.
  2. I just solved my problem with this changed set of code: ' Create SubmissionAuthorDetails element' root.appendChild dom.createTextNode(vbNewLine + vbTab) Set node = dom.createElement("SubmissionAuthorDetails") Set frag = dom.createDocumentFragment frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("EPAManufacturerCode") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorUserID") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorFullName") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorEmailAddress") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorPhoneNumber") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionSubmitterUserID") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) Set indent = dom.createElement("SPD") Set frag_node = dom.createDocumentFragment frag_node.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab + vbTab) frag_node.appendChild dom.createElement("SPK") indent.appendChild frag_node frag.appendChild indent node.appendChild frag root.appendChild node
  3. I need to create a list inside of a list in an xml file such that it looks like this: <?xml version="1.0" encoding="UTF-8" ?><InUseVerificationProgramSubmission xmlns="http://www.exchangen...a/verify/iuvp/1"> <SubmissionAuthorDetails><EPAManufacturerCode>MBX</EPAManufacturerCode><SubmissionAuthorUserID>CETNAR712</SubmissionAuthorUserID><SubmissionAuthorFullName>Mr Charles Cetnar</SubmissionAuthorFullName><SubmissionAuthorEmailAddress>charles.cetnar@daimler.com</SubmissionAuthorEmailAddress><SubmissionAuthorPhoneNumber>7349953066</SubmissionAuthorPhoneNumber><SubmissionSubmitterUserID>CETNAR712</SubmissionSubmitterUserID><SubmissionParameterDetails><SubmissionParameterKey>CARBFileName</SubmissionParameterKey><SubmissionParameterText>MBX_IUVP_20121108093549.xml</SubmissionParameterText></SubmissionParameterDetails></SubmissionAuthorDetails> Here is the code I'm using. Private Function CreateDOM() Dim dom Set dom = New DOMDocument60 dom.async = False dom.validateOnParse = False dom.resolveExternals = False dom.preserveWhiteSpace = True Set CreateDOM = domEnd FunctionPrivate Sub GetDataCB_Click()End SubPrivate Sub ExportXMLCB_Click() Dim dom, node Set dom = CreateDOM ' Create a processing instruction targeted for xml. Set node = dom.createProcessingInstruction("xml", "version='1.0'") dom.appendChild node Set node = Nothing ' Create a processing instruction targeted for xml-stylesheet. Set node = dom.createProcessingInstruction("xml-VERIFY", _ "type='text/xml'") dom.appendChild node Set node = Nothing ' Create a comment for the document. Set node = dom.createComment("XML File Creation for VERIFY data submission.") dom.appendChild node Set node = Nothing ' Create the root element Dim root Set root = dom.createElement("InUseVerificationProgramSubmission") dom.appendChild root ' Create SubmissionAuthorDetails element' root.appendChild dom.createTextNode(vbNewLine + vbTab) Set node = dom.createElement("SubmissionAuthorDetails") Set frag = dom.createDocumentFragment Set indent = dom.createDocumentFragment frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("EPAManufacturerCode") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorUserID") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorFullName") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorEmailAddress") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionAuthorPhoneNumber") frag.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab) frag.appendChild dom.createElement("SubmissionSubmitterUserID") indent.appendChild dom.createTextNode(vbNewLine + vbTab + vbTab + vbTab) indent.appendChild dom.createElement("SubmissionParameterDetails") frag.appendChild indent Set indent = Nothing node.appendChild frag Set frag = Nothing root.appendChild node ' Save the XML document to a file. dom.Save (ThisWorkbook.Path & "\test.xml") Set root = Nothing Set dom = Nothing MsgBox ("XML export complete.")Exit SubEnd Sub
  4. I'm using VBA to export to an XML document using a schema provided by EPA. However, they created a separate schema to declare elements and are 'including' the separate schema into the root schema. The problem is that now Microsoft Excel 2010 has update security settings to the property ResolveExternals such that "in MSXML 6.0, the default setting is False. If this property is set to False, no external includes and imports will be resolved." Link to the ResolveExternals property page:http://msdn.microsof...3(v=vs.85).aspx So now when I'm trying to use the same VBA code, I get an error complaining about undeclared elements because the 'include' is not resolved (because the default setting to ResolveExternals is False). I realize this is more of a Microsoft question but I have gotten no response from any other forum. Maybe someone has had this same issue. I need to know how to set this ResolveExternals property to true such that it will include the element declarations properly... Thanks for your time.
×
×
  • Create New...