Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading XML, updating tables in SQL Server

Posted on 2004-09-21
9
Medium Priority
?
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 

Author Comment

by:Vasi04
ID: 12110748
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
ID: 12111083
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
ID: 12111704
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Vasi04
ID: 12111752
I want VB code. this is NOT homework. I never pay to get my homework done!! :-)
0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 1500 total points
ID: 12111874
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
ID: 12111935
Can some expert help me with code?
0
 

Author Comment

by:Vasi04
ID: 12113669
Dear Experts, please help
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12130478
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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