1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<% ‘//////////////////// DB접속정보 DBconn.asp ////////////////////////////////// dim db dim db_connect dim db_name dim db_ip dim db_id dim db_pass db_connect=”oledb” db_ip=”111.111.111.111,1111″ db_name=”DBX” db_id=”IDX” db_pass=”PASSX” sub dbconn_sub dim strConnection set db = Server.CreateObject(“ADODB.Connection”) strConnection = “Provider=SQLOLEDB;SERVER=”& db_ip &”;Uid=”& db_id &”;Pwd=”& db_pass &”;Database=”& db_name &”;network library=dbmssocn” db.open strConnection end sub %> <% ‘사용 Option Explicit ‘On Error Resume Next Dim strSql,Rs call dbconn_sub strSQL =”Select top 10 * from DBX” SET Rs=db.Execute(strSQL) if Not(Rs.BOF or Rs.EOF) then Do until Rs.EOF response.write Rs(“C001”) ‘컬럼테스트 Rs.moveNext Loop end if Rs.close:Set Rs=nothing ‘// DB접속끊기 db.close : set db=nothing %> |