Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use ASP Application to connect to Oracle Database

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
I am looking for the steps to create a DNS less connection to an oracle database.

I can connect to the database using my tools, and have the necessary things installed, but am looking for a simple way DNS or DNSLess to connect from application to pull a quick count.

Everything I tried has not worked.

Thanks in advance.
 
Here is the sample code. Make sure you fill up the
1. Service name which is in tnsnames.ora file
2. User Code
3. Password

FYI, it works on my system. Make sure you have Net8 Installed on your Webserver.

<html>
<body>
<%
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase("SERVICE Name in TNSNAMES.ORA", "UserCode/Password", Cint(0))
Set OraDynaset = OraDatabase.DbCreateDynaset( _
"SELECT TABLE_NAME FROM USER_TABLES", cint(0))
Response.Write("<form>")
Response.Write("<table><tr><td>")

while OraDynaset.EOF = False
Response.Write OraDynaset("TABLE_NAME")
Response.write "<BR>"
OraDynaset.Movenext
Wend

Response.Write("<tr><td align=center></td></tr>")
Response.Write("</table>")

Response.Write("</form>")

Set OraSession = Nothing
%>
</body>
</html>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top