Navigation: Language Reference > App C - PROP: Runtime Properties > Runtime VIEW and FILE Properties >====== PROP:ConnectString ====== | |
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