PRB: No Error On Invalid SetDefaultWorkspace in VB 4.0 (129880)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q129880 SYMPTOMS
Executing the SetDefaultWorkspace command with invalid parameters does not
generate any error until a Database is opened or a Workspace is created.
However, in Visual Basic version 3.0, this error is generated by the
SetDefaultWorkspace statement.
The SetDefaultWorkspace statement establishes the user ID and password for
protected (security-enabled) Microsoft Jet databases. If you aren't using a
protected database, this statement is ignored.
CAUSE
In Visual Basic version 3.0, the SetDefaultWorkspace command immediately
attempted to verify the parameters passed to it for the current session. In
Visual Basic 4.0, the Username and Password parameters passed to the
SetDefaultWorkspace statement set properties on the DBEngine object. These
properties are not applied until a Workspace is created or a Database is
opened.
RESOLUTION
The SetDefaultWorkspace statement is included in Visual Basic version 4.0
for compatibility with earlier versions. For Visual Basic version 4.0
applications, Microsoft recommends that you use the properties of the
Workspace object instead. See the "Example Resolution" section near the end
of this article for an example.
STATUS
This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | kbprb KB129880 |
---|
|