Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Implement SQLXML Bulk Load using C++

Implement SQLXML Bulk Load using C++

Scheduled Pinned Locked Moved C / C++ / MFC
htmltutorialcsharpc++database
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cmacgowan
    wrote on last edited by
    #1

    Implement SQLXML Bulk Load using C++Implement SQLXML Bulk Load using C++ 01 Dec 2005 Saint Paul, Minnesota macgowan@pobox.com Hi ... I am trying to bulk load xml into sql server. This seems to be a relativly easy thing to do using the SQLXML COM Component. I am having trouble finding documentation on the SQLXML COM Object model. Also I have found samples in C# and VB ... I need my implementation to be using C++. If you have any sample code or a like you can send me to that would be create. A good example of the type of doc that I am looking for is the object model for the MSXML COM Component http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceappservices5/html/wce50grfxmldomobjectsinterfaces.asp Is there such documentation for the SQLXML COM Below are the links I have used to date: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch\_sqlxml.asp http://www.dbazine.com/sql/sql-articles/cook3 http://www.perfectxml.com/sqlxml.asp Some code: The code below uses the IXMLDOMDocument2Ptr interface and then trys to use the SQLXML using the SQLXMLOLEDB Provider. Again, I need some doc or samples on how to use the SQLXML COM Interfaces or the SQLXMLOLEDB Provider in C++. The code will fail on the following line pCmd.CreateInstance(__uuidof(SQLXMLBulkLoad)); void CTestApp::OnTestMsXmlTest() { // Define ADO connection pointers _ConnectionPtr pConnection = NULL; try { CoInitialize(NULL); IXMLDOMDocument2Ptr pXMLDoc = NULL; TCHAR szHTTPURL[MAX_PATH] = {0}; _tcscpy(szHTTPURL, "http://www.buckeyetraffic.org/rwis/data/siteDetailS.xml"); _variant_t varLoadResult((bool)FALSE); // Create MSXML DOM object pXMLDoc.CreateInstance("Msxml2.DOMDocument.4.0"); // Load the document synchronously pXMLDoc->async = false; // If loading the document over HTTP (see KB Q321125 for details) pXMLDoc->setProperty("ServerHTTPRequest", VARIANT_TRUE); // Load the XML document varLoadResult = pXMLDoc->load(szHTTPURL); // Get the xml data csResult =::SysAllocString(pXMLDoc->xml); // ******************** // Test the buld load things // Create the ADO connection pConnection.CreateInstance(__uuidof(Connection)); CString csProvider("sqloledb"); CString csDataSource("SQLTEST1"); CString csInitialCatalog("TestData");

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups