INF: How and Where to Place VBSQL.VBXLast reviewed: April 30, 1997Article ID: Q121881 |
The information in this article applies to:
SUMMARYThis article explains the function VBSQL.VBX, where to place it, when to load it, and when to unload it from memory.
MORE INFORMATIONThere are a few basic rules you need to know when using the VBSQL.VBX to create a Visual Basic Program for SQL Server (VBSQL). The VBSQL.VBX does several things. It provides a simple way to trap SQL Server errors and messages coming back from the SQL Server to the VB SQL Server front-end. With out the VBSQL.VBX in an application on a form you could not trap any SQL Server errors or messages. The error and message handlers in DB-Library (DB-Lib) are call back functions, and they are implemented in the VBSQL.VBX as events VBSQL1_Error and VBSQL1_Message. The placement of the VBSQL.VBX instance in an application is very important. The rules for placement are as follows:
NOTE: Even though there should never be more that once instance of the VBSQL.VBX in any one project, it is OK to have more that one application running at a time on the same workstation using the VBSQL.VBX; as long as there is one VBSQL.VBX per project. It is not possible to share Database Processes (DBPROCs) between separate executables. The VBSQL.VBX maps a very large percentage of DB-Lib calls directly to VB from W3DBLIB.DLL. The VBSQL.VBX takes care of that fact that VB does not support C declared (CDECL) functions. Visual Basic for Windows only supports Pascal calls and DB-Library (W3DBLIB.DLL) exports its functions in C. The VBSQL.VBX make that transition from Pascal to C. It also automatically handles the allocation of memory in Visual Basic for results coming back from the SQL Server. In addition to memory allocation, the VBSQL.VBX also automatically coverts all data coming back from the SQL Server to the front-end from char, int, money, etc. to a standard Visual Basic string.
|
Additional query words: usage golden how to GPF error message Windows NT
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |