Closed Thread Icon

Preserved Topic: ASP Connection to Oracle Database Pages that link to <a href="https://ozoneasylum.com/backlink?for=21008" title="Pages that link to Preserved Topic: ASP Connection to Oracle Database" rel="nofollow" >Preserved Topic: ASP Connection to Oracle Database\

 
Author Thread
Genevieve
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" %>
<HTML>
<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)
connCW.open()
Dim orsDReader as OleDB.OleDBDataReader = daCW.ExecuteReader()
Do while orsDReader.Read()=True
myLabel1.text =orsDReader("person_id")
myLabel2.text =orsDReader("f_name")
Loop
connCW.close()
End Sub

</script>
<body>
<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>
</form>
</body>
</HTML>


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

Thanks again!

Genevieve

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).]

fizgig
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