web 2.0

How to use ASP & Oracle Get Field Name

How to use ASP & Oracle Get Field Name This is tutorial asp developers how to using ASP get field name from a Oracle database.

ShotDev Focus:
- ASP & Oracle Get field name from table.

Example

asp_oracle_list_table.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim Conn,strSQL,objRec,arrField
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "Driver={Oracle in OraHome92};DBQ=TCDB;UID=myuser;PWD=mypassword;"
strSQL = "SELECT * FROM CUSTOMER"
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
Response.write "<b>Table CUSTOMER have "& objRec.Fields.Count &" Fields.</b><br>"
For Each arrField In objRec.Fields
Response.write arrField.NAME & "<br>"
Next

objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_oracle_list_table.asp

Screenshot

ASP & Oracle (Get Table Properties)
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.