Creating a Connection String
The first step in creating a Web data application is to provide a way for ADO to locate and identify your data source. This is accomplished by means of a connection string, a series of semicolon delimited arguments that define parameters such as the data source provider and the location of the data source. ADO uses the connection string to identify the OLE DB provider and to direct the provider to the data source. The provider is a component that represents the data source and exposes information to your application in the form of rowsets.
The following table lists OLE DB connection strings for several common data sources:
Data Source OLE DB Connection String
Microsoft® Access Provider=Microsoft.Jet.OLEDB.4.0;Data Source=physical path to .mdb file
Microsoft SQL Server Provider=SQLOLEDB.1;Data Source=path to database on server
Oracle Provider=MSDAORA.1;Data Source=path to database on server
Microsoft Indexing Service Provider=MSIDXS.1;Data Source=path to file
To provide for backward compatibility, the OLE DB Provider for ODBC supports ODBC connection string syntax. The following table lists commonly used ODBC connection strings:
Data Source Driver ODBC Connection String
Microsoft Access Driver={Microsoft Access Driver (*.mdb)};DBQ=physical path to .mdb file
SQL Server DRIVER={SQL Server};SERVER=path to server
Oracle DRIVER={Microsoft ODBC for Oracle};SERVER=path to server
Microsoft Excel Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file; DriverID=278
Microsoft Excel 97 Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file;DriverID=790
Paradox Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
Text Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=physical path to .txt file
Microsoft Visual FoxPro® (with a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDb=physical path to .dbc file
Microsoft Visual FoxPro (without a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=physical path to .dbf file
Note Connection strings that use a UNC path to refer to a data source located on a remote computer can pose a potential security issue. To prevent unauthorized access of your data source, create a Windows account for computers requiring access to the data and then apply appropriate NTFS permissions to the data source.
The first step in creating a Web data application is to provide a way for ADO to locate and identify your data source. This is accomplished by means of a connection string, a series of semicolon delimited arguments that define parameters such as the data source provider and the location of the data source. ADO uses the connection string to identify the OLE DB provider and to direct the provider to the data source. The provider is a component that represents the data source and exposes information to your application in the form of rowsets.
The following table lists OLE DB connection strings for several common data sources:
Data Source OLE DB Connection String
Microsoft® Access Provider=Microsoft.Jet.OLEDB.4.0;Data Source=physical path to .mdb file
Microsoft SQL Server Provider=SQLOLEDB.1;Data Source=path to database on server
Oracle Provider=MSDAORA.1;Data Source=path to database on server
Microsoft Indexing Service Provider=MSIDXS.1;Data Source=path to file
To provide for backward compatibility, the OLE DB Provider for ODBC supports ODBC connection string syntax. The following table lists commonly used ODBC connection strings:
Data Source Driver ODBC Connection String
Microsoft Access Driver={Microsoft Access Driver (*.mdb)};DBQ=physical path to .mdb file
SQL Server DRIVER={SQL Server};SERVER=path to server
Oracle DRIVER={Microsoft ODBC for Oracle};SERVER=path to server
Microsoft Excel Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file; DriverID=278
Microsoft Excel 97 Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file;DriverID=790
Paradox Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
Text Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=physical path to .txt file
Microsoft Visual FoxPro® (with a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDb=physical path to .dbc file
Microsoft Visual FoxPro (without a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=physical path to .dbf file
Note Connection strings that use a UNC path to refer to a data source located on a remote computer can pose a potential security issue. To prevent unauthorized access of your data source, create a Windows account for computers requiring access to the data and then apply appropriate NTFS permissions to the data source.
'KB > MFC/Win32' 카테고리의 다른 글
[DB] ODBC 데이타소스 생성하기 (DSN 생성) (0) | 2004.04.28 |
---|---|
[winsock] Winsock2 오버랩 완료루틴 소켓 (0) | 2004.04.28 |
OLE자동화_작업전환다시시도안나타나게 (0) | 2004.04.28 |
네트워크 접속 방법 (0) | 2004.04.28 |
[MSDN] 코드 최적화 (0) | 2004.04.28 |