To develop a DB2 Everyplace application in Visual Basic, you use the DB2
Everyplace CLI/ODBC interface. This topic provides a high-level
overview of the tasks you must complete in order to develop Visual Basic
applications with DB2 Everyplace.
Restrictions
When you develop applications for DB2 Everyplace using Visual Basic,
consider the following restrictions and requirements:
- Do not use the function SQLAllocHandleVer directly in the code of
your application.
SQLAllocHandleVer is used by DB2 Everyplace internally. If you use it
in your application code, it might cause program failures.
- Debugging might not work because of the way Visual Basic loads and handles
calls to functions inside a DLL.
- Visual Basic functions that call DB2 Everyplace functions in
db2e.dll must have the statement "On Error Resume Next",
otherwise the program will not work properly.
Procedure
The basic steps to develop a DB2 Everyplace Visual Basic application
are:
- Create a new Visual Basic project.
- Copy the file db2ecli.bas (from the DB2 Everyplace
Visual Basic project directory) into your project folder, and insert the file
into your Visual Basic project.
- Copy DB2e.dll into your project folder. If
you don't want to place DB2e.dll in your project
folder, modify the path to DB2e.dll in the function
declarations in the db2ecli.bas file.
- Write your own application code. You can use the DB2 Everyplace
sample Visual Basic program to help you.
- Create the executable program for your application by selecting the menu
item File -> Make project.
Pojęcia pokrewne
Informacje pokrewne