Connecting VB6 application to SQL Azure Data store

273 Views Asked by At

I am starting a project to modify a legacy application to use cloud data. The application is a VB5 (not sure why not VB6) application using either Access database or file based SQL Server (.mdb) Since the person that developed the VB application is not willing (or able) to fully refactor the application, I was asked to look into how this could be done. A full re-write of the application may be in the cards but definitely not at this time. My plan is to start with a proof of concept to allow a single function in the VB application to use cloud data store. I plan to create a SQL Azure database containing the required table(s) and data as well as a Web API to access this data (C#/.net) I haven't used VB5 or 6 since late 90's but I am very familiar with it. However I am not sure the best method to use for connecting the VB application to the API to be able to work with the cloud data store. Here's what I know: I could use XMLHTTP to call the web services by way of http calls. That would get XML or Json back from the server which I assume I would need to deserialize/parse. I am wondering if the Soap Toolkit is still a viable option or something else that would allow calling the web service and work with the returned data as objects-no parsing required. I remember using Soap/ROPE in the late 90's which was cool because it allowed you to point to a dll containing methods/functions and automatically convert them to soap functions. Or I could create a com component to do this myself which would be a lot of work. Are there any better ways of getting VB5 to talk to REST based service?

1

There are 1 best solutions below

6
0b1 On

Given how cumbersome the VB6 IDE can be to modify and debug code, of am ADO connection is unavailable I would keep things dimple. I would go with an XMLHTTP wrapper class and a formatter class.

The formatter class could stuff a Collection by iterating through nodes or with specific XPath queries.

Often, to simplify the legacy code, I will replace the XMLNS namespace with an empty string before loading the DOM so that I don't have to keep bloating the code with it.