Product Documentation

c-treeDB API for C# - Developers Guide

Previous Topic

Next Topic

CTTable.Attach

Attaches a c-tree Plus ISAM datno object to a c-tree.NET table object.

Declaration

void CTTable.Attach(NINT datno);

Description

CTTable.Attach() attaches a c-tree ISAM datno object to a c-treeDB .NET table object. This function is useful if you have opened a data and index file using one of c-tree’s ISAM open functions and need to attach it to a table handle to use advanced c-treeDB .NET features such as alter table or record and field handling. datno is data file number opened with one of the c-tree ISAM open functions.

Return

void

Example


CTSession hSession(CTSESSION_CTREE);

CTTable hTable(hSession);

CTRecord hRecord(hTable);

NINT datno, count = 0;

// logon to c-tree

hSession.Logon(SERVER, USER, PASSWD);

// open the file using c-tree ISAM

datno = (NINT)OPNRFILX((COUNT) -1, "test309.dat", (COUNT)0, NULL);

// attach to table

hTable.Attach(datno);

// read the records

if (hRecord.First())

do

{

count++;

}

while (hRecord.Next());

// cleanup

hTable.Detach();

hSession.Logout();

See Also

CTTable.AttachXtd(), CTTable.Detach()

TOCIndex