Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle8.1.7 on NT-Problems

Re: Oracle8.1.7 on NT-Problems

From: DriftWood <drift_wood_at_my-deja.com>
Date: Mon, 11 Dec 2000 20:22:28 GMT
Message-ID: <913d1r$s8f$1@nnrp1.deja.com>

In article <910cs2$b5q$02$1_at_news.t-online.com>,   "Sigurd Eckermann" <Sigurd.Eckermann_at_gmx.de> wrote:
<snip>

> Configuration of the ODBC-Connection was ok, it worked with the
> ODBC-Testprogramm.
> How can I easiely test the odbc-connection with ASP or something like
 that ?
> How should the connection string look like ?

This varies by the program doing the ODBC connection, but in general the DSN (Data Source Name) that you configured in the ODBC Administrator and tested with ODBC test is all the connection information that will be needed. Here is an ASP example that selects from the DBA_TRIGGERS view. Note the ConnObj.Open call which has the DSN, username and password:

<!--#include virtual="/ASPSAMP/SAMPLES/ADOVBS.INC"-->
<%

Set ConnObj = Server.CreateObject("ADODB.Connection") Set RstObj = Server.CreateObject("ADODB.Recordset") RstObj.MaxRecords = 10000
%>
<html>

<head>
<title>Triggers Details </title>
<script>

var recCount = 0

</script>
</head>

<body TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000"
ALINK="#FF0000"
background="../../images/FORDOVALWHTTILT.gif">
<div align="center"><center>

<table>

  <tr ALIGN="CENTER" VALIGN="BOTTOM">
    <td><img SRC="../../images/smford.gif" ALT="Ford logo" width="100" height="60"> </td>

    <td VALIGN="TOP"><font SIZE="+3" color="#FF0080">Trigger Details</font></td>
  </tr>
</table>
</center></div>

<hr SIZE="4" align="center">
<%If Request.Form = "" and Request.QueryString = "" then %>

<form name="myForm" Method="POST" <p>

  <big><p>This screen allows you to get Triggers details.</big></p>   <p><big><font color="#FF0000">Step 1: </font>Click on the Node you want to go to :</big></p>
  <p>
  <input type="radio" name="MatchNode" value="CONN1" CHECKED>DB Connection 1 <br>
  <input type="radio" name="MatchNode" value="CONN2">DB Connection 2
<br>

  <input type="radio" name="MatchNode" value="CONN3">DB Connectino 3
<br>

  <input type="radio" name="MatchNode" value="CONN4">DB COnnection 4<br>
  </p>
  <p><big><font color="#FF0000">Step 2:</font> Enter the Trigger Name
to match on (Leave it
  blank to pull all the users): </big><input name="MatchData" size="20"> </p>
  <p><big><font color="#FF0000">Step 3:</font> Click on the Submit button, or Reset button
  to clear everything</big><br>
  <br>
  <input type="submit"> <input type="reset" value="Reset" name="B1"></p>
</form>
<%else%>
<%If (Request.QueryString = "") then

         line1 = "select owner, trigger_name, trigger_type, triggering_event, table_name, status, trigger_body "

         line2 = " from dba_triggers "
         If Request.Form("MatchData") <> "" then
             line3 = " where trigger_name like upper('%" & Request.Form
("MatchData") & "%') order by owner, trigger_name "
         else
             line3 = " order by owner, trigger_name "
         end if
         CommandText = line1 & line2 & line3

         if Request.Form("MatchNode") = "CONN1" then
              ConnObj.Open "DSN=v815;UID=system;PWD=manager"
         end if
         if Request.Form("MatchNode") = "CONN2" then
               ConnObj.Open "DSN=v815;UID=scott;PWD=tiger"
         end if
         if Request.Form("MatchNode") = "CONN3" then
              ConnObj.Open "DSN=MYDSN3;UID=system;PWD=mamager"
         end if
         if Request.Form("MatchNode") = "CONN4" then
              ConnObj.Open "DSN=MYDSN4;UID=scott;PWD=tiger"
         end if

         NodeName = Request.Form("MatchNode")
         RstObj.Open CommandText, ConnObj
         %>

<%if RstObj.EOF then%>

<p align="center"><strong>No Records Found in DBA_TRIGGERS matching <%
=UCase(Request.Form("MatchData"))%></strong></p>
<%else%>
<div align="center"><%If Request.Form("MatchData") <> "" then%>

<p align="center"><strong>Records matching For <%=UCase(Request.Form
("MatchData"))%></strong></p>
<%else%>

<p align="center"><strong>Retreiving All Records </strong></p>
<%end if%>
<div align="center">

<p><strong>Database Trigger info obtained from DBA_TRIGGERS</strong></p>
<div align="center"><div align="center"><center>

<table border="1">

  <tr>

    <th>OWNER</th>
    <th>TRIGGER NAME</th>
    <th>TRIGGER TYPE</th>
    <th>TRIGGER EVENT</th>
    <th>TABLE NAME</th>
    <th>STATUS</th>
    <th>TRIGGER BODY</th>

  </tr>
<%do until RstObj.EOF%>

  <tr>
<% for each field in RstObj.Fields

            if field.Value <> "" then %>     <td><%=field.Value%>
</td>
<%else%>

    <td>NULL</td>
<%end if

next
RstObj.MoveNext%>
  </tr>
  <script>
    recCount=recCount+1
</script>
<%loop%>

</table>
</center></div><script> document.write("<p align='CENTER'><Strong>" +
recCount + " Records Returned</Strong></p>")
</script>
</div><%RstObj.Close

ConnObj.Close%>
<%end if%>
<%end if%>
<%end if%>

<hr SIZE="4" align="center">

<p align="center"><a href="http://www.ktp.ford.com/"><img
src="../../images/hometruck.jpg"
alt="KTP Home Page" border="0" width="100" height="71"></a></p>

<p align="center">This page developed by <a
href="http://hub.ford.com:8081/ldap.cgi?name=sprasad4&amp;cds=%2bCDS% 2bLookup%2b">Sunil
Prasad</a></p>

<p align="center">This page last updated on <!--webbot bot="Timestamp"
S-Type="EDITED"
S-Format="%m/%d/%y" --></p>
</div></div>
</body>
</html>

--
-cheers
  DW
--------------------------------------------------------------------
"It is a kind of good deed to say well; and yet words are not deeds.
  -William Shakespeare"


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Dec 11 2000 - 14:22:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US