Web-Enabling A VB App

Posted on 2002-03-22
Last Modified: 2010-05-02
I have for some time been developing a VB6 application that in some respects is like XMLSpy; it allows people to add/change/modify XML nodes via a user-friendly interface that includes a treeview to display the XML. I now have in excess of 15,000 lines of code and my management has just now asked me to estimate what it would take to web-enable it. The problem is that while I am a very experienced VB programmer I have never done any web-development and I so I don't have a clue and I was hoping that you could help me size it

If you want to help me size it, please consider the following in addition to the above description of the program:

=> I'd like to do it VB6 (if that's possible) but if not and I need to do it in VB.Net or Java I would need to first learn .Net or Java and then convert my current code which in the case of .Net I'm told can be ugly.

==> As I said, I've never done any web development

==> I use the Microsoft DOM (msxml4)

Question by:Martin Liss
  • 4
  • 3
  • 2
LVL 44

Expert Comment

ID: 6889520
First off, you cannot do it in VB6.  If your Webserver is running IIS Server, then you will probably want to use Active Server Pages (ASP) as the web technology, with the Server side code (the code that actually formats the page to be presented to the Browser), in VBScript (NOT VB6).

Secondly, the interaction model for a web-app is almost COMPLETELY different from the interaction model for a typical VB App.  Each WEB page is treated almost completely independent from any other page (what is termed STATELESS in Web-speak).

I would suggest that you should purchase a copy of "Beginning Active Server Pages 2.0" (or 3.0 if you are using the most recent version of IIS Server) from Wrox Press.

IN addition, the CONTOLS 9like the Treeview) that you are used to using in a VB6 app, are NOT available in the Web world.  Thus your interface, and the fundamental design of the app, may need to undergo a major re-work.

While ASP.NET may offer some additional controls, the learning cureve for ASP.NET AND VB.NET will be VERY steep, and the time scale to get this project off the ground will be somewhat drawn out.

Arthur Wood

Expert Comment

ID: 6890189
Arthur: Why do you say he can't use VB6?  I use VB6 to create web apps all the time.  You *do* need a small .ASP file, but that doesn't exclude VB6 as a tool.  

Heres the ASP file, by way of explanation:

<%@ Language=VBScript %>

  Dim myServer
  Dim lngCount
  Dim strResponse

  Set myServer = Server.CreateObject ("MyProgram.Server")
  Response.Buffer = False
  lngCount = Request.TotalBytes
  strResponse = myServer.Execute (Request.BinaryRead(lngCount))

  If Response.IsClientConnected Then
    Response.BinaryWrite strResponse
  End If

  set TransportServer = Nothing

The issue you raise with controls is quite valid, although there is nothing stopping anyone from writing ActiveX controls for web apps (except if their bosses want to support netscape navigator).

Martin:  You can get treeview controls in java, use/create an ActiveX one, or you can roll your own in javascript/vbscript using DHTML.  For an example, have a look at IE's standard XML viewing code by typing res://msxml.dll/DEFAULTSS.XSL as the URL in your browser.

It *will* be a pretty hard job if you have never done web development, though.  You should probably suggest to your bosses that they recruit someone (maybe on contract) who has done web development before to help you.
LVL 44

Expert Comment

ID: 6890227
  What you have done is to use VB to create the 'back-end' of the app, as a DLL.  What I said what that he could not do the coding in VB6 - as you have actually written the coding in VBScript (which then calls you DLL - which actually could have been written in ANY language, as long as the DLL was in fact COM-Compliant). There is nothing whatsoever to indicate that MyServer was actually coded in VB6.

The problem with creating an ActiveX control for use on a web-page is that doing that essentially locks the users into Internet Explorer as the Browser.  True, there is supposed to be an Add-in for Netscape to allow ActiveX, but I have never heard of anyone who has gotten it to work successfully.  ANd there is also the potential security problems inherent with ActiveX controls and Web-pages...many users are absolutely precluded from downloading ActiveX controls over the net - where I work, that is an absolute violation of company security rules, and subject to immediate termination - not questions asked.

DHTML is not a viable choice, in my opinion.  Just my 2-cents worth on that idea.

Arthur Wood
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Expert Comment

ID: 6890239
I mostly agree with you on DHTML, particularly since cross-browser support is a serious problem with DHTML.  I'm not quite sure what you are getting at with "nothing whatsoever to indicate that MyServer was actually coded in VB6"... The ASP file is a "bootstrap", not the actual code, which is about another 2000 lines of code.

