Closed Thread Icon

Preserved Topic: ASP Connection to Oracle Database (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Preserved Topic: ASP Connection to Oracle Database (Page 1 of 1)" rel="nofollow" >Preserved Topic: ASP Connection to Oracle Database <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Inmate

From: Santa Clara, CA, USA
Insane since: Jul 2002

posted posted 03-10-2003 02:54

My group is trying to connect our Oracle database to our Website using ASP...since that's what the TA told us to do, that's what we're doing. Anywho, we're having mega problems with simply connecting it, much less using it call functions, etc. Here's what we've got so far, any help would definately be appreciated!

<%@ Page Language="VBScript" %>
<%@ import namespace = "System.Data" %>
<%@ import namespace = "System.Data.Sqlclient" %>
<script runat="server">
Sub Page_Load(Sender as Object, E As EventArgs)
Dim connCW as OleDb.OleDbConnection
Dim daCW as OleDb.OleDbCommand
connCW=New OleDb.OleDbConnection("Provider=OraOLEDB.Oracle.1; User ID=xxxxx; Password=xxxxx; Data Source=omisdb;")
daCW=New OleDb.OleDbCommand("Select person_id, f_name from person",connCW)
Dim orsDReader as OleDB.OleDBDataReader = daCW.ExecuteReader()
Do while orsDReader.Read()=True
myLabel1.text =orsDReader("person_id")
myLabel2.text =orsDReader("f_name")
End Sub

<form runat="server" ID="Form1">
<b>person_id</b> <asp:label id="myLabel1" runat="server" />
<p><b>f_name</b> <asp:label id="myLabel2" runat="server" /></p>

The above works except it only returns one value instead of all values in the db. We can't figure out why.

Thanks again!


Wowzers! o.O

Visit my cell! 754

[This message has been edited by Genevieve (edited 03-10-2003).]

[This message has been edited by Genevieve (edited 03-10-2003).]

Nervous Wreck (II) Inmate

From: West Bloomfield MI
Insane since: Aug 2001

posted posted 03-11-2003 20:08

You are resetting the value of the same item over and over again, it probably just displays the last record, you need to create a new label for each record, or just write it out without a label

« BackwardsOnwards »

Show Forum Drop Down Menu