'Access'에 해당되는 글 3건
- [2008/08/29] [ITFIND 메일진] 제361호
- [2008/01/30] 눈길가는 블로그 아티클 [1월 넷째주]
- [2007/07/10] ADO Connection Strings
저도 가지고 싶어 지네요;;
구글이 뉴욕타임즈를 사고, 네이버가 조선일보를 산다면?
재미있네요... 사실적인 이야기가 될 수도 있겠네요 ㅋ
Secure Coding in C and C++
다음 책 구매할 시 사야겠네요...
파일의 백업, 싱크, 암호화를 간편하게 - Toucan
이런거 만들어 보려고 계획했었는데... 멋진게 나와있었군요;
웹 캘린더 (Web Calendar)
지금은 구글 캘린더를 쓰고 있는데... 다음 캘린더도 괜찮네요...
종이로 CD 케이스 만들수 있게 프린트 해주는 사이트 - paper cd case
이럴수가... 이거 완전 유용한걸요? ㅋㅋ
[정의] 웹 2.0(Web 2.0)의 의미를 생각해보자!
깔끔하게 정리하셨네요 ^^
천박한 이명박과 이건희는 빌 게이츠 본받아야...
인간이 극복해야할 6가지 결점
행복해지는 습관 12가지
손금, 한번 파헤쳐보자~!
손금에 관심이 많은데... 손금 관련 서적도 하나 구매해 봐야겠다.
예술적인 네트워크라인 작업
저도 학교안에서 일하면서 자주 접했던 네트워크 라인 작업인데...
이렇게 매력적으로도 구축이 가능하군요? 헐!
텍스트큐브 1.6 베타 프리뷰
이제 테터툴즈에서 텍스트큐브로 넘어가야 할텐데...
스킨 때문에 고민이네요. 하나 직접 만들어 보려고 하는데...
내가 아이팟을 사용할 수밖에 없는 이유 6가지
세계맥주 순위 1위~10위
왠만한건 다 먹어봤는데... 중국 맥주는 안먹어봤네요; ㅋ
Wubi - 우분투를 한방에 설치하자
동아리에서 리눅스 가르쳐 줄때 항상 불편했는데... 이렇게 간단한 방법이 있었군요!
세계 10대 검색엔진 랭킹 발표!!!
NHN이 6위네요? 이럴수가;;
블로그의 전문성과 네트워크의 발달
정보꼬뮨님 글을 정말 잘 쓰시는 것 같다.
MS Access SQL Injection Cheat Sheet
SQL Injection 해킹 관련 자료, zxarps.exe Cain & Abel 등
DBCC 명령어 - 데이터베이스, 테이블, 인덱스, 카탈로그, 파일그룹 관리
학위논문 검색 및 활용하기 1: 국내편
학위논문 검색 및 활용하기 2: 해외편
굉장히 유용한 정보가 될 거 같아요.
NHN도 IPTV 서비스 시작!!!
시작했군요! NHN ㅋㅋ
Naver Lab... 흥미로운 시도군요.
재미있는게 많이 있네요 ㅋㅋ
Brand is Relationship
깔끔하게 정리되어있는게 좋네요.
Overview
Generally, one of the first steps when you are trying to work with databases is open it. You can find several types of those, and each have a different mode of connection. When you try to connect with your database sometimes, you don't know the correct connection string that you must use. It is for that I wrote this article. I wanted to compile the connection strings to the majority of known databases...
ODBC DSN Less Connection
ODBC Driver for dBASE
strConnection = _T("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;"
"Dbq=c:\\DatabasePath;");
Note: You must specify the filename in the SQL statement... For example:
CString strQuery = _T("Select Name, Address From Clients.dbf");
ODBC Driver for Excel
strConnection = _T("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;"
bq=C:\\DatabasePath\\DBSpreadSheet.xls;DefaultDir=c:\\databasepath;");
ODBC Driver for Text
strConnection = _T("Driver={Microsoft Text Driver (*.txt; *.csv)};"
"Dbq=C:\\DatabasePath\\;Extensions=asc,csv,tab,txt;");
If you are using tab delimited files, you must create the schema.ini file, and you must inform the Format=TabDelimited option in your connection string.
Note: You must specify the filename in the SQL statement... For example:
CString strQuery = _T("Select Name, Address From Clients.csv");
Visual FoxPro
If you are using a database container, the connection string is the following:
strConnection = _T("Driver={Microsoft Visual Foxpro Driver};UID=;"
ourceType=DBC;SourceDB=C:\\DatabasePath\\MyDatabase.dbc;Exclusive=No");
If you are working without a database container, you must change the SourceType parameter by DBF as in the following connection string:
strConnection = _T("Driver={Microsoft Visual Foxpro Driver};UID=;"
"SourceType=DBF;SourceDB=C:\\DatabasePath\\MyDatabase.dbc;Exclusive=No");
ODBC Driver for Access
strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"
"Dbq=c:\\DatabasePath\\dbaccess.mdb;Uid=;Pwd=;");
If you are using a Workgroup (System database): you need to inform the SystemDB Path, the User Name and its password. For that, you have two solutions: inform the user and password in the connection string or in the moment of the open operation. For example:
strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"
"Dbq=C:\\VC Projects\\ADO\\Samples\\AdoTest\\dbTestSecurity.mdb;"
"SystemDB=C:\\Program Files\\Microsoft Office\\Office\\SYSTEM.mdw;"
"Uid=Carlos Antollini;Pwd=carlos");
or may be:
strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"
"Dbq=C:\\VC Projects\\ADO\\Samples\\AdoTest\\dbTestSecurity.mdb;"
"SystemDB=C:\\Program Files\\Microsoft Office\\Office\\SYSTEM.mdw;");
if(pDB.Open(strConnection, "DatabaseUser", "DatabasePass"))
{
DoSomething();
pDB.Close();
}
If you want to open in Exclusive mode:
strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"
"Dbq=c:\\DatabasePath\dbaccess.mdb;Exclusive=1;");
ODBC Driver for SQL Server
For Standard security:
strConnection = _T("Driver={SQL Server};Server=MyServerName;"
"Trusted_Connection=no;"
"Database=MyDatabaseName;Uid=MyUserName;Pwd=MyPassword;");
For Trusted Connection security (Microsoft Windows NT integrated security):
strConnection = _T("Driver={SQL Server};Server=MyServerName;"
"Database=myDatabaseName;Uid=;Pwd=;");
Also, you can use the parameter Trusted_Connection that
indicates that you are using the Microsoft Windows NT Authentication
Mode to authorize user access to the SQL Server database. For example:
strConnection = _T("Driver={SQL Server};Server=MyServerName;"
"Database=MyDatabaseName;Trusted_Connection=yes;");
If the SQL Server is running in the same computer, you can replace the name of the server by the word (local) like in the following sample:
strConnection = _T("Driver={SQL Server};Server=(local);"
"Database=MyDatabaseName;Uid=MyUserName;Pwd=MyPassword;");
If you want to connect with a remote SQL Server, you must inform the address, the port, and the Network Library to use:
The Address parameter must be an IP address and must include the port. The Network parameter can be one of the following:
dbnmpntwWin32 Named PipesdbmssocnWin32 Winsock TCP/IPdbmsspxnWin32 SPX/IPXdbmsvinnWin32 Banyan VinesdbmsrpcnWin32 Multi-Protocol (Windows RPC)
For more information, see Q238949.
strConnection = _T("Driver={SQL Server};Server=130.120.110.001;"
"Address=130.120.110.001,1052;Network=dbmssocn;Database=MyDatabaseName;"
"Uid=myUsername;Pwd=myPassword;");
ODBC Driver for Oracle
For the current Oracle ODBC driver from Microsoft:
strConnect = _T("Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;"
"Uid=MyUsername;Pwd=MyPassword;");
For the older Oracle ODBC driver from Microsoft:
strConnect = _T("Driver={Microsoft ODBC Driver for Oracle};"
"ConnectString=OracleServer.world;Uid=myUsername;Pwd=myPassword;");
ODBC Driver for MySQL
If you want to connect to a local database, you can use a connection string like the following:
strConnect = _T("Driver={MySQL ODBC 3.51 Driver};Server=localhost;"
"Database=MyDatabase;User=MyUserName;Password=MyPassword;Option=4;");
If you want to connect with a remote database, you need to specify the name of the server or its IP in the Server parameter. If the Port is distinct to 3306 (default port), you must specify it.
strConnect = _T("Driver={mySQL ODBC 3.51 Driver};Server=MyRemoteHost;"
"Port=3306;Option=4;Database=MyDatabase;Uid=MyUsername;Pwd=MyPassword;");
The parameter Option can be one or more of the following values:
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 then MySQL returns '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 puttingMYSQL_DEBUG=d:t:O,c::\myodbc.login 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- PadCHARfields 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). This will make all function names keywords!8192- Connect with named pipes to a MySQLd server running on NT.16384- ChangeLONGLONGcolumns toINTcolumns (some applications can't handleLONGLONG).32768- Return 'user' asTable_qualifierandTable_ownerfrom 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 and use Option= 1030;.
For more information, go to MyODBC Reference Manual.
ODBC Driver for AS400
strConnect = _T("Driver={Client Access ODBC Driver (32-bit)};System=myAS400;"
"Uid=myUsername;Pwd=myPassword;");
ODBC Driver for SyBase
strConnect = _T("Driver={Sybase System 10};Srvr=MyServerName;Uid=MyUsername;"
"Pwd=myPassword;");
ODBC Driver for Sybase SQL AnyWhere
strConnect = _T("ODBC;Driver=Sybase SQL Anywhere 5.0;"
"DefaultDir=C:\\DatabasePath\;Dbf=C:\\SqlAnyWhere50\\MyDatabase.db;"
"Uid=MyUsername;Pwd=MyPassword;Dsn=\"\";");
DSN Connection
ODBC DSN
strConnect = _T("DSN=MyDSN;Uid=MyUsername;Pwd=MyPassword;");
OLE DB Provider
OLE DB Provider for SQL Server
For Standard security:
strConnect = _T("Provider=sqloledb;Data Source=MyServerName;"
"Initial Catalog=MyDatabaseName;"
"User Id=MyUsername;Password=MyPassword;");
For Trusted Connection security (Microsoft Windows NT integrated security):
strConnect = _T("Provider=sqloledb;Data Source=MyServerName;"
"Initial Catalog=MyDatabaseName;"
"Integrated Security=SSPI;");
If you want to connect to a "Named Instance" (SQL Server 2000), you must to specify Data Source=Servere Name\Instance Name like in the following example:
strConnect = _T("Provider=sqloledb;Data Source=MyServerName\MyInstanceName;"
"Initial Catalog=MyDatabaseName;User Id=MyUsername;Password=MyPassword;");
If you want to connect with a SQL Server running on the same computer, you must specify the keyword (local) in the Data Source like in the following example:
strConnect = _T("Provider=sqloledb;Data Source=(local);"
"Initial Catalog=myDatabaseName;"
"User ID=myUsername;Password=myPassword;");
To connect to SQL Server running on a remote computer (via an IP address):
strConnect = _T("Provider=sqloledb;Network Library=DBMSSOCN;"
"Data Source=130.120.110.001,1433;"
"Initial Catalog=MyDatabaseName;User ID=MyUsername;"
"Password=MyPassword;");
OLE DB Provider for MySQL (By Todd Smith)
strConnection = _T("Provider=MySQLProv;Data Source=test");
Where test is the name of MySQL database. Also, you can replace the name of the database by the following connection string: server=localhost;DB=test.
OLE DB Provider for AS400
strConnect = _T("Provider=IBMDA400;Data source=myAS400;User Id=myUsername;"
"Password=myPassword;");
For more information, see: Using the OLE DB Provider for AS/400 and VSAM.
OLE DB Provider for Active Directory
strConnect = _T("Provider=ADSDSOObject;User Id=myUsername;Password=myPassword;");
For more information, see: Microsoft OLE DB Provider for Microsoft Active Directory Service.
OLE DB Provider for DB2
If you are using a TCP/IP connection:
strConnect = _T("Provider=DB2OLEDB;Network Transport Library=TCPIP;"
"Network Address=130.120.110.001;"
"Initial Catalog=MyCatalog;Package Collection=MyPackageCollection;"
"Default Schema=MySchema;User ID=MyUsername;Password=MyPassword;");
If you are using APPC connection:
strConnect = _T("Provider=DB2OLEDB;APPC Local LU Alias=MyLocalLUAlias;"
"APPC Remote LU Alias=MyRemoteLUAlias;Initial Catalog=MyCatalog;"
"Package Collection=MyPackageCollection;Default Schema=MySchema;"
"User ID=MyUsername;Password=MyPassword;");
For more information, see: Using the OLE DB Provider for DB2.
OLE DB Provider for Microsoft Jet
- Connecting to an Access file using the JET OLE DB Provider:
Using Standard security:
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\DatabasePath\\MmDatabase.mdb;"
"User Id=admin;Password=;");If you are using a Workgroup (System database):
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 recordset. If"HDR=No", the provider will include the first row of the cell range (or named ranged) into the recordset.For more information, see: Q278973.
- Connecting to a Text file using the JET OLE DB Provider:
strConnect =
_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\DatabasePath\\;"
"Extended Properties=\"\"text;"
"HDR=Yes;FMT=Delimited;\"\";");Note: You must specify the filename in the SQL statement... For example:
CString strQuery = _T("Select Name, Address From Clients.txt");For more information, see: Q262537.
- Connecting to an Outlook 2000 personal mail box using the JET OLE DB Provider: (By J. Cardinal)
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 open it which shows all the fields available. Blank
MAPILEVELindicates top level of folders). - Connecting to an Exchange mail box through JET: (By J. Cardinal)
strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;Exchange 4.0;"
"MAPILEVEL=Mailbox - Pat Smith|;DATABASE=C:\\Temp\\;")You must replace c:\temp with any temporary folder.
Replace Pat Smith with the name of the mail box and you must keep vertical pipe character | to indicate top level of 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:
CString strQuery = _T("SQL "SELECT Contacts.* FROM Contacts;");For more information, see: The Jet 4.0 Exchange/Outlook IISAM.
OLE DB Provider for ODBC Databases
If you want to connect with a Microsoft Access database:
strConnect = _T("Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};"
"Dbq=c:\\DatabasePath\\MyDatabase.mdb;Uid=MyUsername;Pwd=MyPassword;");
If you want to connect with a SQL Server database:
strConnect = _T("Provider=MSDASQL;Driver={SQL Server};Server=MyServerName;"
"Database=MyDatabaseName;Uid=MyUsername;Pwd=MyPassword;");
If you want to use DSN:
strConnect = _T("Provider=MSDASQL;PersistSecurityInfo=False;"
"Trusted_Connection=Yes;"
"Data Source=MyDSN;catalog=MyDatabase;");
For more information, see: Microsoft OLE DB Provider for ODBC.
OLE DB Provider for OLAP
Microsoft® OLE DB for Online Analytical Processing (OLAP) is a set of objects and interfaces that extends the ability of OLE DB to provide access to multidimensional data stores.
strConnect = _T("Provider=MSOLAP;Data Source=MyOLAPServerName;"
"Initial Catalog=MyOLAPDatabaseName;");
Connection using HTTP:
This feature enables a client application to connect to an Analysis
server through Microsoft® Internet Information Services (IIS) by
specifying a URL in the Data Source property
in the client application's connection string. This connection method
allows PivotTable® Service to tunnel through firewalls or proxy servers
to the Analysis server. A special Active Server Pages (ASP) page, Msolap.asp,
enables the connection through IIS. The directory in which this file
resides must be included as part of the URL when connecting to the
server (for example, http://www.myserver.com/myolap/).
Using a URL
strConnect = _T("Provider=MSOLAP;Data Source=http://MyOLAPServerName/;"
"Initial Catalog=MyOLAPDatabaseName;");
Using SSL
strConnect = _T("Provider=MSOLAP;Data Source=https://MyOLAPServerName/;"
"Initial Catalog=MyOLAPDatabaseName;");
For more information, see: OLE DB for OLAP, Connecting Using HTTP.
OLE DB Provider for Oracle
OLE DB Provider for Oracle (from Microsoft)
The Microsoft OLE DB Provider for Oracle allows ADO to access Oracle databases.
strConnect = _T("Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;"
"Password=myPassword;");
For more information, see: Microsoft OLE DB Provider for Oracle.
OLE DB Provider for Oracle (from Oracle).
For Standard security:
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;"
"User Id=myUsername;Password=myPassword;");
For a Trusted connection:
- OS Authenticated connect setting user ID to "/":
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;"
"User Id=/;Password=;"); - OS Authenticated connect using OSAuthent:
strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;")Note: "
Data Source=" must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.

[전송통신] 통신사업자의 기업 민첩성(Business Agility) 실현을 위해 SDP를 넘어 SDF로!
디지털정보법률자료실 2008년8월3주 신착자료


::: 사람과 사람의 교감! 人터넷의 첫 시작! 댓글을 달아주세요! :::