473,698 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export Access query as XML and read into dotnet DataSet??

Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O
Nov 20 '05 #1
8 1292
Why don't you just query Access directly from .NET?
Why go through the step of exporting to XML, then trying to read it in?

what are you really trying to accomplish?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O

Nov 20 '05 #2
You best best is to use ADO.NET to connect to Access rather than use its XML
file. In the future, this may be different, but the Access format is not the
same as the DataSet format of XML.

If you have to move from Access to DataSet, I would look at creating a XSLT
stylesheet and transforming to the DataSet XML using it. This is a much more
reuseable method of conversion. Not sure if anyone has already tackled this
monster, so I would do a search before writing it myself.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O

Nov 20 '05 #3
Cor
Hi Mojo,

In addition to the other messages, when you want to use your access direct,
you can of course connect direct.

But when you want to use it as an export file I think that if you cannot
read an XML as a dataset you can always convert it using the XMLreader or
the LoadXML (the document object model).

A dataset is not that difficult to make although as it sometimes look.

Dim ds As New DataSet
Dim dt As New DataTable("Acti ve")
dt.Columns.Add( New DataColumn("Str ing", Type.GetType("S ystem.String")) )
dt.Columns.Add( New DataColumn("Ide nt", Type.GetType("S ystem.Int32")))
Dim keys(0) As DataColumn
keys(0) = dt.Columns("Ide nt")
dt.PrimaryKey = keys
ds.Tables.Add(d t)

I hope this helps?

Cor
Nov 20 '05 #4
Hi Dino,

I'm creating a program that will accept data from several sources
(Access, Excel and so on).

So I want to use common interface to accept these sources.

Therefor I need to be able to easily read the XML file from access.

M O J O

Dino Chiesa [Microsoft] wrote:
Why don't you just query Access directly from .NET?
Why go through the step of exporting to XML, then trying to read it in?

what are you really trying to accomplish?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O



Nov 20 '05 #5
Please see my answer to Dino.

XSLT? I can hardly spell it! :o)

I just wanted it to be easy.

M O J O

Cowboy (Gregory A. Beamer) wrote:
You best best is to use ADO.NET to connect to Access rather than use its XML
file. In the future, this may be different, but the Access format is not the
same as the DataSet format of XML.

If you have to move from Access to DataSet, I would look at creating a XSLT
stylesheet and transforming to the DataSet XML using it. This is a much more
reuseable method of conversion. Not sure if anyone has already tackled this
monster, so I would do a search before writing it myself.


Nov 20 '05 #6
Access and Excel can both be queried via ADO.NET - using connection strings,
if I am not mistaken. this will get you a dataset, without having to first
"export to XML".

What's the "and so on"?

ADO.NET can do CSV, SQL server, other databases... ?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
news:OI******** ******@TK2MSFTN GP11.phx.gbl...
Hi Dino,

I'm creating a program that will accept data from several sources
(Access, Excel and so on).

So I want to use common interface to accept these sources.

Therefor I need to be able to easily read the XML file from access.

M O J O

Dino Chiesa [Microsoft] wrote:
Why don't you just query Access directly from .NET?
Why go through the step of exporting to XML, then trying to read it in?

what are you really trying to accomplish?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O


Nov 20 '05 #7
Access and Excel can both be queried via ADO.NET - using connection strings,
if I am not mistaken. this will get you a dataset, without having to first
"export to XML".

What's the "and so on"?

ADO.NET can do CSV, SQL server, other databases... ?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
news:OI******** ******@TK2MSFTN GP11.phx.gbl...
Hi Dino,

I'm creating a program that will accept data from several sources
(Access, Excel and so on).

So I want to use common interface to accept these sources.

Therefor I need to be able to easily read the XML file from access.

M O J O

Dino Chiesa [Microsoft] wrote:
Why don't you just query Access directly from .NET?
Why go through the step of exporting to XML, then trying to read it in?

what are you really trying to accomplish?

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi,

