CodeCharge Studio

DB<connectionname> Variable (ASP)

Applies to

Page Context

Type

object (clsDB<connectionname>)

Access

read-only

Syntax

DB<connectionname>.<member>...

Description

This global variable is declared at the beginning of the page to represent each database connection used within the page. The Connection object encapsulates the implementation details used to establish a database connection (i.e. database name, location, user login/password, etc).

The database connection variable can be used to perform custom database operations (e.g. it is used as the fourth argument of the CCDLookUp function). The name of the database connection object is created by prepending the connection name (configured in the CCS environment) with the prefix "DB". (e.g. for a connection called Internet within CodeCharge Studio, the corresponding variable name for the connection object will be DBInternet).

Example

This code executes custom SQL query against the database connection. It inserts a row into logging table with the current user's identifier and a date. This code can be used in any event (such as login form's On Click).
Dim SQL
  SQL = "INSERT INTO login_log(user_id, login_date) VALUES (" & DBConnection1.ToSQL(CCGetUserID(), ccsInteger) & "," & DBConnection1.ToSQL(Now(), ccsDate) & ")"
  DBConnection1.Execute (SQL)

See also

Connection Object
Execute Method


On-line, printable versions and updates