Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert VB 6.0 code to VB 5.0

Status
Not open for further replies.

GDGarth

Technical User
Aug 5, 2000
412
US
I've got some sample code from an equipment manufacturer that's written in VB 6. My problem is, I've got VB 5, and it looks like it won't run under that (although I can see the code if I open it up.

I'm not really a programmer - usually, I just modify the sample code until I get it to do what I want. That usually works fine.

How many differences are there between the two versions? Is it likely to be a really big job to convert? Any suggestions?


 
You might want to post the sample code.......... Scott
Programmer Analyst
<><
 

Here are some of the things that are different between versions.

What's New in Language Features

User-defined Types in Public Methods

All Editions User-defined types can be arguments or return types of public properties and methods.

Functions Can Return Arrays

All Editions Functions and properties procedures will be able to return arrays.

Resizable Arrays Can Be Assigned

All Editions Variable-sized arrays can now appear on the left side of an assignment. Fixed-sized arrays cannot appear on the left side of an assignment, although they can appear on the right.

File System Objects

All Editions Offers a streamlined set of routines to traverse the file system and create text files and directories.

CallByName

All Editions Allows access to a property or method by specifying a string containing the name of the property or method, rather than by coding the name explicitly.

CreateObject Function Enhancements

All Editions CreateObject now lets you specify a machine name as an optional argument, which allows you to create objects on remote machines.

StrConv Function Enhancement

All Editions New LCID argument enables you to specify a LocaleID for a string different than the system's LocaleID.

Dictionary Object

All Editions The Dictionary object overcomes some of the Collection object's limitations and is easier to use because it generates fewer run-time errors for common operations and is more flexible.

New String Functions

All Editions

Filter Function
FormatCurrency Function
FormatDateTime Function
FormatNumber Function
FormatPercent Function
InstrRev Function
Join Function
MonthName Function
Replace Function
Round Function
Split Function
StrReverse Function
WeekdayName Function


What's New in Data Access


ADO (ActiveX Data Objects)

All Editions This new data access technology features a simpler object model, better integration with other Microsoft and non-Microsoft technologies, a common interface for both local and remote data access, remotable and disconnected recordsets, a user-accessible data binding interface, and hierarchical recordsets.

Data Environment

Professional and Enterprise Edition The Data Environment designer provides an interactive, design-time environment for creating ADO objects. These can be used as a data source for data-aware objects on a form or report, or accessed programmatically as methods and properties exposed off of the Data Environment object. The Data Environment designer supports all the functionality of Visual Basic's UserConnection designer, as well as additional features, including drag and drop, hierarchies, grouping, and aggregates.

ADO Data Control

All Editions A new OLEDB-aware data source control that functions much like the intrinsic Data and Remote Data controls, in that it allows you to create a database application with minimum code.

Enhanced Data Binding

Professional and Enterprise Editions In previous versions of Visual Basic, it was only possible to bind controls together on a form. In Visual Basic 6.0, we’ve made it possible to bind any ADO/OLE DB data source to any ADO/OLE DB data consumer. You can set the DataSource property of controls at run time to dynamically bind to data sources. You can create classes that are data sources and consumers, and bind them through the new BindingsCollection object. You can create user controls that are data sources, similar to the ADO Data Control. You can create user controls that are complex-bound, similar to the DataGrid control.

OLE DB Support

All Editions OLE DB is a set of COM interfaces that provide applications with uniform access to data stored in diverse information sources, both relational and nonrelational. These interfaces support the amount of DBMS functionality appropriate to the data source, enabling it to share its data. ADO is the way that programmers access OLE DB. All the new data bound controls, the Data Environment, and the Data Report designer are OLEDB-aware.

Visual Database Tools Integration (Query Designer and Database Designer)

Enterprise Edition Visually create and modify database schemas and queries: Create SQL Server and Oracle database tables, drag and drop to create views, and automatically change column data types.

Setup Wizard Data Enhancements

All Editions The Package and Deployment Wizard (formerly the Setup Wizard) incorporates support for ADO, OLE DB, RDO, ODBC, and DAO.

Data Report

Professional and Enterprise Editions Allows you to use drag and drop to quickly create reports from any recordset, including hierarchical recordsets.

Data Sources

Professional and Enterprise Editions Create user controls and classes that are data sources, to which other controls can be bound.

Data View Window

Professional and Enterprise Editions You can use the Data View window to browse all of the databases you are connected to and see their tables, views, stored procedures, etc.

SQL Editor

Enterprise Edition Allows you to add new stored procedures to existing SQL Server and Oracle databases. You can write triggers using the editor too.

Hierarchical FlexGrid Control

All Editions An updated version of the FlexGrid control that, in addition to supporting all the functionality of the FlexGrid control, can display a hierarchy of ADO Recordsets. Each Recordset returned is displayed as a separate band within the grid and can be formatted independently.

DataRepeater Control

Professional and Enterprise Editions Insert a UserControl into the DataRepeater to create a custom view of a database, similar to Access forms. The UserControl can contain TextBox, CheckBox, DataGrid or other controls bound to data fields.

Passing ADO Recordsets

All Editions You can now pass ADO Recordsets across processes and even across machines (using HTTP or DCOM), which provides an efficient means for moving data between tiers in a multitier application.

Data Form Wizard Enhancements

Professional and Enterprise Editions Now gives you the ability to build code-only forms where controls are not bound to a data control. It allows you to use ADO code. The wizard is integrated with the Application, Chart, and FlexGrid wizards.

Data Object Wizard

Professional and Enterprise Editions Automates creating middle-tier objects bound to the Data Environment or UserControls.

File System Objects

All Editions Offer a streamlined set of routines to traverse the file system and create text files and directories.

Format Objects

All Editions Provide two-way conversion of data between a database and a bound control: When a value is read from a database, the Format objects add formatting appropriate to the bound control.

DataGrid Control

All Editions An OLEDB-aware version of DBGrid, the control allows you to quickly build an application to view and edit recordsets. It also supports the new ADO Data control.

DataList Control, DataCombo Controls

All Editions These controls are OLE DB versions of the DBList and DBCombo controls. They also support the new ADO Data control.

Microsoft Jet and Replication Objects

All Editions Microsoft Jet and Replication objects allow you to add features to your application that are specific to the Microsoft Jet Database Engine. The JetEngine object provides control over Jet Engine-specific features such as compacting databases and refreshing data from the cache.

What's New in Internet Features


IIS Applications

Professional and Enterprise Editions Write server-side Internet applications that use Visual Basic code to respond to user requests from a browser.

DHTML Applications

Professional and Enterprise Editions The Dynamic HTML (DHTML) technology in Microsoft Internet Explorer exposes properties, methods, and events for each element on an Web page. DHTML Applications allow you to write Visual Basic code to respond to actions on an HTML page, without transferring processing to the server.

Web Publishing Wizard

All Editions Use the Package and Deployment Wizard (formerly the Setup Wizard) to easily post your packaged application to a Web site.

AsyncRead Enhancements

All Editions The asynchronous operations were enhanced to give more information about the progress and status of the operation, such as how many bytes have currently been read and how many bytes are to be read. New language members include the AsyncReadProgress event, BytesMax property, BytesRead property, Status property (AsyncProperty object), StatusCode property, and Target property; the AsyncRead method and AsyncReadComplete event were enhanced.

Internet Explorer 4.x Download Support for ActiveX Documents

Professional and Enterprise Editions Downloading ActiveX documents in Internet Explorer 4.x now works the same as downloading ActiveX controls — for example, there is support for relative URLs.

What's New in Controls


New Controls
ADO Data Control

All Editions A new OLEDB-aware data source control that functions much like the intrinsic Data and Remote Data controls, in that it allows you to create a database application with minimum code.

Coolbar Control

Professional and Enterprise Editions A container control that can be used to create user-configurable toolbars similar to those in Microsoft Internet Explorer.

DataGrid Control

All Editions An OLEDB-aware version of DBGrid, the control allows you to quickly build an application to view and edit recordsets. It also supports the new ADO Data control.

DataList Control, DataCombo Controls

All Editions These controls are OLE DB versions of the DBList and DBCombo controls. They also support the new ADO Data control.

DataRepeater Control

Professional and Enterprise Editions Insert a UserControl into the DataRepeater to create a custom view of a database, similar to Access forms. The UserControl can contain TextBox, CheckBox, or other controls bound to data fields.

DateTimePicker Control

Professional and Enterprise Editions Place this control on a form when you need to provide a drop-down calendar for quick entry of dates and times. Please read this note on upgrading applications that use the Windows common controls.

Flat Scrollbar Control

Professional and Enterprise Editions Get the elegant look of flat scroll bars in your applications with this new control. Please read this note on upgrading applications that use the Windows common controls.

Hierarchical FlexGrid Control

All Editions An updated version of the FlexGrid control that, in addition to supporting all the functionality of the FlexGrid control, can display a hierarchy of ADO Recordsets. Each Recordset returned is displayed as a separate band within the grid and can be formatted independently.

ImageCombo Control

All Editions Behaves like the standard ComboBox control with one addition: You can now add images to the list of items. Please read this note on upgrading applications that use the Windows common controls.

MonthView Control

Professional and Enterprise Editions Allows the end user to pick dates and contiguous ranges of dates from a graphic representation of a calendar. Please read this note on upgrading applications that use the Windows common controls.

Enhanced Controls
Intrinsic Control Enhancements

All Editions New data-binding properties and data validation enhancements.

ImageList Control Enhancements

All Editions Now supports .gif, .jpg, and .cur files.

ListView Control Enhancements

All Editions

New collection: ListSubItems Collection.

New properties: AllowColumnReorder, CausesValidation, Checkboxes, ColumnHeaderIcons, FlatScrollBar, FullRowSelect, GridLines, HotTracking, HoverSelection, Picture, PictureAlignment, Position Property (ColumnHeader Object), TextBackground.

New events: ItemCheck, Validate.

MSChart Control Enhancements

Professional and Enterprise Editions Now supports data binding and the IObjectSafety interface.

New properties: CausesValidation, DataMember, DataSource, OLEDragMode, OLEDropMode.

New method: OLEDrag.

New events: OLECompleteDrag, OLEDragDrop, OLEDragOver, OLEGiveFeedback, OLESetData, OLEStartDrag, Validate.

ProgressBar Control Enhancements

All Editions

New properties: Orientation, Scrolling.

New method: Refresh.

Slider Control Enhancements

All Editions

New properties: CausesValidation, Text, TextPosition.

New event: Validate.

TabStrip Control Enhancements

All Editions

New properties: CausesValidation, HighLighted Property (Tab Object), HotTracking, MultiSelect, Placement, Separators, TabMinWidth, TabStyle.

New method: DeselectAll.

New event: Validate.

Toolbar Control Enhancements

All Editions

New object/collection: ButtonMenu Object, ButtonMenus Collection.

New properties: DisabledImageList, HotImageList, Style, TextAlignment.

New events: ButtonDropDown, ButtonMenuClick.

TreeView Control Enhancements

All Editions

New properties: CausesValidation, Checkboxes, FullRowSelect, HotTracking, Scroll, SingleSel.

New events: NodeCheck, Validate.

New Features of Controls
Data Validation Enhancements

All Editions Using the new Validate Event in conjunction with the CausesValidation Property allows you to validate control contents before allowing the control to lose focus.

Dynamic Control Addition

All Editions Programmatically add and remove controls to or from a form. A sample application demonstrating dynamic control addition can be found in the \CtlsAdd subdirectory of the samples directory. For information about Visual Basic samples and where to find them, see the Samples Start Page.

LoadPicture Enhancements

All Editions You can now specify size and color depth.

ValidateControls Method

All Editions Validates the contents of the last control on the form before exiting the form.

What's New in Component Creation


Create Your Own Data Consumers

Professional and Enterprise Editions You can create data consumers, based on a UserControl or class, that support complex binding capabilities.

Create Your Own Data Sources

Professional and Enterprise Editions You can create your own data sources, based on a UserControl or class.

Project Start Options

All Editions New F5 options allow you to choose where to run a component for debugging purposes — for example, running a control in a browser instead of in a Visual Basic form.

Lightweight UserControls

Professional and Enterprise Editions You can create windowless and transparent UserControls, which require fewer resources.

Array Enhancements

All Editions Procedures can now return arrays, which means that your classes can have arrays as properties. You can also assign the entire contents of one array to another array, as long as the array on the left side of the assignment is a dynamic array.

Class Persistence

All Editions Class properties can be persisted to a PropertyBag for storage and retrieval.

Support for Managing ClassIDs/Compatibility

Professional and Enterprise Editions Project compatibility now maintains Class IDs between versions of ActiveX components.

Validation Events for UserControls

Professional and Enterprise Editions The Validate event allows you to validate a control’s data before the LostFocus event is fired.

Apartment-model Threading

Professional and Enterprise Editions Create ActiveX components that use apartment-model threading to execute procedures asynchronously on separate threads. (New for Visual Basic 5.0 Service Pack 2.)

Class Builder Utility Enhancements

Professional and Enterprise Editions Supports ParamArray, Optional, ByVal, and Default values in the argument list and supports Enums.

CreateObject Function Enhancement

All Editions A new argument allows you to create objects on remote machines.

Data Object Wizard

Professional and Enterprise Editions Automates creating middle-tier objects bound to the Data Environment or UserControls.

FontChanged Event

All Editions Provides notification to your ActiveX control when font characteristics are changed by an external source.

Microsoft Transaction Server Support

Professional and Enterprise Editions The new MTSTransactionMode property allows you to specify the transactional behavior of a class used in conjunction with the Microsoft Transaction Server.

HasDC Property

All Editions Determines whether a user control allocates a fixed hDC for its lifetime rather than using a shared hDC as needed.


What's New in Wizards


Setup Wizard Enhancements

All Editions The Package and Deployment Wizard (formerly the Setup Wizard) lets you deploy your .cab file to a Web server, network share, or other folder. The new wizard incorporates data access support for ADO, OLE DB, RDO, ODBC, and DAO as well as support for the new IIS and DHTML applications. It also features better control over Start menu groups and icons for your setup program. The new wizard can be run from within Visual Basic as an add-in, or via the command line, as part of a batch process.

Data Object Wizard

Professional and Enterprise Editions Automates creating middle-tier objects bound to the Data Environment or UserControls.

Data Form Wizard Enhancements

Professional and Enterprise Editions Now gives you the ability to build code-only forms where controls are not bound to a data control. It allows you to use ADO code. The wizard is integrated with the Application, Chart, and FlexGrid wizards.

Application Wizard Enhancements

All Editions Now lets you save your settings as profiles for later use, allowing you to create multiple applications with the same format. You can also launch the Data Form Wizard and the Toolbar Wizard from within the Application Wizard to create dataforms and toolbars. Menus are now completely customizable.

Add-In Designer

Professional and Enterprise Editions Allows you to begin development by easily specifying your add-in's default load behavior, name, target application and version, and other properties if desired.

Class Builder Utility Enhancements

Professional and Enterprise Editions Supports ParamArray, Optional, ByVal, and Default values in argument list and supports Enums.

Toolbar Wizard

All Editions When you have the Application Wizard loaded, the Toolbar Wizard automatically opens when you add a toolbar to a form so that you can create customized toolbars.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top