Converting to VID 6.0

Converting your Visual InterDev 1.0 Web applications to version 6.0 may not be as difficult as you think. Visual InterDev 6.0 comes packaged with a built-in facility that allows you to migrate your version 1.0 Web applications to version 6.0 without having to make any significant modifications to your existing 1.0 content.

The Visual InterDev 6.0 product automatically generates some of the required modifications for you during the migration process. However, for the most part, your applications will continue to run as they did in version 1.0 in both the Visual InterDev 6.0 development and server environments. In fact, if members of your Web development team are still using Visual InterDev 1.0, they can view the application files even after the application has been upgraded to the new version.

Sounds simple, right? You're probably saying to yourself, "OK, there has to be a catch; nothing can possibly be that easy." Well you're right, there are a few things you need to watch out for as you begin to migrate your applications into the new 6.0 version. In this article, I'll address a few of the technical and logistical issues you may encounter when your development team decides to take the plunge and migrate to Visual InterDev 6.0

Do I need any server upgrades?

Visual InterDev 6.0 includes several enhancements that are a direct result of modifications to the server software extensions. All of the software you need to upgrade your Web server is contained on the Visual InterDev 6.0 installation disk. Microsoft has designed the server software to work with both Visual InterDev 1.0 and 6.0, so you don't need to worry about any version compatibility issues. You'll still be able to open Visual InterDev 1.0 projects even after you install the new 6.0 server extensions.

There are many new and improved features in version 6.0 that are dependent upon the latest server extension software. For example, the Visual InterDev 6.0 Programming Model, Data Environment, Design-Time Controls, and Data Commands all use the upgraded server and are supported only after you install the Visual InterDev 6.0 Server extensions. To install the server software and upgrade your server extensions, you need to run the Visual InterDev 6.0 Server Setup, shown in Figure A.

Note: You need to install the server extensions only on the Web server. You don't need to load the server software on your client machine.

Figure A: Install the Visual InterDev 6.0 Server Extensions only on the Web server.

In addition to the Visual InterDev 6.0 Server Setup, you'll need to install Microsoft Internet Server 4.0 (IIS4.0). This software is required to run the integrated Microsoft Visual InterDev debugger. The Internet Information Server 4.0 software is included on your Visual InterDev disk; you can install it from either the Microsoft Windows NT 5.0 or NT 4.0 Options Pack installation disks.

Note: My machine, which works without error, has the following server software installed: NT 4.0 Option Pack (IIS 4.0), IE 4.01, NT Option Pack 3, and the VID 6.0 Server extensions.

Connecting to the database

To build data-driven Web applications in Visual InterDev, developers generally use the ADO object model to connect to and then access data maintained in a relational database. In order to connect to a database in Visual InterDev 6.0, as well as in Visual InterDev 1.0, you must first create a data source name (DSN) for the database or choose an existing DSN—one that's already been defined on the Web server. Next, you use the DSN to create and add a VID data connection to your Web project. This data connection is the object that provides your Visual InterDev project with access to data in the selected database.

Once you're connected to a database, you can write script to display or edit data on your Web page. This process remains the same in Visual InterDev 6.0. There is, however, one big difference between how the two versions maintain the script for the connections. In Visual InterDev 1.0, established data connections are identified by session variables within your project.

You can see the session variables by opening your project's Global.asa file. In Visual InterDev 6.0, data connections are identified by application variables within your project, as shown in Figure B.

Figure B: View your session variables in the Visual InterDev 6.0 Global.asa file.

The application variables are included in the Application_OnStart subroutine, while the older session variables are included in the Session_OnStart subroutine. In VID 6.0 you can still see the connections within your project's Global.asa file. Now, however, instead of having to manually type or create the connection script, you can use the Data Environment to edit the application variables for each data connection, as shown in Figure C.

Figure C: The Data Connection Properties window allows you to change variables for your data connections.

