We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


ASP needs rewrite to Object Oriented.

rosshind asked
Medium Priority
Last Modified: 2010-05-01
Hi,  I have a huge custom e-commerce application (which works in a similar way to an auction site, matching buyers with sellers).  It is all done in ASP, no VB COM object for this one.

Using only asp was great up to a point, but now the application is suffereing form being difficult to maintain and scale.  It needs some sort of object oriented arcitecture.  I used to use VB COM objects in the past, but I understand that this way of doing things is obselete, having been replaced by .net.  Is that true?

Could I run ASP with a VB component on win 2003 server?

My main problem is that I dont have time to learn a different language.  Ideally I'd like to be able to cut and paste the major functions from my ASP page, arrange them correctly, compile the executable and thats it......

So you can see my problem, I dont have time to learn a new language, but I want to be able to use my existing code in a way which will not be obselete..

What would you do?
Watch Question

"Could I run ASP with a VB component on win 2003 server?" YES

while VB.NET is a 'new' language, you will find that it is NOT all that different from VB6.  It is sort of like learning Italian if you already know Spanish, and NOT like learning Chinese if you already know Greek.


>>It is sort of like learning Italian if you already know Spanish, and NOT like learning Chinese if you already know Greek.

To me, they are all different.  8->


Thanks arthur,

I could reprogram it in JAVA, i'm familliar with that language, the problem is that I just dont have enough time.  I need something which I can cut from ASP / VBScript paste into the VB.net, change a few bits using find and replace,  reconfigure teh arcitecture of the code using OO techniques,  compile it to resolve the other errors  then it would be up and working.

Naturally, its not so easy if I'm to do it in JAVA.  Would that be feasable in VB.NET?

Thanks dancebert, but if I dont have time to rewrite this in a new language, I certainly dont have time to teach anyone how the application should work...
you can also use J# in .NET (which is syntactically IDENTICAL to JAVA)

The biggest problem with simply Cut and Paste is that your ASP pages are either using JavaScript (on the Client) or VBScript on the Server.  VBScript is NOT VB 6, but rather a somewhat restricted sub-set of VB 6, and the translation from VBScript to VB is not a clean one.  Similary, JavaScript IS NOT JAVA - not even close.

And VBScript is different enough from VB.NET that simple cut-and-paste would create FAR MORE problems, in the 'upgrade', than you would have if you re-wrote it, either from scratch in VB.NET, or in J# (yes, you can use J# as the code-behind language in ASP.NET)

Sorry, but that is how it is.

my advice would be to take a deep breath, resign yourself to the fact that this 'upgrade' is going to take some time (no, you will not get it done in a couple of days - more like a couple of MONTHS), and accept the fact the the site may/will run rather slowly, due to performance issues, in the mean time.



Thanks for your help arthur.

A rewrite is not feasible, it would take 6 to 8 months.  My business would go bust for sure if i spent that much time on it.  I can cut and paste the vbscript into VB, review it then it would work, I'm familliar enough with both languages for that.

You said VB.net was not that different from VB 6. Is a cut and paste (with extensive modifications) feasable for vb6 to VB.net?
probably not, as VB.NET is a strongly TYPED language, where the original VBScript is UNTYPED - everything in VBScript is a VARIANT (you cannot Dim var as String, in VBScript, only Dim var)

With VB6, when you Dim var, VB 6 treates that as if you had said, Dim var as VARIANT.

VB.NET does NOT allow VARIANT as a type - VARIANT does not exist in .NET.

In turn, it sounds as though all of your VBScript code is essentially PROCEDURAL, with no Objects defined in your code.  VB.NET is much more strongly oriented toward the OO perspectve, and thus you will probably end up with almost as big a re-write job on your hands as you would have starting from scratch.

One of the reasons for going OO for your ASP.NET app, is to move as much of the funcntionality OUT of the ASP.NET pages themselves, and into a common set of Objects, defined in an independent set of DLLS, that are then accessed from the ASP.NET code.  But your current ASP pages are not strucutred that way.  It is not just a matter of cutting and pasting the existing code into the DLL code.  You will need to do as careful and thorogh re-design of the entire application, from the ground up.  This type of undertaking does not lend itself easily to a simple 'cut-and-paste' approach.

I take it that you are the sole developer of this site?

> I can cut and paste the vbscript into VB

So, it looks like a straight port to VB

> I certainly dont have time to teach anyone how the application should work...

If you're doing a straight port, you don't have to.  Hand the existing app to a decent developer who knows ASP and VB and he'll hand you back the same functionality with different underpinnings.  


I know ASP and VB, I can do that, that dancebert, but that doesnt really answer my question.  

The problem is that it isnt a good idea to use obselete technology when upgrading the way a site works...  Thats why I'm asking about .net etc..



That was not my question.  the feasability ofVB6 into VB.net transalation.  Not VBScript into vb.net.

I certainly dont expect to be able to cut and paste VBScript into VB and leave it at that.  As you say, it needs total restructuring into objects and typing, but thats not a problem I  can do that (i've done it before with applications).  I'm well versed in OO principles with VB 6 or with JAVA.  I'm well aware of the basics of typing that you posted.

I'm just not aware of .net, how it works and how different it is form using a VB 6 dll in combination with ASP.  I assume I could use a vb.net dlls with the .net scripts programmed in c#  or something??

Once the rewrite is done, I'll be keeping the presentation layer seperate form the business / logincal and data layers, so there wont be much logic in the scripts

From what you are saying VB.net is not very different at all form VB6..  its just the next version..?
I was not suggesting Cut-and-Paste of the VBScript to VB.NET.  But the transition from VB 6 to VB.NET will not be clean, either.  Not at all sure I understand what you are getting at with " I assume I could use a vb.net dlls with the .net scripts programmed in c#  or something??"

What .NET Scripts are you refering to.  .NET does NOT use scripts, other than some very basic stuff in Javascript (and that is genrally NOT created by the developer).  Actually, no, VB.NET is MUCH more than just the next version of VB 6 (as I indicated earlier, it is a different, though related language - akin to the relation between Spanish and Italian.  While similar enough that you can learn one fairly quickly, if you already know the other, it is NOT possible to land in one country, speaking only the other language, and be able to get along - there is still quite a learning process that must take place)

My point about VBScript --> VB6 --> VB.NET was that while the VBScript --> VB 6 is fairly easy, as VBScript is a non-typed lanuage, and with the cut-and-paste, VB 6 will convert all of the variables to VARIANTs, and the rest  of the language is pretty straight-forward.  But then trying to upgrade from VB6 to VB.NET will not be as smooth as you would seem to expect.

My guess, without seeing any of the ASP code that you already have, is that you are going to have a VERY significant amount of 'conversion' clean-up, after the move from VB 6 to .NET, and that will probably be of the same order of magnitude as it would have been had you started over, from scratch, in the first place.



so VB doesnt follow the architecture of having the presentation layer in scripts and the business logic in the .dll then?

Where does the presentation layer go?
Unlock this solution and get a sample of our free trial.
(No credit card required)


Thanks for all of your help.  Great answer.  I'm going to do the cut and paste thing into vb 6.  Once thats done, If my client wants to upgrade his server( to use .net) or something then I'll either hide or charge plenty..

good luck, and glad to be of assistance.

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.