ado|excel| Connection Database | String ADO Connection Database string Encyclopedia (vp,excel, Text, Sybase,. NET, etc.)
This page contains sample ADO connection strings for ODBC dsn/dsn-less,
OLE DB Providers, remote Data Services (RDS), Ms Remote, Ms Datashape.
Also included are ado.net connection strings for each. NET Managed
(SQLClient, OLE DB, and ODBC).
These sample connection strings are compiled
By Carl Prothman, a Microsoft Visual Basic MVP
enjoy!
Table of Contents
ODBC DSN Connections DSN
File DSN
ODBC dsn-less connections ODBC Driver for as/400
ODBC Driver for Access
ODBC Driver for DBASE
ODBC Driver for Excel
ODBC Driver for MySQL
ODBC Driver for Oracle
ODBC Driver for Paradox
ODBC Driver for SQL Server
ODBC Driver for Sybase
ODBC Driver for Sybase SQL Anywhere
ODBC Driver for Text
ODBC Driver for Teradata
ODBC Driver for Visual FoxPro
OLE DB Data Link connections Data link File (UDL)
OLE DB Data Provider connections OLE DB Provider for as/400
OLE DB Provider for Active Directory Service
OLE DB Provider for DB2
Old DB Provider for Internet Publishing
OLE DB Provider for Index Server
OLE DB Provider for Microsoft Jet
OLE DB Provider for ODBC Databases
OLE DB Provider for Oracle (from Microsoft)
OLE DB Provider for Oracle (from Oracle)
OLE DB Provider for simple Provider
OLE DB Provider for SQL Server
Remote data Service (RDS) connections RDS Data Control-connect property
RDS Data Control-url Property
ADO URL Connections ADO Recordset
Ms Remote Provider Connections Ms Remote-access (JET)
MS Remote-sql Server
Data Shape Provider connections MS datashape-sql Server
. NET Managed Provider connections SQL Client. NET Managed Provider (System.Data.SqlClient)
OLE DB. NET Managed Provider (System.Data.OleDb)
ODBC. NET Managed Provider (System.Data.ODBC)
ODBC DSN Connections
Using an ODBC DSN (Data Source Name) is a two the step process.
1 must the DSN via the "ODBC Data Source Administrator" program
Found in your computer's control Panel (or administrative Tools menu in Windows 2000).
Make sure to create a SYSTEM DSN, not a USER DSN, when using ASP.
Note:you can also create the DSN via VB code.
2) Then Use the following connection String-with your own DSN name of course. ;-)
Odbc-dsn
oConn.Open "Dsn=advworks" & _
"Uid=admin;" & _
"Pwd=;
You can also create and use a File DSN. Then Use the following ADO Connection string:
Odbc-file DSN
oConn.Open "Filedsn=c:\somepath\mydb.dsn" & _
"Uid=admin;" & _
"Pwd=;"
For more information, see:about ODBC data sources and
How to use File DSNs and dsn-less connections
Note:the problem with DSN was that Users can (and would) modify them (or delete by mistake),
Then your program won ' t work ... So it's better to use a dsn-less or OLE DB Provider
Connection string with a Trusted connection if possible!
ODBC dsn-less Connections
ODBC Driver for as/400
oConn.Open "Driver={client Access ODBC Driver (32-bit)};" & _
"SYSTEM=MYAS400;" & _
"Uid=myusername;" & _
"Pwd=mypassword;"
For more information, see:a Fast Path to as/400 client/server
ODBC Driver for Access
For Standard Security:
oConn.Open "Driver={microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=admin;" & _
"Pwd=;"
If you are using a Workgroup (System database):
oConn.Open "Driver={microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"SYSTEMDB=C:\SOMEPATH\MYDB.MDW;", _
"Admin", "" "
If MDB is located on a network share:
oConn.Open "Driver={microsoft Access Driver (*.mdb)};" & _
"Dbq=\\myserver\myshare\mypath\mydb.mdb;"
For more information, here: