Solved

Reading XML, updating tables in SQL Server

Posted on 2004-09-21
9
264 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
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
 

Author Comment

by:Vasi04
ID: 12111752
I want VB code. this is NOT homework. I never pay to get my homework done!! :-)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Accepted Solution

by:
Rejojohny earned 500 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
 

Author Comment

by:Vasi04
ID: 12116035
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 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

18 Experts available now in Live!

Get 1:1 Help Now