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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO CONNECT ORACLE 8I WITH HTML

Status
Not open for further replies.

bhavin12300

Programmer
Oct 12, 2006
24
IN
HI.
ANYONE CAN SUGGESE ME THAT HOW TTO CONNECT ORACLE 8I DATABASE WITH A HTML FORM.
I AM BUILDING APPLICAION IN HTML SO I NEES TO CONNECTE MY ORACLE 8I DATABASE WITH MY HTML FORM AND ALSO WANT TO STORE THAT DATA WHICH ARE ENETRED IN A FORM TO DATABASE.

if anyone wants more detail ask me.
i be waiting for your answer.
 
Hi,
This is not a simple process and will need more than HTML to work unless your version of Oracle is running the Oracle HTTP components - then you can build a web app using Oracle's built in functions.

HTML alone will not have the ability to connect to Oracle ( or any other ) database, for that you will need coding ( VB or Javascript are the most often used)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
can you suggese me how can i make it.
which to use to connect to database for my aaplication as above.
 
Hi,
Far to many steps to post here..
There are many examples in the Oracle docs and on the web..


Try, for a start, a Google advanced search for the phrase "access Oracle Data" as an exact phrase and 'Web' as a Must have word

Also try :

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
If your running IIS then it is fairly simple to connect Oracle to a web page. I don't exactly know how many ways there are but there are a lot.

For example:
Code:
<html>
<head>
</head>
<body>
<form method="post" action="sqltest.asp" id="frmSQL">
	<table style="font-family: arial; font-size: 8pt;">
	<tr>
	<td>SQL Statement</td><td><input type="Text" id="txtSQL" name="txtSQL" size="100" value="<%=Request.form("txtSQL")%>"></td>
	</tr>
	<tr>
	<td>Database</td><td><input type="text" id="txtDbase" name="txtDbase" value="<%=Request.form("txtDbase")%>"></td>
	</tr>
	<tr>
	<td>User ID</td><td><input type="text" id="txtUserID" name="txtUserID" value="<%=Request.form("txtUserID")%>"></td>
	</tr>
	<tr>
	<td>Password</td><td><input type="Password" id="txtPassword" name="txtPassword" value="<%=Request.form("txtPassword")%>"></td>
	</tr>
	<tr>
	<td colspan="2"><input type="Submit"></td>
	</tr>
	</table>
</form>
<%
if len(Request.form("txtSQL")) > 0 then
dim cn, rs, i, cString

set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.Createobject("ADODB.Recordset")

cString = "DistribTx=0;Data Source=" & Request.form("txtDbase") & ";User ID=" & Request.form("txtUserID") & ";Password=" & Request.form("txtPassword") & ";"


with cn
	.Provider = "ORAOLEDB.Oracle"
	.Connectionstring = cString
	.open
end with

dim sql
sql = Request.form("txtSQL")
rs.open sql, cn,3,3

if rs.eof = true then
	Response.write "No Data in recordset"
else
	rs.movefirst
%>
<table border="1" style="font-family: arial; font-size: 8pt;">
	<tr bgcolor="#a4a4a4" style="font-weight: bold;">
	<%
	for i = 0 to rs.fields.count - 1
	%>
	<td><%= rs.fields(i).name %></td>
	<%
	next
	%>
	</tr>
	<%
	do until rs.eof = true
	%>
	<tr>
	<%
	for i = 0 to rs.fields.count - 1
	%>
	<td><%=rs.fields(i).value %></td>
	<%
	next
	%>
	</tr>
	<%
	rs.movenext
	loop
	%>
</table>
<%
end if
end if
%>
</body>
</html>

Copy the above code into a text file named sqltest.asp. Place that in your inetpub directory on the webserver, assuming it is IIS, and call it up using


You will see a form that will allow you to put an instance, username, password, and SQL statement then show you the results in table format. For sake of speed I suggest using rownum < 50 in your where clause if you are trying grab a table.

This language is called ASP. I know you can do it with a variety of languages compiled and script. PHP, ASP.Net, Python, Javascript, VBScript, C#, C++, Java, etc...

Really a matter of preference.

Cassidy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top