How to use ASP & Oracle Connect to Database This is tutorial asp developers how to using asp connect to Oracle database.
ShotDev Focus:
- ASP & Oracle (Connect to Database)
Example
asp_oracle_connect.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% On Error Resume Next '*** Not Show ASP Error ***' Dim Conn1 Set Conn1 = Server.Createobject("ADODB.Connection") Conn1.Open "Driver={Oracle in OraHome92};DBQ=TCDB;UID=myuser;PWD=mypassword;" If Err.Number <> 0 Then Response.write("(Oracle in OraHome92) Database cannot connect Error = " & Err.Description&"<br>") Else Response.write("(Oracle in OraHome92) Database connected.<br>") End If Conn1.Close() Set Conn1 = Nothing Dim Conn2 Set Conn2 = Server.Createobject("ADODB.Connection") Conn2.Open "mydatabase","myuser","mypassword" If Err.Number <> 0 Then Response.write("(ODBC) Database cannot connect Error = " & Err.Description&"<br>") Else Response.write("(ODBC) Database connected.<br>") End If Conn2.Close() Set Conn2 = Nothing %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_oracle_connect.asp
Screenshot
2viewpicture…
…