SetProperty Method for LCConnection

This method assigns the value for a connection property.

Defined In

LCConnection

Syntax

Call thisConnection.SetProperty (propertyToken, srcField)

Parameters

Parameter

Description

propertyToken

Long. Token representing the connector property for which the value is to be assigned. See Appendix B for a list of tokens.

srcField

LCField. New value for the connector property. If the property value is of a different type than this field, then data conversion will occur. The property value will be assigned from the first value in the field.

Usage Notes®

It's more efficient, as well as easier, to use the dynamic properties, for example:

thisConnection.Metadata = "adm1.customers"

The SetProperty syntax is useful if the information you need is already in LCField objects, or if you don't know what properties you'll set at the time you write the program.

Example

Option Public
Uselsx "*lsxlc" 

Sub Initialize
  Dim connect As New LCConnection ("oracle") 
  Dim conFld As New LCField (LCTYPE_TEXT, 1)

  ' set appropriate properties to connect to oracle
  conFld.text = "Barker"
  Call connect.SetProperty (LCTOKEN_SERVER, conFld)
  ' example of using the expanded property
  Print "Here is the server property value: " & connect.Server
End Sub

Example Output

Here is the server property value: Barker