XML to ODBC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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/default.asp?url=/library/en-us/cpguide/html/cpconxmldataset.asp
 
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.
 
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
 
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?
 
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
 
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?
 
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
 
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?
 
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
 
Back
Top