본문 바로가기
소프트웨어/ASP / JS / CSS / C#

objRS 간단 사용 예제

by 씨디맨 2007. 10. 23.
320x100


// 예제 1
if(objRS.EOF){

   Response.Write("테이블이 비었습니다");

}else{

   while(!objRS.EOF){

      Response.Write(objRS('user'));

      objRS.MoveNext();

   }


}




// 예제 2

DBOpen();
var objRS = Server.CreateObject("ADODB.RecordSet");
var strSQL = "SELECT Pid FROM Table";
objRS.Open(strSQL, objDBCon, 0, 1);

Response.Write(objRS(0));
objRS = Null;

var strSQL = "INSERT INTO Table (Num, Pid) VALUES (1,"2");
objDBCon.Execute(strSQL);


objRS.Close();
objRS = Null
DBClose();

반응형

댓글