User Tools

Site Tools


prop_connectstring.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Runtime VIEW and FILE Properties >====== PROP:ConnectString ====== Previous pageReturn to chapter overviewNext page

Property of a FILE using the ODBC driver that returns the connection string (normally stored in the file's OWNER attribute) that would allow a complete connection. If the OWNER attribute contains only a data source name, a login screen appears to ask for the rest of the required details before the connection is made. This login window appears every time you log on. With this property, the developer can enter information in the login screen once, then set the OWNER attribute to the return value from PROP:ConnectString, eliminating the login.

Example:

OwnerString  STRING(20)

Customer FILE,DRIVER('ODBC'),OWNER(OwnerString)

Record    RECORD

Name      STRING(20)

    . .

CODE

OwnerString = 'DataSourceName'

OPEN(Customer)

OwnerString = Customer{PROP:ConnectString}     !Get full connect string

MESSAGE(OwnerString)               !Display it for future use

prop_connectstring.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1