The data connections are automatically converted from session to application variables when you first open a Visual InterDev 1.0 project in Visual InterDev 6.0. The session variables that were defined in Visual InterDev 1.0 remain in the Global.asa file, but are used only with the Design Time components that shipped with Visual InterDev 1.0.

So why did Microsoft make this distinction? Well, defining data connections as application variables is better, faster, and requires fewer resources than the version 1.0 method.

To better understand this concept, let's define the difference between an application and a session object. The session object can store information about a single user in the current session. An application object can store information about multiple users. Therefore, when you use the version 6.0 application variables, each data connection can be shared among all the users accessing your application. On the other hand, when you use the version 1.0 session variables, each user must re-create the data connection variables, making it impossible for data connection sharing to occur. Sharing connections improves the scalability of a Web application by making better use of server resources, thus minimizing the number of required data base connections.

Version 6.0 software opens Version 1.0 applications and visa-versa…

You should be aware of a few issues if you think you might frequently open Visual InterDev projects using alternating versions. The first problem is one most of us have probably already encountered: opening a VID 1.0 project in VID 6.0. If your VID 1.0 project contains a data connection, you'll immediately be prompted to convert that data connection to the new data environment format.

The conversion process will automatically add the Application session variables to the Application_OnStart event, leaving the already existing session variables in place, as shown in Figure D. This process gives you the ability to reopen the converted Web project in VID 1.0 because each version of VID references a different data connection script and VID left the old 1.0 script intact.

On the other hand, you'll lose your data connection if you try to open a Visual InterDev 6.0 project that contains a data connection in Version 1.0. To re-create the connection, you can do one of two things: You can either manually copy the application session variables from the Application_OnStart subroutine to the Session_OnStart subroutine and modify the Application key word to Session; or you can create a new data command object using the VID graphical user interface.

Figure D: Open a Visual InterDev 1.0 Project with a data connection.

Design-time control differences

In Visual InterDev 6.0, Microsoft combined several product enhancements to create a richer, faster, more robust environment for using Design-Time Controls (DTCs).Back in the days of Visual InterDev 1.0, DTCs were used as wizards to generate script based on a sub-set of user-specified parameters. You could then modify the generated script either manually or by reopening the DTC. However, if you reopened the DTC after manually modifying the generated script, you'd lose the manual modifications.

Visual InterDev 6.0 introduces a new breed of DTC's. The philosophy behind the 6.0 DTCs has been expanded to allow you to code against the VID 6.0 programming model as opposed to just coding script. The new DTCs feature an enhanced design-time user interface, as you can see in Figure E. This interface enables developers to view the controls in both a graphical context and as simple text. Data-bound DTC controls make it simple to build data-driven ASP or HTML pages that interact with your database.

Figure E: You can use the graphical display to display control information.

The DTC controls included with this version of Visual InterDev also allow you to specify whether you want to create client or server-side script. This setup allows developers to create browser agnostic (HTML, ASP) or browser specific (DHTML) versions of Web applications.

Your Visual InterDev 1.0 Legacy DTCs will continue to function in the Visual InterDev 6.0 environment. However, remember that they're not supported in the WYSIWYG editors design toolbox interface.

Conclusion

I recently converted several applications from Visual InterDev 1.0 to Version 6.0 and encountered few if any problems. Although I can't say all conversions will go as smoothly, I can tell you that the applications I converted were at times large and included many version 1.0 data connections. Unfortunately, they failed to make extensive use of version 1.0 design-time controls.

I think you'll find the biggest hurdle to overcome with the migration of a 1.0 Web application is not version compatibility, but rather a fundamental change in Microsoft's Web development philosophy. In fact, the largest problem you'll likely face will have nothing to do with conversion. Instead, you'll be trying to deter your developers from wanting to rewrite your applications to take advantage of the new architecture and development strategies introduced by the Microsoft's Visual InterDev 6.0 product.

Copyright © 1998, ZD Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD Inc. Reproduction in whole or in part in any form or medium without express written permission of ZD Inc. is prohibited. All other product names and logos are trademarks or registered trademarks of their respective owners.