shop-wiz logo
Follow Us on Facebook Follow Us on Google+ Follow Us on Twitter Follow Us on LinkedIn

'asp로 오라클 연결하기
DbConnect = "Provider=MSDAORA.1;Data Source=oci_source;User ID=oci_id; Password=oci_passwd; Security Info=True"
Set Db = Server.CreateObject("ADODB.Connection")

Db.Open DbConnect

'table 생성 ok
sql=""
sql=sql&"create table test( "&vbLf
sql=sql&" name varchar2(20),"&vbLf
sql=sql&" no number(8) "&vbLf
sql=sql&") "

Response.Write(sql)
db.execute sql

 

'sequence table 생성
CREATE SEQUENCE customers_seq
START WITH 1000
INCREMENT BY 1
NOCACHE
NOCYCLE;

 

'table 삭제 ok
sql="drop table test"&vbLf
db.execute sql

 

'생성된 테이블 보기
sql = "SELECT table_name FROM USER_TABLES"
set list = db.execute(sql)
while not list.eof
Response.Write(list("table_name")&"<br>")
list.movenext
wend

 


' insert문
sql = "INSERT INTO maincount(countstart) values"
sql = sql & "(plus.nextval)"

'입력된 데이타 불러오기
sql = "SELECT * FROM data_brd"
set list = db.execute(sql)
if list.eof then
Response.Write("저장된 데이타가 없습니다")
end if
while not list.eof
Response.Write("title = "&list("title")&"<br>")
list.movenext
wend

 


'실전 데이터 입력하기
sql = "insert into admin_join (admin_idx, admin_id, admin_pwd) values (1,'admin','1234')"
db.execute sql

'set objDBCon = server.createobject("ADODB.Connection")
'objdb.open "ora_test","scott","tiger"

'objdb.execute sql
'objdb.Close
'Set objDBCon = nothing

그리고 rs open시의 db 는 set objDBCon = server.createobject("ADODB.Connection")에서 연결한
이 objDBCon 으로 해주셔야 합니다.
그럴려면
objdb.Close
Set objDBCon = nothing
%>


Powered by shop-wiz since 2002, e-mail:wangta69@naver.com