¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > Connection - Connection °³Ã¼

µî·ÏÀÏ : 2017-07-04 16:58 Á¶È¸¼ö : 53,726

¿À´ÃÀº °£´ÜÇÑ Connection °³Ã¼ÀÇ ¿¬°á ¿¹Á¦¸¦ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

5.2.1 ODBC Connection ¿¹Á¦ (MS_SQL , Access)

Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open ("DSN=DSNÀ̸§;UID=¾ÆÀ̵ð;PWD=Æнº¿öµå")
¶Ç´Â
DbCon.Open "DSNÀ̸§","¾ÆÀ̵ð","Æнº¿öµå"


¿©·¯ºÐµµ ÀÚÁÖ »ç¿ëÇϽô ¿¹Á¦ ÀÌÁö¿ä?

ODBC¸¦ ÀÌ¿ëÇؼ­ µðºñ¿Í ¿¬°áÇÏ´Â ¿¹Á¦ ÀÔ´Ï´Ù.

5.2.2 OLE-DB Áö¿ø, ODBC¸¦ »ç¿ëÇÏ´Â °æ¿ì(MS_SQL , Access)

1) MS_SQL
Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open ("Driver={SQL Server}; Server=DB¼­¹öÀ̸§; Database=µ¥ÀÌÅͺ£À̽ºÀ̸§; UID=¾ÆÀ̵ð; PWD=Æнº¿öµå")


2) Access

Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open ("Driver={Microsoft Access Driver (*.mdb)};DBQ=mdb ÆÄÀÏÀÇ ½ÇÁ¦ °æ·Î")


5.2.3 OLE-DB ¸¦ ÀÌ¿ë ÇÑ Connection

1) MS-SQL

Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open ("Provider=SQLOLEDB;User ID=¾ÆÀ̵ð;Password=Æнº¿öµå;Initial Catalog=µ¥ÀÌÅͺ£À̽º À̸§;Data Source=µ¥ÀÌÅͺ£À̽º¼­¹öÀ̸§")


¶Ç´Â,

Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Provider = "SQLOLEDB" DbCon.ConnectionString = "SERVER=203.111.111.11; Database=GGBBS; UID=ggbbs; PWD="
DbCon.Open


2) MS-Access

Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=mdb ÆÄÀÏ ½ÇÁ¦°æ·Î")


3) Oracle

objCnn.CursorLocation = adUseClient objCnn.ConnectionString = "Provider=MSDAORA.1;User ID=xxx ;Data Source=xxx;User Id=xx;PASSWORD=xxx;" objCnn.Open

4) Excel ÆÄÀÏ

Set objConn = Server.CreateObject("ADODB.Connection")
strConn = "Driver={Microsoft Excel Driver (*.xls)}; DBQ=c:\inetpub\wwwroot\Excel\test.xls" objConn.Open strConn



¿©·¯ºÐµµ ¸¹ÀÌµé »ç¿ëÇϽô Connection °³Ã¼¿¡ »ç¿ë ¿¹Á¦¸¦ Á¤¸®Çؼ­ ¿Ã·È½À´Ï´Ù.

¿©±â¿¡¼­´Â °£´ÜÇÑ ¿¹Á¦¸¸ ³ª¿­ÇØ º¸¾Ò´Âµ¥¿ä.

´ÙÀ½Àå¿¡¼­´Â Connection °³Ã¼¿¡ »ç¿ëµÇ¾î Áö´Â ¼Ó¼ºÀÌ ¹«¾ùÀÌ ÀÖÀ¸¸ç, ¾î¶°ÇÑ ±â´ÉÀÌ ÀÖ´ÂÁö ÀÚ¼¼È÷

¾Ë¾Æº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.
 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.