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?
Asked
Active
Viewed 236 times
1 Answers
0
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.

0b1
- 1
-
I also thought returned data may be converted to a recordset as the VB5 developer is probably used to working with recordsets. – billymac Jan 15 '21 at 19:21
-
Thanks 0b1. I was hoping there was a better way such as a VB 5 or 6 COM component for talking to a web api. Thanks for the namespace tip, I know Microsoft is known for bloating auto generated xml. – billymac Jan 15 '21 at 19:26
-
Imo, by the time you track down such a component, figure out how to use it, overcome obstacles.where the documentation and community support are long gone, you may as well roll your own. – 0b1 Jan 15 '21 at 20:45
-
That's not as daunting as it sounds and you can always stuff an ADO dataset instead of a Collection, so that your developers are working with familiar tech. I imagine about two lines of code per each property on the object : one to define the column and one to populate it. I'm guessing here as it depends on your data, but it shouldn't be a lot. – 0b1 Jan 15 '21 at 20:46
-
Similar to what I was thinking. Mainly juct want to make sure theres not a better way I dont know about. – billymac Jan 18 '21 at 13:35
-
I could create a com component in VB to talk to the SQL Azure datatstore API. For queries I could return ADO recordset as that's what the VB app developer is probably most familiar with. Only thing that I see as a con using this approach is that while developing, every time I make a change to the com component, l will need to send it to the vb developer to test. If I used REST, I would only need to tell the VB developer what has been added or changed in the api.- After we decide on a common method for calling the api from VB it would be much the same for each new method added to the api. – billymac Jan 18 '21 at 13:48