I think using VB6 is much better than using lots of code in ASP because:

1.  You dont get the horrible mish-mash of mixed langauges (HTML, VBScript, and often some Javascript) that you get using ASP.

2.  You can have classes, modules, etc, typed variables and all the other goodies that "real" VB has over VBScript.

3.  VB COM objects can run in COM+/MTS with the performance benefits of "retained in memory", etc, etc.

4.  VB is compiled, not interpreted.

That said, (by way of clarification) I actually use XML/XSL to create the HTML output (from VB).  This keeps the languages nice and seperate for the most part.

And yes, Delphi, C++, etc, etc all have the same benefits - I just prefer VB.

Martin: Just a side-note - I saw a MS demo of .NET the other day, and they have done some very interesting stuff for multiple-target-client support.  The demo I saw showed a calendar control that (automatically) adapted to the display of a 4-line character based mobile phone, a CE-based handheld, an IE 6 browser, and an older version browser that didn't support ActiveX.  This looks like a good choice for people that want to support many client types.  And learning .NET is going to be an asset to both you and your employer in years to come, so don't necessarily shy away from it as a choice.
LVL 44

Expert Comment

ID: 6891243
   Much of what is say id 100% correct. I agree about the desirability of actually implementing the logic of the application in VB, as a DLL or set of DLLs, but that does not really addess Martin's original question.  He has a VB6 APPLICATION, probably developed without Objects (though I could be wrong on that point, as he did not indicate one what ot the other).  If the app was NOT built on a true 3-tier model, with ALL of the business logic in the Middle tier, as one or more DLLs, then he will NOT be able to even consider "web-enabling" the application.  The only hope is to package the buiness logic in a layer that is TOTALLY independent of the actual presentation layer.  YOu can then freely choose the best presentation mechanism (or even use several, with in-house users continuing to interact through the current desktop application, and out-side users using the Web as a separate interface). The point being that the business logic is the same, and the Presentation layer is JUST THAT - Presentation ONLY, no logic WHATSOEVER is packaged in the Presntation layer.

Arthur Wood
LVL 46

Author Comment

by:Martin Liss
ID: 6891466
Unfortunately when I was given the assignment to write the app I had absolutely no indication that it would ever need to be on the web so I wrote it as a traditional, monolithic, VB app so it seems from the comments that I will need to re-write it rather than simply(?) converting it.

Would anyone care to try to actually estimate what that would take in man-months with the assumption that I could get some experienced help?

The purpose of the app would be to allow a non-engineer to maintain a large xml knowledge base which contains about 2 dozen different types of nodes. The user should be presented with some sort of user-friendly UI which displays the xml preferably in a tree. The user should be able to easily select the target node(s). When the node is selected, the attributes for the node should be displayed and the user should be able to add/change/delete node attributes and child elements. The changes should be able to be validated against a schema. Other standard functions such as File Open and Save should also be available.

BTW. How should I assign the points for this question?

Accepted Solution

anthony_glenwright earned 100 total points
ID: 6891595
How long did it take you to develop in the first place?  That is usually a good place to start.

I find that re-writing an app only takes about 1/3 of the time it took the first time, BUT applying new technology to it will take you more time on top of that.  Basically it depends on whether you are a good project manager or not...

I would suggest (the obvious):

1.  Decide on the technologies you want to use (java/javascript/.net/dhtml/whaetever) by doing some prototyping work

2.  Do a risk assesment

3.  Break down your project into small parts (1 to 5 day tasks, the smaller the easier it is to estimate)

4.  Estimate each task.

5.  Add em up, make sure you include training (inc. self-traning) in new technologies in the estimates, add about 30% as a buffer, and there is your project estimate.

6.  Make sure you track actual times vs estimates as you go, and make sure your bosses know how you are going.
LVL 44

Expert Comment

ID: 6891690
I really don't care all that much about the points, and I feel that Anthony has been on top of this, as far as really offering you help and guidance on this (ergo, give hime the points).  

My real purpose on this board is 1) to help others with whatever insights I have gained in more than 7 years of VB/VBA experience and 35+ years programming in general, and 2) to learn for the experiences of the other VERY talented programmers who frequent this forum.

Arthur Wood
LVL 46

Author Comment

by:Martin Liss
ID: 6892617
Thank you, and Arthur as well, I really appreciate the input from both of you.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question