Class SQOdbcConnectionFactory

This class creates an ODBC connection to a database. The properties of the connection define how to connect. There are three ways you can specify how to connect: 1) Set the DSN property to the name of the DSN you want to connect to. You may also have to set the UserName and Password properties if those are required. 2) Set the ConnectionString property to the connection string to use. This is sometimes called a DSN-less connection (one that doesn't require a DSN on the user's system.) 3) Set the Driver, Server, Database, UserName, and Password properties to the necessary values as another way of using a DSN-less connection.

System.Object
  Stonefield.Query.ConnectionManagement.ConnectionFactory
    Stonefield.Query.ConnectionManagement.SQOdbcConnectionFactory
public class SQOdbcConnectionFactory : ConnectionFactory, IOdbcConnectionFactory

Class Members

MemberDescription

Constructor

Constructor.

CreateConnection

Uses the connection information stored in this factory to create an appropriate connection object.

public virtual IConnection CreateConnection();

Deserialize

Initialize the connection in this factory using an XML reader pointing to serialized XML data.

public virtual void Deserialize(XmlReader reader);

public virtual void Deserialize(XmlNode node)

Serialize

Writes the connection information stored in this factory to an XML Writer.

public virtual void Serialize(XmlWriter writer);

ConnectionString

The connection string to use to connect to the database.

Driver

The name of the ODBC driver to use. This must be the exact name as displayed in the ODBC Administrator dialog.

DSN

A user or system data source name (DSN) defined on the user's system that connects to the data source.

OtherConnectInfo

Additional information to pass to the ODBC driver. For example, for protected MS Access databases, you have to specify "SystemDB=path for MDW file".

Password

The password to access the database.

Server

The server the database is located on.

Specifier

The name for the attribute specifying the database, such as "database", "datasource", "catalog", etc.

UserName

The user name to access the database.

Requirements

Namespace: Stonefield.Query.ConnectionManagement
Assembly: connections.dll