SAMPLE: Mixed-Language Application (VB, COBOL, SQL)Last reviewed: February 15, 1996Article ID: Q103226 |
The information in this article applies to:
VBCOBSQL: Demonstrates a Mixed-Language (Visual Basic-COBOL-ESQL) Application You can use Microsoft(R) Visual Basic(TM), Microsoft COBOL, and Microsoft SQL Server to build full-featured client-server applications that use the strengths of each product. Visual Basic creates the graphical user interface. Subroutine calls are made in the Basic code to COBOL dynamic-link libraries (DLLs). The COBOL DLL contains Embedded SQL (ESQL) to request the necessary data from the SQL Server. The COBOL DLL manipulates the retrieved data as required, then passes the data back to Visual Basic. In other words, Visual Basic is the graphical front-end and COBOL DLL is the back-end of the client application. VBCOBSQL uses the PUBS database from the SQL Server package. The demo makes several queries to the PUBS database, such as Author Search and List Publications in a Category. It also allows you to insert and delete authors and add new publications to the database. To build VBCOBSQL, you will need Visual Basic version 2.0 Professional Edition, Microsoft COBOL version 5.0 or Micro Focus(R) COBOL version 3.0, and Embedded SQL Toolkit for COBOL. In Visual Basic, load the VBCOBDEM.MAK project and build an .EXE file for the application. Before building the COBOL DLL that accesses SQL Server, make sure that your build environment is set up to build COBOL/SQL Server applications. Set the LIB environment variable to include the drive and path of the following files:
Next, edit the VBCOBSQL.DIR directives file to use your own server, database, user ID, and password. There are two ways to build the DLL:
Before running the demo, make sure that the following files are in your current directory or in your PATH:
VBCOBSQL is a companion application for the "Building VB/COBOL/ESQL Mixed-Language Applications" technical article on the Microsoft Developer Network CD. Download VBCOBSQL.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
|
Additional reference words: 3.10 softlib VBCOBSQL.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |