473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Dump whole dataset to a new access table

Hi all,
I have an application that needs to import XML files into Database.
This XML file was generated by this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cmdXML As OleDb.OleDbCommand
Dim DScmdXML As OleDb.OleDbDataAdapter
Dim DSXML As New DataSet()

Dim sqlXML As String = "SELECT * FROM List_Piante"
cmdXML = New OleDb.OleDbCommand(sqlXML, conn)
DScmdXML = New OleDb.OleDbDataAdapter(cmdXML)
DScmdXML.Fill(DSXML, "List_Piante")
DSXML.WriteXml("Piante.xml", XmlWriteMode.WriteSchema)
Dim xmlSW2 As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\Piante.xml")
DSXML.WriteXml(xmlSW2, XmlWriteMode.WriteSchema)
xmlSW2.Flush()
xmlSW2.Close()

End Sub

I need to import this XML file into a NEW created ms-access table, but
i don't know how, and i cannot find any helpful suggestion on google.

Many Thanks
Mar 19 '08 #1
2 1858

Well i guess you can do 2 things

1 . really create a database from scratch , you can do this with ADOX (
Com interop in .Net ) as there is no managed libraray availlable wich can do
this

OR

2. Create a empty database , with empty tables in a Access database ( repair
and compress it after doing so in Access ) and now add this as a resource
in your executable so instead of creating a new database , your app simply
copies a empty database from it`s resource and fills this with the data
contained in the XML files ( no need for COM interop , much faster )

I have done option 2 numerous times and can show you an example if you want

Michel

"Marcolino" <ma************@gmail.comschreef in bericht
news:41**********************************@d45g2000 hsc.googlegroups.com...
Hi all,
I have an application that needs to import XML files into Database.
This XML file was generated by this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cmdXML As OleDb.OleDbCommand
Dim DScmdXML As OleDb.OleDbDataAdapter
Dim DSXML As New DataSet()

Dim sqlXML As String = "SELECT * FROM List_Piante"
cmdXML = New OleDb.OleDbCommand(sqlXML, conn)
DScmdXML = New OleDb.OleDbDataAdapter(cmdXML)
DScmdXML.Fill(DSXML, "List_Piante")
DSXML.WriteXml("Piante.xml", XmlWriteMode.WriteSchema)
Dim xmlSW2 As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\Piante.xml")
DSXML.WriteXml(xmlSW2, XmlWriteMode.WriteSchema)
xmlSW2.Flush()
xmlSW2.Close()

End Sub

I need to import this XML file into a NEW created ms-access table, but
i don't know how, and i cannot find any helpful suggestion on google.

Many Thanks

Mar 23 '08 #2
On 23 Mar, 09:36, "Michel Posseth [MCP]" <M...@posseth.comwrote:
Well i guess you can do 2 things

1 . really create a database from scratch , you can do this with ADOX * (
Com interop in .Net ) as there is no managed libraray availlable wich can do
this

OR

2. Create a empty database , with empty tables in a Access database ( repair
and compress it after doing so in Access ) *and now add this as a resource
in your executable * so instead of creating a new database , your app simply
copies a empty database from it`s resource and fills this with the data
contained in the XML files ( no need for COM interop , much faster )

I have done option 2 numerous times and can show you an example if you want

Michel

"Marcolino" <marco.pozzu...@gmail.comschreef in berichtnews:41**********************************@d 45g2000hsc.googlegroups.com...
Hi all,
I have an application that needs to import XML files into Database.
This XML file was generated by this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
* * * *Dim cmdXML As OleDb.OleDbCommand
* * * *Dim DScmdXML As OleDb.OleDbDataAdapter
* * * *Dim DSXML As New DataSet()
* * * *Dim sqlXML As String = "SELECT * FROM List_Piante"
* * * *cmdXML = New OleDb.OleDbCommand(sqlXML, conn)
* * * *DScmdXML = New OleDb.OleDbDataAdapter(cmdXML)
* * * *DScmdXML.Fill(DSXML, "List_Piante")
* * * *DSXML.WriteXml("Piante.xml", XmlWriteMode.WriteSchema)
* * * *Dim xmlSW2 As System.IO.StreamWriter = New
System.IO.StreamWriter("c:\Piante.xml")
* * * *DSXML.WriteXml(xmlSW2, XmlWriteMode.WriteSchema)
* * * *xmlSW2.Flush()
* * * *xmlSW2.Close()
End Sub
I need to import this XML file into a NEW created ms-access table, but
i don't know how, and i cannot find any helpful suggestion on google.
Many Thanks- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -
MIchel,
very thanks for your help.
can you provide me the example for option 2?

Thanks
Mar 24 '08 #3

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

Similar topics

0
by: Neo | last post by:
I was wondering what is the "right" way to deal with datasets is. Particularly sharing DataSets between forms. Here is my situation. I have a simple Customer Database, that holds some information...
1
by: JIM.H. | last post by:
Hello, Here is part of my code to retrieve some data from FoxPro and populate DataGrid. It works fine. What is the best and easiest way to import data from Dataset to a table in SQL Server. '...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
6
by: Soeren Gerlach | last post by:
Hi, some weeks ago I started to develop an application using Postgresql the first time. I'm running 7.4.3 on a Linux box with a plain 2.6.7 kernel, the storage is handled by 5 SATA disks,...
2
by: Auddog | last post by:
Hello all, I'm fairly new to access database(s), but I work a lot with mysql. I was wondering if there is a script file out there that I can get a hold of that will create a dump file. I need...
2
by: JIM.H. | last post by:
Hello, I am quite new in asp.net, here is the code I retrieve data from a web service SVP.ThisWebService.loadMethod lm = new SVP.ThisWebService.loadMethod(); System.IO.StringReader sr = new...
9
by: Shivam | last post by:
Hi All, I have a mysql dump file... something like. __________________________________________________ CREATE TABLE nation ( ip int(11) unsigned NOT NULL default '0', country char(2) NOT...
2
by: Jenden0 | last post by:
Ok, I'm trying to dump an SQL Server 2005 database to XML via C#, and I'm having some troubles. I'm relatively new to the whole .net thing, so there may be some stupid/basic questions/assumptions...
1
by: TYR | last post by:
I have a large dump file that originated in a MySQL db; I need to get it into an SQLite file. Various options are suggested around the web; none of them seem to work (most failing to import the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.