2010. 11. 18. 18:14

DB 에서 값 불러와 페이지 보이기 2


Dim strConnect
  strConnect="Provider=SQLNCLI.1;Password=zzzzzzz;Persist Security Info=True;User ID=LEE;Initial Catalog=LEE_DB;Data Source=localhost;"
 set Dbcon=server.CreateObject("ADODB.Connection")
 
 Dbcon.Open strConnect
 
  Set Rs=Server.CreateObject("ADODB.RecordSet")
  SQL="select Table_1 from Lee where num='2'"
 
  Rs.Open SQL, DbCon, 1, 3
 
   ' response.write "gustID"&Rs(0)
  
   if Rs.EOF then
    '값이 없는경우
      else
        '값이 있는경우
          if trim(Rs(0))="값" then
            Response.Write "ok"
          else
            Response.Write "Fail"
          End if
      End if
Trackback 0 Comment 0