DBConnect Method

Opens a connection to a data source. Corresponds to the DBConnect action.

Using the DBConnect method establishes the physical connection to a data source. After this action successfully completes, the connection is live and you can issue commands against it and process the results.

App.DBConnect(Name, ServerType, ConnectString)

Client support

   Newlook Smartclient

   Newlook Server

Arguments

Name - (Object, Required)

A name that you assign to the connection object that represents the connection to the data source. The connection will be referred to by this name in all subsequent DB actions. For example, your Connection name might be "CustDBConnection".

ServerType - (Integer, Required)

The type of data source to which you are connecting. Use one of the pre-defined Server constants.

Connect String - (Input, String, Required)

This parameter consists of semi-colon separated name/value pairs that specify the database or server and all relevant connection properties. The contents of the connection string can vary, depending upon the data source or server that is used for the connection. Each name/pair value is formatted as 'name=value'. For example:'Provider=Microsoft.Jet.OLEDB.4.0;DataSource=@test\crm.mdb'.

A string specifying the database connection details. This parameter consists of semi-colon separated name/value pairs that specify the database and all relevant connection properties. The contents of the connection string can vary, depending upon the data source or server that is used for the connection. For ADO connections, use the Datalink Properties tool in the Database Description window to create the connection string (see tip box below)/server.

Each name/pair value is formatted as so: 'name=value'. Eg.'Provider=Microsoft.Jet.OLEDB.4.0;DataSource=@test\crm.mdb'.

TIP!

For assistance in creating a database connection string, use the database description window from the Tools menu. This tool can be used to construct the Connection String automatically based on the values entered into the various fields. Copy and paste the resulting connection string from the macro editor into your script, remembering to enclose the string in quotation marks. For more detailed information refer to the topic Using the database description window to create a connection.

Returns

This method returns an object with a Name property set to the string specified in the Name argument.

Applies To

App object

See Also

Open Method | Disconnect Method | Close Method | Find Method | Move Method | AddNew Method | BeginTrans Method | CancelUpdate Method | CommitTrans Method | Delete Method | RollbackTrans Method | Seek Method | Update Method | ConnectionString property | DB Connection object | Data Access


© 2004-2021 looksoftware. All rights reserved.