
4.REFERENCING THE DATABASE USER CUSTOMIZE B-75074EN/04
- 440 -
Procedure for writing data
The basic procedure for writing data to the database is described below.
NOTE
The i CELL database is a read-only database. Do
not write data, and do no modify the design and data
of the tables. Otherwise, the i CELL can
malfunction.
However, WKPCPlan - workpiece machining count
setting table, WKPCDspMcnCnd - progress status
display table, and WKPCDspLastState - machining
end state display table allow data modification and
addition. Do not modify the data of these tables and
do not add data to these table when the Workpieces
Process Result screen is displayed. Otherwise, the
screen may not be displayed normally.
For details, see Chapter 3, "DATABASE
SPECIFICATIONS".
1 Declare object variables.
Dim tWS As Workspace
Dim tCon As Connection
Dim tRdSt As Recordset
Dim tSQL As String
2 Create an ODBCDirect work space.
Set tWS = CreateWorkspace("", "admin", "", dbUseODBC)
Use the CreateWorkspace method for creation.
By specifying the definition constant dbUseODBC in the
argument Type, an ODBCDirect work space can be created.
When a work space is created with the CreateWorkspace method,
the method returns the Workspace object. By using the Set
statement, store the object in the object variable tWS.
3 As the cursor driver, specify the ODBC cursor library.
tWS.DefaultCursorDriver = dbUseODBCCursor
As a method target object, specify the created Workspace object
tWS.
4 Make a connection to the database.
Set tCon = tWS.OpenConnection(
"iCELL", dbDriverComplete, False,
"ODBC;DSN=iCELL;DATABASE=iCELL.mdb")
To make a connection, use the OpenConnection method.