520 likes | 656 Views
웹 프로그래밍 HTML, 자바스크립트 , ASP 를 중심으로. 12 주 . ADO 컴포넌트 2. 최황규 , 하진영 공저. What is ADO?. Microsoft technology A ctiveX D ata O bjects Automatically installed with Microsoft IIS Programming interface to access data in a database. Accessing a Database from an ASP Page.
E N D
웹 프로그래밍HTML, 자바스크립트, ASP를 중심으로 12주.ADO 컴포넌트 2 최황규, 하진영 공저
What is ADO? • Microsoft technology • ActiveX Data Objects • Automatically installed with Microsoft IIS • Programming interface to access data in a database
Accessing a Database from an ASP Page • Create an ADO connection to a database • Open the database connection • Create an ADO recordset • Open the recordset • Extract the data you need from the recordset • Close the recordset • Close the connection
준비 작업 "dbo.Students"를 오른쪽 버튼 클릭한 후 "상위 200개행 편집" 선택 테이블 내용 확인
실행 • html, asp 파일들을 inetpub\wwwroot 디렉토리에 저장하고 웹브라우저로 읽음 • http://localhost/xxx.asp
RecordSet • When you first open a Recordset • Record pointer will point to the first record • BOF and EOF properties are False • (If there are no records, • BOF and EOF property are True)
ODBC 설정 (10주 자료 반복)
10.9 ODBC 설정 • ODBC (Open DataBase Connectivity) • DBMS에 관계없이 윈도우 환경하에 데이터베이스에 연결하여 사용할 수 있도록 개발한 표준 • 데이터베이스에 연결하기 위해 DSN 설정이 필요 • DSN (Data Source Name) • 데이터가 있는 곳을 알려주는 이름
10.9 ODBC 설정 • 제어판->관리도구->데이터원본으로 시작
10.9 ODBC 설정 • ‘시스템 DSN 설정’ 탭 선택
10.9 ODBC 설정 • ‘SQL Server’항목 선택 후 마침
10.9 ODBC 설정 • 데이터 원본에 사용할 이름 ‘WebDB’를 사용 • 연결할 SQL Server 를 (local)로 지정 (local)\SQLEXPRESS .\SQLEXPRESS IP_address\SQLEXPRESS
10.9 ODBC 설정 • ‘사용자가 입력한 로그인 ID 및 암호를 사용하는 SQL Server 인증 사용’ 선택 • 로그인 ID (sa)와 암호 설정
10.9 ODBC 설정 • ‘기본 데이터베이스를 다음으로 변경’ 체크 후 WebDB 선택
10.9 ODBC 설정 • SQL Server 시스템 메시지 언어를 Korean으로 선택하고 마침