(I'm new to XML)

I can export data from Access as an XML file (with schema integrated in
the XML file). I can read it into a DotNet DataSet, but the schema is
not correct that is - I do not get the right columns.

Is there some kinda trick to convert the XML to a
DotNet-DataSet-readbable file??

Thanks!

M O J O


Nov 20 '05 #8
On Thu, 11 Dec 2003 20:05:06 +0100, M O J O <mojo@_no_spam_ delete_this_new websolutions.dk > wrote:

¤ Hi Dino,
¤
¤ I'm creating a program that will accept data from several sources
¤ (Access, Excel and so on).
¤
¤ So I want to use common interface to accept these sources.
¤
¤ Therefor I need to be able to easily read the XML file from access.
¤
¤ M O J O
¤
¤ Dino Chiesa [Microsoft] wrote:
¤ > Why don't you just query Access directly from .NET?
¤ > Why go through the step of exporting to XML, then trying to read it in?
¤ >
¤ > what are you really trying to accomplish?
¤ >
¤ > "M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message
¤ > news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
¤ >
¤ >>Hi,
¤ >>
¤ >>(I'm new to XML)
¤ >>
¤ >>I can export data from Access as an XML file (with schema integrated in
¤ >>the XML file). I can read it into a DotNet DataSet, but the schema is
¤ >>not correct that is - I do not get the right columns.
¤ >>
¤ >>Is there some kinda trick to convert the XML to a
¤ >>DotNet-DataSet-readbable file??
¤ >>

I don't see the need for ADO here. Access, Excel, dBase, etc can all be queried directly from
ADO.NET (with the ODBC and OLEDB namespaces) using the same ODBC and OLEDB connections that are used
under ADO.
Paul ~~~ pc******@amerit ech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
3187
by: Relaxin | last post by:
It is just me or has MS created some of the worst ways to access and display data? You can use a DataSet, but if you want to sort or filter the data to must use a DataView which is created from a DataSet. But, if you sort by using the Grid (clicking the header) you can no longer use the DataSet (or maybe the DataView, if that is what you are using) to locate the record that the user has selected!!
9
6771
by: M O J O | last post by:
Hi, (I'm new to XML) I can export data from Access as an XML file (with schema integrated in the XML file). I can read it into a DotNet DataSet, but the schema is not correct that is - I do not get the right columns. Is there some kinda trick to convert the XML to a DotNet-DataSet-readbable file??
1
6594
by: Charlie | last post by:
Hello, I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML tables/files to reduce download time and bandwidth usage on my web server. That way, the user can select a particular page to download instead of downloading a page with all of the records. I would like to set a limit of only 500 records per file.
4
33465
by: Hans [DiaGraphIT] | last post by:
Hi! I want to export a dataset to an excel file. I found following code on the net... ( http://www.codeproject.com/csharp/Export.asp ) Excel.ApplicationClass excel = new ApplicationClass(); excel.Application.Workbooks.Add(true); DataTable table = DATASETNAME.Tables;
3
4628
by: BobAchgill | last post by:
I am trying to read in a xml file that I exported from my MSAccess table using the following lines of code but it bombs. Is this the right code? Is there a way to get a clean export from Access so the XML file will read in OK into a VB .Net Form dataset? =============================== Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
9
3444
by: dennist685 | last post by:
I created a web project named 'Access' in C:\Inetpub\wwwroot\Access and dropped an .mdb there. I dragged a DetailView to the form, configured it to show two fields of a table, and got AccessDataSource1. The test query worked. The .mdb was not open in Access, nor was it being used anywhere else. Yet when I pressed Cntl+F5 I got the following error:
12
5136
by: Selva Chinnasamy | last post by:
Hi I am using batch commands against Ms-Access and getting an error Message "Characters found after end of SQL statement." String Here is my sql Dim str_screens As String = "Select * from Screens Order by ScreenName;Select * from Functions" How can I fix this problem. Any help is greatly appreciated. Selva
1
9775
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm having I'd be most appreciative. The database is already constructed, I'm just wanting to export the data to an excel file. In short, I'm hoping to export two Tables (or queries...not sure which to use - they both seem to have the same data) in...
1
2492
by: rhbourne | last post by:
Hello, I'm doing something wrong here, and it's driving me nuts. A very strange thing is happening with a query that populates an XML export function. 1. I have a query and its XML export routine sitting in a file. That file, in turn, is called by a "New Spry dataset" block in a file that my form points to. 2. When I set up the XML-generating query as "Select * from tablename", it all works perfectly. 3. BUT.. when I set up the...
17
19896
by: chadh | last post by:
Hello, I'm having some troubles exporting a query to a csv file. I am able to use the doCMD.TransferText to output the query to the csv file, however, I cannot get it to use the Export Specifications and on some queries data is showing up in what looks like HEX. Below is an example: SQL Statement for Invoice_Header Query: SELECT !! AS inv_id, !! AS tran_date, Sum(Item_Lot_Query.total_gross) AS total_gross FROM Item_Lot_Query; The SQL...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.