Solved

Reading XML, updating tables in SQL Server

Posted on 2004-09-21
9
262 Views
Last Modified: 2013-11-23
Hi
I want urgent help with VB6 code.

Heres the scenario:
I have an application. From application API I can define an interface to my VB DLL (for example: myDLL.myClass.myfunction)
From my application, I can select table and its columns to be used by myDLL
The data is exchanged in XML format.

I want to read this XML file/data into my function - Public Function myFunction(sXML As String) As Variant
This function,
-  reads XML file for tablename, column ID and corresponding column data - i.e
-  connect to SQL Server7.0
-  deletes the existing data in table in SQL Server using column ID info from XML
-  then updates same table with new data read from XML file

I have installed MSXML4.0
I need your help to create DLL, register and compile it

I am willing to start a new thread as and when required so that expert who is helping me gets as many point as possible!
0
Comment
Question by:Vasi04
  • 6
  • 3
9 Comments
 

Author Comment

by:Vasi04
Comment Utility
Tablename: Article
Column names:
ID, VT_VERSION, REFINANZIERBAR, SACHNR, ARTICLENAME, SERIALNO, TRANSFERPRICE, ANZHAL, TRANSFER_SUPP_MENGE, LISTPREIS_MENGE, ART_ANGEBOTSPREIS, ART_ANGEB_ABLOESE,                  
SERV_GRUNDBETRAG, REFERENZ_KENNZEICHEN
0
 

Author Comment

by:Vasi04
Comment Utility
XML format:

<XML>
<DataCache USerid = "userid" username = "username">
<tablename1>
<columnname>colum value</columnname>
<columnname>colum value</columnname>
...
..
</tablename1>
<tablename2>
<columnname>colum value</columnname>
<columnname>colum value</columnname>
...
..
</tablename2>
...
..
</DataCache>
</XML>
0
 
LVL 26

Expert Comment

by:Rejojohny
Comment Utility
is this homework .. or have u tried writing some code and is stuck at some place?

read MSDN on how to load an XML file into XMLDOM and how to query using xpath ...

something like
Public Function myFunction(sXML As String) As Variant
Dim xmlDoc
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = false
xmlDoc.loadxml(sXML)
...loop through the nodes and construct the SQL string ...
0
 

Author Comment

by:Vasi04
Comment Utility
I want VB code. this is NOT homework. I never pay to get my homework done!! :-)
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 total points
Comment Utility
y i asked that was because normally someone would post a question here only when they have already tried something and require help when they get some error which he/she is not able to solve. In ur case, u have asked for the complete code .. i do not think any expert might have the time to write the complete code for you .. anyway u might be lucky and get someone to do it ... all the best ...

sorry i posted the wrong solution ... try this ...

just add the refrence to "Microsoft xml" in ur project

 Dim xmlDoc As New MSXML2.DOMDocument40
xmlDoc.async = false
xmlDoc.loadxml(sXML)
set lobjRootNode = lobjXMLDoc.documentElement


loop through the "lobjRootNode" object to create the SQL string ...



0
 

Author Comment

by:Vasi04
Comment Utility
Can some expert help me with code?
0
 

Author Comment

by:Vasi04
Comment Utility
Dear Experts, please help
0
 

Author Comment

by:Vasi04
Comment Utility
0
 
LVL 26

Expert Comment

by:Rejojohny
Comment Utility
thx for the points .. but as i mentioned noone might like to spend time writing the complete code for u .. even i take time out my work to comment in EE just for brushing up on my skills and also to help anyone who might be in trouble coding .. but spending time writing the complete code .. if i had the time, i would have done it .. as u have mentioned in the other post, u could get the answer in the net .. try some of those out and come back with specific questions ...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now