Hi all,
I am needing to learn how to read an MS Access DB
and output it to a XML file.
But I would like to have an output with a default type
just like what I get when I use the export to XML inside
Access, should output for a table be something of this kind(example table calle Element with 3 columns):
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" xmlns:xsi=" xsi:noNamespaceSchemaLocation="Element.xsd">
<Element>
<Element_ref_no>11111-004BOSCH</Element_ref_no>
<Elem_Symb_Type>PUMP</Elem_Symb_Type>
<Element_Manufacturer>BOSCH</Element_Manufacturer>
</Element>
<Element>
<Element_ref_no>7363-CH</Element_ref_no>
<Elem_Symb_Type>ACTUATOR</Elem_Symb_Type>
<Element_Type>linear</Element_Type>
</Element>
</dataroot>
I have already some code but the output
(described below after the code) is of no
use because of the format... I think it
contains also schema...
Well if someone has the source the would yield
an output like above or know how to do it I would
be more than grateful it you could send it to me in
a reply or post here, I will grant it as a VERY
expertise help!
Thanks
Alex ( almarton@task.com.br )
Follows the (useless) code and the output I have:
<%
Dim objConn
Dim objRec
Set objConn = Server.CreateObject ("ADODB.Connection"
Set objRec = Server.CreateObject ("ADODB.Recordset"
objConn.Open "DSN=FMMLProjects"
'PROJECT TABLE
objRec.Open "Project", objConn, 0, 1, 2
Response.Write "<H3> PROJECT TABLE </H3><TABLE BORDER='1'>"
Response.Write "<TR bgcolor=""#999999""><TH>Project_Ref_No</TH><TH>Project_Title</TH><TH>PDate</TH>" _
& "<TH>Author</TH><TH>Company</TH><TH>Project_Description</TH>"
While Not objRec.EOF
Response.Write "<TR>"
Response.Write "<TD>" & objRec("Project_Number" & "</TD>"
Response.Write "<TD>" & objRec("Project_Title" & "</TD>"
Response.Write "<TD>" & objRec("PDate" & "</TD>"
Response.Write "<TD>" & objRec("Author" & "</TD>"
Response.Write "<TD>" & objRec("Company" & "</TD>"
Response.Write "<TD>" & objRec("Project_Description" & "</TD>"
objRec.MoveNext
Response.Write "</TR>"
Wend
Response.Write "</TABLE>"
objRec.Close
objConn.Close
Set objRec = Nothing
Set objConn = Nothing
%>
*********************************************
AND THE OUTPUT:
**********************************************
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='Element_ref_no' rs:number='1' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Elem_Symb_Type' rs:number='2' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Element_Manufacturer' rs:number='3' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Element_Type' rs:number='4' rs:nullable='true' rs:write='true'>
<rs:data>
<z:row Element_ref_no='0111-004BOSCH' Elem_Symb_Type='PUMP' Element_Manufacturer='BOSCH' Element_Type='piston'
Flow='0.0007' Displacement='fixed' Element_OpProperty='air eletric'/>
<z:row Element_ref_no='0233-GF' Elem_Symb_Type='FILTER' Element_Manufacturer='GERF' Element_Type='plastic mesh'
Units='UBASE' Element_OpProperty='oil type determined by part number'/>
<z:row Element_ref_no='1000-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='by-pass'
Element_Subtype='right-left' Units='UBASE'/>
<z:row Element_ref_no='11111-004BOSCH' Elem_Symb_Type='PUMP' Element_Manufacturer='BOSCH' Element_Type='gear'
Units='UBASE' Flow='0.0005' Displacement='fixed' Element_OpProperty='eletric'/>
<z:row Element_ref_no='1637-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='relief'
Action='spring' Units='UBASE' Pressure='20000000' Element_OpProperty='Kg/m*s^2'/>
<z:row Element_ref_no='364673-DMV' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='SYSCO' Element_Type='directional'
Actuation1='air-spring' Actuation2='air-spring' Ports='4' Position='3' Units='UBASE' Element_OpProperty='normal closed'/>
<z:row Element_ref_no='7363-CH' Elem_Symb_Type='ACTUATOR' Element_Type='linear' Element_Subtype='double action'
Units='UBASE' Displacement='.9' DB='.159' DR='.1128' Element_OpProperty='oil'/>
<z:row Element_ref_no='9637-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='pressure'
Element_Subtype='ajustable' Units='UBASE' Pressure='20000000' Element_OpProperty='0 to 40MPa'/>
</rs:data>
</xml>
Alexandre @lmarton Marton
almarton@task.com.br
Alexandre @lmarton Marton
almarton@task.com.br
I am needing to learn how to read an MS Access DB
and output it to a XML file.
But I would like to have an output with a default type
just like what I get when I use the export to XML inside
Access, should output for a table be something of this kind(example table calle Element with 3 columns):
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" xmlns:xsi=" xsi:noNamespaceSchemaLocation="Element.xsd">
<Element>
<Element_ref_no>11111-004BOSCH</Element_ref_no>
<Elem_Symb_Type>PUMP</Elem_Symb_Type>
<Element_Manufacturer>BOSCH</Element_Manufacturer>
</Element>
<Element>
<Element_ref_no>7363-CH</Element_ref_no>
<Elem_Symb_Type>ACTUATOR</Elem_Symb_Type>
<Element_Type>linear</Element_Type>
</Element>
</dataroot>
I have already some code but the output
(described below after the code) is of no
use because of the format... I think it
contains also schema...
Well if someone has the source the would yield
an output like above or know how to do it I would
be more than grateful it you could send it to me in
a reply or post here, I will grant it as a VERY
expertise help!
Thanks
Alex ( almarton@task.com.br )
Follows the (useless) code and the output I have:
<%
Dim objConn
Dim objRec
Set objConn = Server.CreateObject ("ADODB.Connection"
Set objRec = Server.CreateObject ("ADODB.Recordset"
objConn.Open "DSN=FMMLProjects"
'PROJECT TABLE
objRec.Open "Project", objConn, 0, 1, 2
Response.Write "<H3> PROJECT TABLE </H3><TABLE BORDER='1'>"
Response.Write "<TR bgcolor=""#999999""><TH>Project_Ref_No</TH><TH>Project_Title</TH><TH>PDate</TH>" _
& "<TH>Author</TH><TH>Company</TH><TH>Project_Description</TH>"
While Not objRec.EOF
Response.Write "<TR>"
Response.Write "<TD>" & objRec("Project_Number" & "</TD>"
Response.Write "<TD>" & objRec("Project_Title" & "</TD>"
Response.Write "<TD>" & objRec("PDate" & "</TD>"
Response.Write "<TD>" & objRec("Author" & "</TD>"
Response.Write "<TD>" & objRec("Company" & "</TD>"
Response.Write "<TD>" & objRec("Project_Description" & "</TD>"
objRec.MoveNext
Response.Write "</TR>"
Wend
Response.Write "</TABLE>"
objRec.Close
objConn.Close
Set objRec = Nothing
Set objConn = Nothing
%>
*********************************************
AND THE OUTPUT:
**********************************************
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='Element_ref_no' rs:number='1' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Elem_Symb_Type' rs:number='2' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Element_Manufacturer' rs:number='3' rs:nullable='true' rs:write='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='Element_Type' rs:number='4' rs:nullable='true' rs:write='true'>
<rs:data>
<z:row Element_ref_no='0111-004BOSCH' Elem_Symb_Type='PUMP' Element_Manufacturer='BOSCH' Element_Type='piston'
Flow='0.0007' Displacement='fixed' Element_OpProperty='air eletric'/>
<z:row Element_ref_no='0233-GF' Elem_Symb_Type='FILTER' Element_Manufacturer='GERF' Element_Type='plastic mesh'
Units='UBASE' Element_OpProperty='oil type determined by part number'/>
<z:row Element_ref_no='1000-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='by-pass'
Element_Subtype='right-left' Units='UBASE'/>
<z:row Element_ref_no='11111-004BOSCH' Elem_Symb_Type='PUMP' Element_Manufacturer='BOSCH' Element_Type='gear'
Units='UBASE' Flow='0.0005' Displacement='fixed' Element_OpProperty='eletric'/>
<z:row Element_ref_no='1637-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='relief'
Action='spring' Units='UBASE' Pressure='20000000' Element_OpProperty='Kg/m*s^2'/>
<z:row Element_ref_no='364673-DMV' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='SYSCO' Element_Type='directional'
Actuation1='air-spring' Actuation2='air-spring' Ports='4' Position='3' Units='UBASE' Element_OpProperty='normal closed'/>
<z:row Element_ref_no='7363-CH' Elem_Symb_Type='ACTUATOR' Element_Type='linear' Element_Subtype='double action'
Units='UBASE' Displacement='.9' DB='.159' DR='.1128' Element_OpProperty='oil'/>
<z:row Element_ref_no='9637-CVBOSCH' Elem_Symb_Type='CONTROL_VALVE' Element_Manufacturer='BOSCH' Element_Type='pressure'
Element_Subtype='ajustable' Units='UBASE' Pressure='20000000' Element_OpProperty='0 to 40MPa'/>
</rs:data>
</xml>
Alexandre @lmarton Marton
almarton@task.com.br
Alexandre @lmarton Marton
almarton@task.com.br