Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 12

VB6 did add a handful of extra string functions such as Split, Replace, InstrRev,

etc., as well as a handful of new controls such as the ImageCombo and MonthView.

Nothing major, but a couple of these "nice to haves" were added.

When I changed form VB5 to VB6, the biggest difference I noticed, was ADO.
It was possible to use ADO with VB5, however VB6 was 'aimed at ADO'
====> Before I get flamed from all directions <=========
I concede for the experiienced programmers it makes little difference, as they
could use either version of VB with ADO.
However for the less experienced (I was once), the fact that VB6's bound controls
were intended to bind to ADO, would make a big difference.

I wouldn't use a bound control now, if my life depended on it. So all those who are
of the same ilk, don't flame me

you could write a module to replace the functions in vb6 that were not available in
vb5, if you really wanted to run the programs in vb5. it would be hard to do if it
used controls that are not in vb5 though

Array enhancements. Functions and properties can return arrays. You can also
directly copy one array into another if the left hand side array is a dynamic
array.

Class persistancy. One very good thing that I often use is the ability to persist
the state of a class between runs, using the new Content property of the
PropertyBag object.

CallByName. The ability to call methods and public properties by name.

CreateObject enhancements. You can create objects on a remote computer.

Custom Data consumers and Data sources. VB6 allows you to create your own custom
data consumers and data sources.

Lightweight UserControls. In VB6 you can create windowless and transparent controls
that use much less resources.

Support for transactions VB6 added the support to specify the transactional
behaviour of an object running in MTS.

IIS and DHTML applications. In VB6 you can create both IIS applications and DHTML
applications very easily.

Some of the above mentioned enhancements are only available in the Pro and
Enterprise versions of VB6.

I use VB5, and the most annoying thing I hate when downloading VB6 projects from
the internet is when their class modules have this:

VB Code:
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
End
So for the love of God, please remove these from your class modules because the
people who use VB5 can't run the code without getting an error on these lines.

Another thing is a line in the .vbp files from VB6, which is this:

Yes there is very little difference between the two. Just a few more functions that
have been added. Class modules now have those annoying 6 lines of code on top.
Functions and subs located in class modules are allowed to contain UDT's (User
Defined Types), the exe's are a tiny bit bigger (hello world app is 6k on VB5 yet
7k on VB6), and the .vbp file has some extra lines, such as Retained=0, and on rare
occasions DebugStartUpOption=0.

Other than that, they are very similar.

Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _


(pDest As Any, pSrc As Any, ByVal lByteLen As Long)
' + ArrayPtr ++++++++++++++++++++++++Rd+
' This function returns a pointer to the
' SAFEARRAY header of any Visual Basic
' array, including a Visual Basic string
' array.
' Substitutes both ArrPtr and StrArrPtr.
' This function will work with vb5 or
' vb6 without modification.
Public Function ArrayPtr(Arr) As Long
' Thanks to Francesco Balena and Monte Hansen
Dim iDataType As Integer
On Error GoTo UnInit
CopyMemory iDataType, Arr, 2& ' get the real VarType of the argument,
this is similar to VarType(), but returns also the VT_BYREF bit
If (iDataType And vbArray) = vbArray Then ' if a valid array was passed
CopyMemory ArrayPtr, ByVal VarPtr(Arr) + 8&, 4& ' get the address of the
SAFEARRAY descriptor stored in the second half of the Variant parameter that has
received the array. Thanks to Francesco Balena.
End If
UnInit:
End Function
' ++++++++++++++++++++++++++++++++++++++
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.

---------------------------------------------------------
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 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 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,FlatScr
ollBar,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,OLEStartD
rag,Validate.

ProgressBar Control Enhancements

All Editions
----------------------------------------------------------
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
theAsyncReadProgress event,BytesMax property,BytesRead property,Status property
(AsyncProperty object),StatusCode property, andTarget property; theAsyncRead method
andAsyncReadComplete 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.

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 theSamples 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 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.

19

I found the answer in Using ADO with SQL Server Native Client.

To enable the usage of SQL Server Native Client, ADO applications will need to
implement the following keywords in their connection strings:

Provider=SQLNCLI11

DataTypeCompatibility=80
The following is an example of establishing an ADO connection string that is fully
enabled to work with SQL Server Native Client, including the enabling of the MARS
feature:

Dim con As New ADODB.Connection

con.ConnectionString = "Provider=SQLNCLI11;" _
& "Server=(local);" _
& "Database=AdventureWorks;" _
& "Integrated Security=SSPI;" _
& "DataTypeCompatibility=80;" _
& "MARS Connection=True;"
con.Open

https://blogs.sap.com/2016/01/23/building-your-framework-to-work-with-sap-b1-part-
1/

You need to mark the methods you want and the class as public to be visible in
other projects that are referencing your dll/assembly (other methods must use other
access modifiers to be hidden).
From Microsoft's documentation:

public: The type or member can be accessed by any other code in the same assembly
or another assembly that references it.
private: The type or member can be accessed only by code in the same class or
struct.
protected: The type or member can be accessed only by code in the same class, or in
a class that is derived from that class.
internal: The type or member can be accessed by any code in the same assembly, but
not from another assembly.
protected internal: The type or member can be accessed by any code in the assembly
in which it's declared, or from within a derived class in another assembly.
private protected: The type or member can be accessed only within its declaring
assembly, by code in the same class or in a type that is derived from that class.

You have to specify the right accessor on each method. For example:

public void Do() means it is accessable from other projects to (so for all)
internal void Do() means that this function is only accessable inside the project
private void Do() means the function is only callable inside the same class
So you have to choose one of them.

You might also like