dbTalk Databases Forums  

SQL Server (XML Data) Through ODBC to MS Access

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss SQL Server (XML Data) Through ODBC to MS Access in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SVCitian
 
Posts: n/a

Default SQL Server (XML Data) Through ODBC to MS Access - 12-09-2009 , 07:46 AM






Hello,

In one database in my company.

Previously the data in SQL Server, the tables were simple text and
number formats and it was easy for me to link the data through ODBC to
MS Access and I could do all sorts of queries and calculations, etc.

But, now (after several months) I realize that the DBA and Programmer
changed, the data in SQL Server to be XML Data Type in the new setup.

In SQL Server.

dbo.FlightDocuments Table

docID, int
docInfo, xml
docLogs, xml
and so on.

and I see the data in Access (through ODBC) for one of the fields of
the above table like this:

<Cargo><Local><Mawb>1</Mawb><Hawb>0</Hawb><Weight>139</
Weight><Pcs>14</
Pcs></Local><Transit><Mawb>2</Mawb><Hawb>0</Hawb><Weight>3457</
Weight><Pcs>161</Pcs></Transit><BUP><Local><MDP><Mawb>0</
Mawb><Hawb>0</
Hawb><Weight>0</Weight><Pcs>0</Pcs><Unit>0</Unit></MDP><LDP><Mawb>0</
Mawb><Hawb>0</Hawb><Weight>0</Weight><Pcs>0</Pcs><Unit>0</Unit></
LDP><LD3><Mawb>0</Mawb><Hawb>0</Hawb><Weight>0</Weight><Pcs>0</
Pcs><Unit>0</Unit></LD3></Local><Transit><MDP><Mawb>0</Mawb><Hawb>0</
Hawb><Weight>0</Weight><Pcs>0</Pcs><Unit>0</Unit></MDP><LDP><Mawb>0</
Mawb><Hawb>0</Hawb><Weight>0</Weight><Pcs>0</Pcs><Unit>0</Unit></
LDP><LD3><Mawb>0</Mawb><Hawb>0</Hawb><Weight>0</Weight><Pcs>0</
Pcs><Unit>0</Unit></LD3></Transit></BUP></Cargo>

In fact, every field looks like above but with different xml tags of
course.

I don't know how to manipulate it using Access Query.

Yes.. I may use perl or some other scripts to extract the data after
exporting it to a text file or something... But, I think there should
be a simpler way.

Is there a simpler way where I can use all this data like I was always
used to:

Select * from FlightDocuments Where ***something here***

ID, MawbWeight, HawbWeight, MawbPcs, HawbPcs...
931, 160, 230, 23, 120
and so on

And, all the data is magically transformed to a readable view.

Please help.

Reply With Quote
  #2  
Old   
Stefan Hoffmann
 
Posts: n/a

Default Re: SQL Server (XML Data) Through ODBC to MS Access - 12-14-2009 , 01:02 AM






hi,

On 09.12.2009 14:46, SVCitian wrote:
Quote:
Yes.. I may use perl or some other scripts to extract the data after
exporting it to a text file or something... But, I think there should
be a simpler way.

Is there a simpler way where I can use all this data like I was always
used to:

Select * from FlightDocuments Where ***something here***
Yes, you may use a view on the SQL Server parsing the XML (reading the
data):

http://technet.microsoft.com/en-us/l.../ms190798.aspx

For editing you may use an INSTEAD OF UPDATE trigger on this view or a
stored procedure.


mfG
--> stefan <--

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.