My SQL DB Á¢¼Ó
DB ¹é¾÷¹Þ±â
¹é¾÷¹ÞÀº DB Ç®±â
 
MS-SQL Á¢¼ÓÇϱâ
Connection °´Ã¼ »ý¼º¹æ¹ý
Äõ¸® ºÐ¼®±â Á¢¼Ó¹æ¹ý
dts °¡Á®¿À±â/³»º¸³»±â
 
MS-SQL À» ÀÌ¿ëÇؼ­ µ¥ÀÌŸ ¿¬°áÀ» ÇÒ ¶§ ÀÌ¿ëµÇ´Â ¼Ò½º¸¦ ¾Ë·Á µå¸³´Ï´Ù.
 
DSN¿¡ ¼³Á¤¿¡ »ç¿ëÇß´ø Á¤º¸µéÀ» ¿¬°á¹®ÀÚ¿­¿¡ ±×´ë·Î »ç¿ëÇÕ´Ï´Ù.
¨ç SQLServerIP´Â ¸¶ÀÌÆäÀÌÁö¿¡¼­ ½ÅûÇϽŠȣ½ºÆà ³»¿ªÀ» È®ÀÎÇϽøé ÁöÁ¤µÈ MS-SQL ¼­¹öÀÇ ¾ÆÀÌÇǸ¦ È®ÀÎ ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
¨è DBNameÀº È£½ºÆà ½Åû½Ã µî·ÏÇϽŠDB ¾ÆÀ̵𸦠ÀÔ·ÂÇϽðí, DB¾ÆÀ̵ð ¹× DB Æнº¿öµå´Â µî·ÏÇϽŠ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã¸é µË´Ï´Ù.
Set DbCon = Server.CreateObject("ADODB.Connection")
ConnString =
"Driver={SQL Server};Server=SQLServerIP;Database=DBName;UID=DB¾ÆÀ̵ð;PWD=DBÆнº¿öµå;"
DbCon.open ConnString
Set Rs = Server.CreateObject("ADODB.Recordset")
ConnString =
"Driver={SQL Server};Server= SQLServerIP;Database= DBName;UID= DB¾ÆÀ̵ð;PWD= DBÆнº¿öµå;"
SQL = "Select * from Å×À̺íÀ̸§"
Rs.open SQL, ConnString
 
OLEDB´Â ¿¬°á¹®ÀÚ¿­À» »ç¿ëÇÕ´Ï´Ù.
¨ç SQLServerIP´Â ¸¶ÀÌÆäÀÌÁö¿¡¼­ ½ÅûÇϽŠȣ½ºÆà ³»¿ªÀ» È®ÀÎÇϽøé ÁöÁ¤µÈ MS-SQL ¼­¹öÀÇ ¾ÆÀÌÇǸ¦ È®ÀÎ ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
¨è DBNameÀº È£½ºÆà ½Åû½Ã µî·ÏÇϽŠDB ¾ÆÀ̵𸦠ÀÔ·ÂÇϽðí, DB¾ÆÀ̵ð ¹× DB Æнº¿öµå´Â µî·ÏÇϽŠ¾ÆÀ̵ð¿Í ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã¸é µË´Ï´Ù.
1. Connection °´Ã¼
Set DbCon = Server.CreateObject("ADODB.Connection")
ConnString = "Provider=SQLOLEDB;Data Source=SQLServerIP;Initial Catalog=DBName;User
ID=DB¾ÆÀ̵ð;Password=DBÆнº¿öµå;"
DbCon.open ConnString

2. Recordset °´Ã¼
Set Rs = Server.CreateObject("ADODB.Recordset")
ConnString = "Provider=SQLOLEDB;Data Source=SQLServerIP;Initial Catalog=DBName;User
ID=DB¾ÆÀ̵ð;Password=DBÆнº¿öµå;"
SQL = "Select * from Å×À̺íÀ̸§"
Rs.open SQL, ConnString