ConnectionString

<< Click to Display Table of Contents >>

Navigation:  Apollo OLEDB > Using Apollo OLEDB >

ConnectionString

ConnectionString is the most important property in Apollo OLEDB.

Sample ConnectionString:

provider  =

"Provider=ApolloOLEDB9.ApolloOLEDB9;" & _

"Data Source = c:\Apollo\9.9\Data\; " & _

"AccessMethod= amLocal; " & _

"TableType=ttSXNTX; " & _

"ConnectionUser=SYSDBA; " & _

"ConnectionPassword=masterkey; " & _

"ConnectionHost=127.0.0.1;" & _

"ConnectionPort=5000;" & _

"CommitLevel = clNormal;" & _

"FetchCount=1;" & _

"SetTables=Clipper.dbf, Clip, ttSXNTX, '', FALSE, 'Clip1.NTX,Clip2.NTX';"

 

The following are the various properties of the ConnectionString:

 

AccessMethod

AccessMethod determines if you wish to connect to the Apollo Database Server. This property is used with the Connection* properties. A setting of amLocal means your application will access data directly and will not be connecting to an Apollo Database Server. A setting of amServer means your application will be connecting to an Apollo Database Server located at the IP address or URL specified by the ConnectionHost property, running on the port number specified by the ConnectionPort property.

AccessMethod = amLocal

AccessMethod = amServer

 

CommitLevel

Determines how Apollo will manage buffers.

 

clFull = Always write data to disk. Flushes both Apollo and Windows buffers. Slowest mode, but most secure.

clNormal = Always flush Apollo buffers but let Windows decide when to write data to disk. Normal mode of operation and recommended.

clNone = Do not flush any buffers, letting Apollo and Windows manage the writing of data to disk. Fastest mode but should be used in single user mode only.

 

Connect Timeout

Specifies how much time to wait on a connection before timing out. A value of zero is unlimited.

Connect Timeout=0

ConnectionHost

Host is used with the Port and AccessMethod properties. Together, they allow you to specify the IP address of where the Apollo Database Server is running. The Apollo Database Server is a product sold separately that enables your Apollo applications to work in client/server mode.

ConnectionHost=127.0.0.1

ConnectionPassword

Used for logging onto an Apollo Database Server. Use with User ID property.

ConnectionPassword=mypassword

ConnectionPort

Port is used with the Host and AccessMethod property. Together, they allow you to specify the port of where the Apollo Database Server is running.

ConnectionPort=5000

ConnectionUser

Represents your user name when connecting to the Apollo Database Server in amServer mode. Use with the Password property.

ConnectionUser=myname

Data Source

The directory where the data files are located

Data Source = c:\data\

FetchCount

Allows you to specify how many records are buffered when accessing data from the Apollo Database Server.

FetchCount=25

IndexName

The index to use with a single table connection.

IndexName=TEST

To specify NTX indexes, see SetTables and the ExtraIndexes clause.

Mode

Specifies read/write properties. Separate using the "|" pipe symbol without quotes:

ReadWrite

Share Deny Read

Share Deny Write

Share Deny None

For exclusive mode, use:

Share Deny Read|Share Deny Write

Mode=ReadWrite

Provider

Standard OLEDB initialization property.

Provider=ApolloOLEDB9.ApolloOLEDB9

SetDeleted

Specifies if records marked for deletion should be displayed. Setting this to False displays deleted records.

SetDeleted=FALSE

SetTables

 

Explicitly specifies the tables used in the query. This is an optional parameter that can be used to specify various table-specific settings such as password. Properties are as follows:

Table Name, Alias, Table Type, Password, Translate, ExtraIndexes

Multiple tables may be separated using the pipe symbol "|" without quotes.

Sample:

SetTables = Test.dbf, test, ttSXFOX, "", FALSE, ""

Sample accessing Clipper table with NTX:

SetTables = Clipper.dbf, Clip, ttSXNTX, '', FALSE, 'Clip1.NTX, Clip2.NTX'"

Sample accessing multiple tables:

SetTables = Test1.dbf, test1, ttSXFOX, '', FALSE, ""|

Test2.dbf, test2, ttSXFOX, '', FALSE, ''

TableType

Select the type of indexes used by your application. Available types:

ttSXFOX: FoxPro tables (DBF/FPT/CDX)

ttSXNSX: HiPer SIx tables (DBF/SMT/NSX)

ttSXNSX_DBT: (DBF/DBT/NSX)

ttSXNTX: (DBF/DBT/NTX)

 

TableType = ttSXFOX