ADO Connection Strings: 4,992,958 Members and Growing! (15,377 Online)
ADO Connection Strings: 4,992,958 Members and Growing! (15,377 Online)
ADO Connection Strings: 4,992,958 Members and Growing! (15,377 Online)
(15,377 Sign in
Email Password Rem
online)
HomeAll TopicsMFC/C++C#VB.NETASP.NETSQLArchitect Help! Articles Mess
Database » Database » ADO Intermediate SQL, C
Windo
NT4, W
ADO Connection Strings Visual
Dev
By Carlos Antollini
Posted:
A list of ODBC DSN Connection Strings. Update
Views:
Note: You must specify the filename in the SQL statement... For example:
If you are using tab delimited files, you must create the schema.ini file, and you must inform the Forma
in your connection string.
Note: You must specify the filename in the SQL statement... For example:
Visual FoxPro
If you are using a database container, the connection string is the following:
If you are working without a database container, you must change the SourceType parameter by DBF
connection string:
If you are using a Workgroup (System database): you need to inform the SystemDB Path, the User Na
that, you have two solutions: inform the user and password in the connection string or in the moment o
For example:
or may be:
Also, you can use the parameter Trusted_Connection that indicates that you are using the Microsoft
Authentication Mode to authorize user access to the SQL Server database. For example:
If you want to connect with a remote SQL Server, you must inform the address, the port, and the Netw
The Address parameter must be an IP address and must include the port. The Network parameter can
If you want to connect to a local database, you can use a connection string like the following:
If you want to connect with a remote database, you need to specify the name of the server or its IP in th
the Port is distinct to 3306 (default port), you must specify it.
1 - The client can't handle that MyODBC returns the real width of a column.
2 - The client can't handle that MySQL returns the true value of affected rows. If this flag is set
'found rows' instead. One must have MySQL 3.21.14 or newer to get this to work.
4 - Make a debug log in c:\myodbc.log. This is the same as putting MYSQL_DEBUG=d:t:O,c::\
AUTOEXEC.BAT.
8 - Don't set any packet limit for results and parameters.
16 - Don't prompt for questions even if driver would like to prompt.
32 - Enable or disable the dynamic cursor support. This is not allowed in MyODBC 2.50.
64 - Ignore use of database name in 'database.table.column'.
128 - Force use of ODBC manager cursors (experimental).
256 - Disable the use of extended fetch (experimental).
512 - Pad CHAR fields to full column length.
1024 - SQLDescribeCol() will return fully qualified column names.
2048 - Use the compressed server/client protocol.
4096 - Tell server to ignore space after function name and before '(' (needed by PowerBuilder).
function names keywords!
8192 - Connect with named pipes to a MySQLd server running on NT.
16384 - Change LONGLONG columns to INT columns (some applications can't handle LONGLONG)
32768 - Return 'user' as Table_qualifier and Table_owner from SQLTables (experimental).
65536 - Read parameters from the client and ODBC groups from my.cnf.
131072 - Add some extra safety checks (should not be needed but...).
If you want to have multiple options, you should add the above flags! For example: 16 + 1024 = 1030
DSN Connection
ODBC DSN
strConnect = _T("DSN=MyDSN;Uid=MyUsername;Pwd=MyPassword;");
OLE DB Provider
OLE DB Provider for SQL Server
For Standard security:
If you want to connect to a "Named Instance" (SQL Server 2000), you must to specify Data Source=S
Name\Instance Name like in the following example:
If you want to connect with a SQL Server running on the same computer, you must specify the keywor
Source like in the following example:
Where test is the name of MySQL database. Also, you can replace the name of the database by the fo
string: server=localhost;DB=test.
For more information, see: Using the OLE DB Provider for AS/400 and VSAM.
For more information, see: Microsoft OLE DB Provider for Microsoft Active Directory Service.
OLE DB Provider for DB2
For more information, see: Using the OLE DB Provider for DB2.
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\DatabasePath\\MmDatabase.mdb;"
"User Id=admin;Password=;");
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\DataBasePath\\mydb.mdb;"
"Jet OLEDB:System Database=MySystem.mdw;");
pRs.Open(strConnect, "MyUsername", "MyPassword");
Connecting to an Excel Spreadsheet using the JET OLE DB Provider:
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\DatabasePath\\DBSpreadSheet.xls;"
"Extended Properties=\"\"Excel 8.0;HDR=Yes;\"\";");
Note: If "HDR=Yes", the provider will not include the first row of the selection into the recordse
provider will include the first row of the cell range (or named ranged) into the recordset.
Note: You must specify the filename in the SQL statement... For example:
CString strQuery = _T("Select Name, Address From Clients.txt");
Connecting to an Outlook 2000 personal mail box using the JET OLE DB Provider: (By J
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;Outlook 9.0;"
"MAPILEVEL=;DATABASE=C:\\Temp\\;")
Replace c:\temp with any temporary folder. It will create a schema file in that folder when you
the fields available. Blank MAPILEVEL indicates top level of folders).
Replace Pat Smith with the name of the mail box and you must keep vertical pipe character | to
folders. Place sub folder after vertical pipe if accessing specific folder.
Note: you can enter queries against the mail store just like a database... For example:
strConnect = _T("Provider=MSDASQL;PersistSecurityInfo=False;"
"Trusted_Connection=Yes;"
"Data Source=MyDSN;catalog=MyDatabase;");
Microsoft® OLE DB for Online Analytical Processing (OLAP) is a set of objects and interfaces that ex
DB to provide access to multidimensional data stores.
This feature enables a client application to connect to an Analysis server through Microsoft® Internet I
(IIS) by specifying a URL in the Data Source property in the client application's connection string. T
allows PivotTable® Service to tunnel through firewalls or proxy servers to the Analysis server. A spec
(ASP) page, Msolap.asp, enables the connection through IIS. The directory in which this file resides m
of the URL when connecting to the server (for example, http://www.myserver.com/myolap/).
Using a URL
Using SSL
For more information, see: OLE DB for OLAP, Connecting Using HTTP.
The Microsoft OLE DB Provider for Oracle allows ADO to access Oracle databases.
Note: "Data Source=" must be set to the appropriate Net8 name which is known to the naming
example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the N
For more information, see: Oracle Provider for OLE DB Developer's Guide.
strConnect = _T("Provider=vfpoledb;"
"Data Source=C:\\DatabasePath\\MyDatabase.dbc;");
For more information, see: Microsoft OLE DB Provider for Visual FoxPro.
For more information, see: Microsoft OLE DB Provider for Microsoft Indexing Service.
If you want to create a Data Link File, you can make a new empty text file, change its extension by .ud
the file, and the operating system calls for you the Data Link app.
License
This article has no explicit license attached to it but may contain usage terms in the article text or the d
themselves. If in doubt please contact the author via the discussion board below.
An easy to use .NET library to read/write strong typed data from files with fixed length or delim
Also has support to import/export data from different data storages (Excel, Acces, SqlServer, M
Dynamic... but fast: The tale of three monkeys, a wolf and the DynamicMethod and ILGenerato
How to use the DynamicMethod and ILGenerator classes to create dynamic code at runtime tha
An extremely flexible and easy-to-use library that retrieves data in XML format, supports simp
queries, stored procedures, and transactions. It can also be used as a web service.
Add this article to:
Article Top Sign U
You must Sign In to use this message board.
FAQ Noise Tolerance Searc
How can i connect DBF database file so not depend with name file ????
Sign In·View Thread·PermaLink
The problem is that the old drivers are expecting DOS names -- someone forgot to upgrade them.
characters, you want something like DEMODE~1.DBF. The code below will do that for you:
return shortNameBuffer.ToString();
}
Good luck!
Sign In·View Thread·PermaLink
Thanks in advance.
Softy
Sign In·View Thread·PermaLink
Last Visit: Friday, April 4, 2008 2:51 AM Last Update:Friday, April 4, 2008 2:51 AM
General News Question Answer Joke Rant Admin
Help!
Articles
Message Boards
Lounge
What is 'The Code Project'?
General FAQ
Post a Question
Site Directory
About Us
Latest
Search
Most Popular
Beginner Articles
Topic List
Submit an Article
Update an Article
Article Competition
Visual C++ / MFC
ATL / WTL / STL
COM
Managed C++/CLI
C#
ASP.NET
VB.NET
Web Development
.NET Framework
WPF / WCF / WF
LINQ and .NET 3.5
Silverlight
SQL / ADO / ADO.NET
XML / XSL
OS / SysAdmin
General Discussions
Hardware
Suggestions / Site Bugs
The Soapbox
All Message Boards...