dcsimg
Results 1 to 14 of 14

Thread: VB6.0 as a web application

  1. #1

    Thread Starter
    Registered User
    Join Date
    Oct 2018
    Posts
    4

    VB6.0 as a web application


    Hello VB 6 Gurus - I am new to this forum, i have question . I have a small application developed on VB6 , recently i have migrated DB from ms access to MySql . I would like to have the advice on how to use this as a web application with the same base code ?

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    32,504

    Re: VB6.0 as a web application

    I would say that the simple answer is: Don't!

    Web applications and desktop applications are pretty radically different. For example, most desktop applications (and it sounds like yours applies) have all the resources they need locally. The program is local, the database is local, and any other files are local. That isn't the case for a web application. A web application will run in a browser, which could be on a phone, a tablet, a desktop, or anywhere else. That range of screen sizes means that the issues you have to consider when creating a UI tend to be quite different. You also are generally using HTML plus other things for making web pages, which a desktop application generally won't translate to very well.

    The next issue would be the database, because you don't even want to expose that to a web page (and all the related hacks), if you can even find a host willing to allow it. Instead, you'd build some kind of service such that the page can interact with the database through the intermediate of the service. That will likely change the structure of the database interaction pretty significantly.

    So, you can certainly take the concept of the application and turn it into a web application, and when doing so you may be able to use some of the code you have written, especially on the server side, but you likely will be re-writing the UI almost entirely, and the interactions between UI and DB will change pretty radically, as well. This means that you really aren't going to be using an existing desktop application as a web application. They are just too different.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Registered User
    Join Date
    Oct 2018
    Posts
    4

    Re: VB6.0 as a web application

    Thanks for detailed reply , yes we developed this application for 15 years and robust , unfortunately we dont have budget for re-writing it into a new application, as the existing one is robust and scale able to our needs. Only the web interface was missing , that fine . once again appreciate your response.

    Quote Originally Posted by Shaggy Hiker View Post
    I would say that the simple answer is: Don't!

    Web applications and desktop applications are pretty radically different. For example, most desktop applications (and it sounds like yours applies) have all the resources they need locally. The program is local, the database is local, and any other files are local. That isn't the case for a web application. A web application will run in a browser, which could be on a phone, a tablet, a desktop, or anywhere else. That range of screen sizes means that the issues you have to consider when creating a UI tend to be quite different. You also are generally using HTML plus other things for making web pages, which a desktop application generally won't translate to very well.

    The next issue would be the database, because you don't even want to expose that to a web page (and all the related hacks), if you can even find a host willing to allow it. Instead, you'd build some kind of service such that the page can interact with the database through the intermediate of the service. That will likely change the structure of the database interaction pretty significantly.

    So, you can certainly take the concept of the application and turn it into a web application, and when doing so you may be able to use some of the code you have written, especially on the server side, but you likely will be re-writing the UI almost entirely, and the interactions between UI and DB will change pretty radically, as well. This means that you really aren't going to be using an existing desktop application as a web application. They are just too different.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,153

    Re: VB6.0 as a web application

    Quote Originally Posted by Shaggy Hiker View Post
    So, you can certainly take the concept of the application and turn it into a web application, and when doing so you may be able to use some of the code you have written, especially on the server side, but you likely will be re-writing the UI almost entirely, and the interactions between UI and DB will change pretty radically, as well. This means that you really aren't going to be using an existing desktop application as a web application. They are just too different.
    UI difference aside there are also the issues of flow, statefulness, performance, and access to local machine resources. Just doing controlled printing from within a "web app" can require a lot of gyration.

    Some kinds of applications can transition fairly easily aside from the UI rewrite. This can be especially true if the original application was designed isolating UI support logic from business logic. Sadly, this seems to be a rarely applied discipline. There are huge bags of prefab boilerplate JavaScript that try to work around many of the other issues but you face a lot of research and study and instability over time... and yet you may still have potholes they don't cover.


    Even asking this question suggests you need experienced professional assistance if the need justifies the expense. If you were up to speed you'd be able to evaluate how practical it is to rewrite your application already.

    The short answer is there is no magic "convert to web" button for desktop applications. This isn't a VB6 issue, but one you'd face no matter what was used to write the original desktop application.

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,603

    Re: VB6.0 as a web application

    Yeah, I'd have to agree with what's been already said. Vmadala, I've got no idea how involved your application is. If it's fairly involved, and you're imagining the whole thing just "appearing" in a web browser, that's going to take some work. Setting the security/privacy issues aside, the ideas that come to mind for me are as follows:

    • There is a VBScript language that runs in web browsers. However, it's a VERY different language from VB6. But it does have many similarities which might allow you a good head-start on developing some data entry and data query forms.
    • I've been recently playing around with the PHP language (and actually have a small application up and running with it). Using PHP would essentially be a re-write, cutting your existing VB6 code out of the loop. However, PHP is an extremely high-level language (more so than VB6), and might allow you to get some fundamental data entry and data query forms up and running fairly quickly.
    • To wrap your entire existing application into an OCX file. I'm not at all sure this would be feasible, as it's not something I've done. Also, I'm not sure browsers support OCX files anymore. However, once-upon-a-time, you could execute an OCX file within a browser. Even if you do get that running, I'm not at all clear what the limits are. You'd need to research that. And again, I'm not at all sure this is a good path.


    If you insist on going forward with this, you're eventually going to have to pick a path. If it were me, and I wanted a fairly involved application shown in the web browser, I'd probably bite the bullet and select either Java Script or Java (as an applet). That choice would give you a clear path forward, and could possibly even replace your VB6 application, as Java can be executed without the browser, and it's also very platform (i.e., OS) independent.

    Best Of Luck,
    Elroy
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  6. #6
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,094

    Re: VB6.0 as a web application

    As has been said, I generally wouldn't recommend trying to get an existing VB6 app on the web UNLESS your front-end and back-end code is already well separated (e.g. you've already developed a Client/Server application that separates all of your business logic from your user interface). If this is the case, then you might be interested in taking a look at this project:

    Here on VBForums:

    http://www.vbforums.com/showthread.p...FastCGI-Server

    And on GitHub:

    https://github.com/jpbro/VbFcgi

    It will allow you to keep all of your existing VB6 back-end code, and then code a new web front-end for it using standard web technologies (HTML5, JS, etc...).

    NOTE: The VBForums thread is a good place to start and learn how the system works. From there I recommend getting the source code & binaries from GitHub since that is where the latest version is hosted.

  7. #7
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: VB6.0 as a web application

    Quote Originally Posted by vmadala View Post
    [CENTER][/CENTER
    Hello VB 6 Gurus - I am new to this forum, i have question . I have a small application developed on VB6 , recently i have migrated DB from ms access to MySql . I would like to have the advice on how to use this as a web application with the same base code ?
    4-5 years ago I used a program called Basic4Android ("B4A") to write several Android apps. It is very similar to VB6. One of my apps used a database which I had converted from Access to SQL and it worked without any trouble. https://www.b4x.com/b4a.html is the web site.

    B4A has tools for adjusting apps to devices of any size or resolution, so I don't think that is a huge challenge.

    I believe that they have versions for other JAVA and iOS as well.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,153

    Re: VB6.0 as a web application

    Quote Originally Posted by NFordVBF View Post
    One of my apps used a database which I had converted from Access to SQL and it worked without any trouble.
    You probably meant SQLite.

    In any case most of us have some familiarity with the B4x products. None of them are going to be of any help in turning a desktop VB6 program magically into a web application. At all.

    Far to many people write sloppy VB6, with 90% of their logic wrapped into Forms and 10% in static .BAS modules. That alone is a huge impediment, and even where it doesn't exist there are lots more impediments already mentioned above.

    Even simple CRUD applications can be a bear to convert. Few VB6 programmers are making use of disconnected Recordsets today and probably don't have a clue how to deal with update collisions.

    Don't even get started on the all too common "pachinko code" programs where they can't get the programs even to terminate without loops to unload a myriad of Forms. Neither they nor their code has any clue about the state of the program at any given time because they do things willy-nilly.

  9. #9
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: VB6.0 as a web application

    Quote Originally Posted by dilettante View Post
    ...most of us have some familiarity with the B4x products. None of them are going to be of any help in turning a desktop VB6 program magically into a web application. At all.
    Well, I guess that depends on the programmer. What is it they say about magic vis-a-vis technology?

    "Having some familiarity" and converting a large VB6 desktop program into B4A are two different things. It worked for me.

    My experience in VB - dating back to VB1 - is that very conservatively, 90+% of the work is writing the algorithms and the rest is dragging controls around. (That's why we use VB, right?) For my A.I. software, it's more like 99% algorithms. Algorithms are the same no matter what environment they are in.

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,153

    Re: VB6.0 as a web application

    Ok you win. All he needs to do is buy B4A and magically he gets a web application.

    Or not. At all. Since B4A has nothing to do with web applications.

  11. #11
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,603

    Re: VB6.0 as a web application

    Not to hijack vmadala's thread ... but NFordVBF, you bring up an interesting question.

    I'm just wondering how we'd go about accessing a VB6 compiled in-process DLL (with no user-interface in the DLL) from a web application. I certainly don't know how to do it, but I feel that there must be a way. I'm not even sure what language I'd start with to try and do it.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,153

    Re: VB6.0 as a web application

    Normally you'd do this from an ASP page written in VBScript.

    In VBScript you have CreateObject(), but normally you'd use IIS's Server.CreateObject() instead within an ASP page script.

    This is basically what you get from an IIS Application project type in VB6. It implements almost all of the logic within a VB6 DLL with a minimal VBScript host page to create top-level object instances and pass calls into them.

    Nothing prevents you from putting more of the logic in your own script though and calling a manually-created ActiveX DLL.

    You can look in your October 2001 MSDN Library CD docs for "Active Server Pages Guide" though I doubt Microsoft has the information online at this late date, especially the subtopic "Visual Basic Object Model."


    If you mean client-side then you are limited to using IE with security settings relaxed.

  13. #13
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,786

    Re: VB6.0 as a web application

    Quote Originally Posted by Elroy View Post
    I'm just wondering how we'd go about accessing a VB6 compiled in-process DLL (with no user-interface in the DLL) from a web application.
    I've recently put a whole article about that into the CodeBank:
    http://www.vbforums.com/showthread.p...g-of-http-RPCs

    Just work your way through - up to the 'RPCTest_WithParams.zip' (fully understanding "what's happening there, along the roundtrip") -
    and what then remains would be, to adapt the shown "ADO.Rs-Container based, parameter- and -result-transport",
    to a JSON-Container-based one, which would be more suitable for the JavaScript-driven Browser-Clients -
    who then initiate their RPCs over Ajax, when communicating with the VB6-ServerDll on the AppServer.

    Olaf

  14. #14
    Frenzied Member
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,094

    Re: VB6.0 as a web application

    Quote Originally Posted by Elroy View Post
    I'm just wondering how we'd go about accessing a VB6 compiled in-process DLL (with no user-interface in the DLL) from a web application. I certainly don't know how to do it, but I feel that there must be a way. I'm not even sure what language I'd start with to try and do it.
    As an alternative to Olaf's approach, there's mine mentioned in post #6.

    Over the years, I've tried to rid myself of as many Microsoft components as possible, so I didn't want to use IIS and went with Nginx instead. Even more important to me than avoiding MS though: one thing I like about Nginx is that it comes as a single EXE that I can distribute with my application. This is important to me because I try to get as close to "zero configuration" as I can for my users. I deal with a wide variety of skills when it comes to the IT people - from enterprise level types (who can vary quite a bit in "quality" still) to people tasked with doing the "IT" stuff that aren't IT people, just the most tech-literate person in the office. Many just don't want to be messing about installing/activating/configuring things like IIS, SQL Server, etc... hence my use of Nginx & vbRichClient5 with SQLite as they can all be shipped in one package.

    On the server-side I am programming in VB6 against all of my existing VB6 ActiveX DLLs, and then pushing JSON or HTML5 downstream to the web server. Nginx handles all of the stuff I wouldn't want to do myself like SSL, load-balancing, etc.... On the browser side everything is HTML5, JS, CSS of course, but it has meant that I only need to re-write the front-end stuff and re-use all of my back-end stuff, which has been a real boon.

    Anyway just wanted to show you an alternative to what Olaf is doing and you can choose what might work best for you. I know you are fairly firmly in the anti-RC5 camp and since my solution relies on RC5 you might be more interested in Olaf's approach as I don't think it is reliant on RC5 in any way.

    And as a side note for those who have accused me of being a "shill" for Olaf in the past - let this post be evidence that we do in fact disagree sometimes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width