CodeCharge Studio

ConnectionString Run-Time Property (ASP)

Applies to

Connection Object

Type

string

Access

read/write

Syntax

object.ConnectionString [=value]

Description

This property contains connection string used to establish database connection. This string includes connection type, user credentials, database name or path and some other parameters. The connection string is passed to ADO Connection object when opening.

This property can be modified if some database connection properties are determined during run-time.

For complete connection string syntax refer to ActiveX Data Objects Reference available from Microsoft's website.

Note: For property change to take effect connection object has to be closed and reopened.

Examples

This example modifies connection's ConnectionString property to use MS Access driver and database path extracted from a session variable.

DBConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("DatabasePath")
DBConnection1.Close
DBConnection1.Open

See also

Connection Property


On-line, printable versions and updates