468,161 Members | 1,918 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

XML to ODBC

I have an application that can be 'queried' by sending an http post, in
return I get an XML file.

I have another application that can only work with ODBC.

I am asked to write a 'bridge' between these two.

What would be the best way to achieve this?
Mar 14 '06 #1
11 5482
Hi philip:
You could achieve this using a DataSet.
a Dataset can read and write data and schema as XML documents.
then, depending on what is next use ado.net classes to continue working with
the dataset.
I access all my ODBC tables using ds
search the help for dataset class
good luck

"Philip Wagenaar" wrote:
I have an application that can be 'queried' by sending an http post, in
return I get an XML file.

I have another application that can only work with ODBC.

I am asked to write a 'bridge' between these two.

What would be the best way to achieve this?

Mar 14 '06 #2
How can an application access the DataSet through odbc?

"raulavi" wrote:
Hi philip:
You could achieve this using a DataSet.
a Dataset can read and write data and schema as XML documents.
then, depending on what is next use ado.net classes to continue working with
the dataset.
I access all my ODBC tables using ds
search the help for dataset class
good luck

"Philip Wagenaar" wrote:
I have an application that can be 'queried' by sending an http post, in
return I get an XML file.

I have another application that can only work with ODBC.

I am asked to write a 'bridge' between these two.

What would be the best way to achieve this?

Mar 14 '06 #3
I use a function where I pass my sql strint parameter and return the datatable
Public Function ReturnTbl(ByVal SQLParm As String) As DataTable
Dim cn As New OdbcConnection(CnString)
Dim da As New OdbcDataAdapter(SQLParm, cn)
Dim dt As New DataTable
Try
da.Fill(dt)
Catch ex As Odbc.OdbcException
'?? Throw New
DataException(MessageBox.Show(ex.ToString & vbLf & "", "DataBaseException "))
'User error msg
MsgBox(SQLParm _
& vbLf & vbLf & " " & ex.Message,
MsgBoxStyle.Critical, "SOSErr ")
Catch DBex As DataException
Throw New DataException("Unable to retrieve data")
End Try

Return dt

End Function
http://msdn.microsoft.com/library/de...xmldataset.asp
"Philip Wagenaar" wrote:
How can an application access the DataSet through odbc?

"raulavi" wrote:
Hi philip:
You could achieve this using a DataSet.
a Dataset can read and write data and schema as XML documents.
then, depending on what is next use ado.net classes to continue working with
the dataset.
I access all my ODBC tables using ds
search the help for dataset class
good luck

"Philip Wagenaar" wrote:
I have an application that can be 'queried' by sending an http post, in
return I get an XML file.

I have another application that can only work with ODBC.

I am asked to write a 'bridge' between these two.

What would be the best way to achieve this?

Mar 14 '06 #4
Thank you.

But the problem is not retrieving data through odbc in vb.net. The problem
is making data avalible to other applications through odbc.

"raulavi" wrote:
I use a function where I pass my sql strint parameter and return the datatable
Public Function ReturnTbl(ByVal SQLParm As String) As DataTable
Dim cn As New OdbcConnection(CnString)
Dim da As New OdbcDataAdapter(SQLParm, cn)
Dim dt As New DataTable
Try
da.Fill(dt)
Catch ex As Odbc.OdbcException
'?? Throw New
DataException(MessageBox.Show(ex.ToString & vbLf & "", "DataBaseException "))
'User error msg
MsgBox(SQLParm _
& vbLf & vbLf & " " & ex.Message,
MsgBoxStyle.Critical, "SOSErr ")
Catch DBex As DataException
Throw New DataException("Unable to retrieve data")
End Try

Return dt

End Function
http://msdn.microsoft.com/library/de...xmldataset.asp
"Philip Wagenaar" wrote:
How can an application access the DataSet through odbc?

"raulavi" wrote:
Hi philip:
You could achieve this using a DataSet.
a Dataset can read and write data and schema as XML documents.
then, depending on what is next use ado.net classes to continue working with
the dataset.
I access all my ODBC tables using ds
search the help for dataset class
good luck

"Philip Wagenaar" wrote:

> I have an application that can be 'queried' by sending an http post, in
> return I get an XML file.
>
> I have another application that can only work with ODBC.
>
> I am asked to write a 'bridge' between these two.
>
> What would be the best way to achieve this?

Mar 14 '06 #5
Hi Philip,

Thanks for your post!

For the current issue, as far as I know, there is no interface of XML which
can be accessed directly by using ODBC driver. If you want to use other
applications (no .NET application) to access the XML data source, I think
using XML SDK is a good way.

In addition, you can import the XML data to SQL server and use the ODBC to
access the SQL Server. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 16 '06 #6
Yuan,

That indeed seems like the best option. I could use SQL Express 2005 for
this right? I mean I can redistribute this freely with my application?

""Yuan Ren[MSFT]"" wrote:
Hi Philip,

Thanks for your post!

For the current issue, as far as I know, there is no interface of XML which
can be accessed directly by using ODBC driver. If you want to use other
applications (no .NET application) to access the XML data source, I think
using XML SDK is a good way.

In addition, you can import the XML data to SQL server and use the ODBC to
access the SQL Server. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 17 '06 #7
Hi Philip,

Thanks for your reply!

If you use the SQL express, I suggest you save the data as MDF file. And
then, the client will use it conveniently. If the client has the office
component, you can also use the Access. It is easy to use as the desktop
data base engine. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 20 '06 #8
Hi Yuan,

Thanks for your reply!

Why do you suggest saving the database as a mdf file? What is against using
ODBC driver for SQL to connect to the database?

""Yuan Ren[MSFT]"" wrote:
Hi Philip,

Thanks for your reply!

If you use the SQL express, I suggest you save the data as MDF file. And
then, the client will use it conveniently. If the client has the office
component, you can also use the Access. It is easy to use as the desktop
data base engine. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 20 '06 #9
Hi Philip,

Thanks for your reply!

I'm sorry maybe I have a little confusion about the current issue. I
thought you want to deploy the database to the client so that I suggested
you save the data base to the mdb file. If you deploy the data base to the
server, please use ODBC driver to connect the SQL data base freely. It's
OK. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 21 '06 #10
I have several workstations throughout europe that will run an application.
This application can only connect to databases using ODBC connections wriiten
in plugins in vb6.

The data this application needs is inside several other systems throughout
europe that can be retrieved through xml requests to those applications.

My idea was to install SQL 2005 express on the workstations (localy). Then
write an application in VB.net that sends out the xml requests to the other
applications, receives/parses the data it gets back and places it in the SQL
2005 express database.

The application on the workstations can then locally connect to the SQL 2005
express database and query for the data its needs.

This is my task at hand.

What is the advantage in using mdf (ms access) files?
""Yuan Ren[MSFT]"" wrote:
Hi Philip,

Thanks for your reply!

I'm sorry maybe I have a little confusion about the current issue. I
thought you want to deploy the database to the client so that I suggested
you save the data base to the mdb file. If you deploy the data base to the
server, please use ODBC driver to connect the SQL data base freely. It's
OK. Thanks for your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 21 '06 #11
Hi Philip,

Thank for your reply!

The solution seems OK. I think I have no additional comments about the
current issue. If you have any issues, please feel free to let me know.
It's my pleasure to be assistance.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 21 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marco Aschwanden | last post: by
4 posts views Thread by Andreas Lauffer | last post: by
3 posts views Thread by Lauren Quantrell | last post: by
5 posts views Thread by Alec | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.