
B-75074EN/04 USER CUSTOMIZE 4.REFERENCING THE DATABASE
- 441 -
Specify a data source name in the argument Name, and specify a
real data source name in the argument Connect. For a data source
name and real data source name of the
i CELL, refer to Chapter 3,
"DATABASE SPECIFICATIONS". A connection is made with
read/write authority granted, by specifying False in the argument
ReadOnly.
When a connection is made to the database, the method returns the
Connection object. By using the Set statement, store the object in
the object variable tCon.
5 As a character string, create an SQL statement.
tSQL = (SQL statement as a character string)
By using a command such as the UPDATE command and the
INSERT INTO command, create an SQL statement for writing
data.
6 With the created SQL statement, open the record set.
Set tRdSt = tCon.OpenRecordset(tSQL)
The OpenRecordset method is used to open the record set.
In the argument, specify the created SQL statement character
string. As a method target object, specify the created Connection
object tCon.
When the record set is opened, the SQL statement specified in the
argument is executed to write to the database. The method returns
the Recordset object. By using the Set statement, store the object
in the object variable tRdSt.
7 Close the record set.
tRdSt.Close
Use the Close method to close the opened record set.
8 Disconnect the connection with the database.
tCon.Close
Use the Close method to disconnect the connection.
9 Free the ODBCDirect work space.
tWS.Close
Use the Close method to free the created work space.