Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » Re: Error connecting Oracle in ASP
Re: Error connecting Oracle in ASP [message #76288] Sat, 19 January 2002 02:07
abhishek shrivastava
Messages: 1
Registered: January 2002
Junior Member
server : winnt 4.0 with iis 4.0

dear friends try this code
you will have to make some in oracle database
all the fields should be of type varchar2 else data will not be displayed
<%Set conn = server.createobject("ADODB.Connection")
conn.Open "Driver={ORACLE ODBC DRIVER};uid=x;pwd=x;dbq=stg;dba=r"
set rs = server.createobject("ADODB.Recordset")
rs.open "Select * from vehicles where CITY IN ('" & city & "') AND DIRECTION = '" & direction & "' AND year BETWEEN '" & yearbegin &"' AND '" & yearend & "'",conn
Response.write("Report for " & area & " from " & yearbegin & " to " & yearend & "
")%>

<%do while not rs.eof
Response.write("
- " & rs.fields("YEAR"))
Response.write("
- Month - ")
Response.write(" - Jan - - Feb - - Mar - ")
Response.write(" - Apr - - May - - Jun - - July - ")
Response.write(" - Aug - - Sep - - Oct - ")
Response.write(" - Nov - - Dec -
")
Response.write("
- " & rs.fields("CITY") & " - - " & rs.fields("JAN"))
Response.write(" - - " & rs.fields("FEB") & " - - " & Rs.fields("MAR"))
Response.write(" - - " & rs.fields("APR") & " - - " & rs.fields("MAY"))
Response.write(" - - " & rs.fields("JUN") & " - - " & rs.fields("JUL"))
Response.write(" - - " & rs.fields("AUG") &" - - "& rs.fields("SEP"))
Response.write(" - - " & rs.fields("OCT") &" - - "& rs.fields("NOV"))
Response.write(" - - " & rs.fields("DEC"))
rs.MoveNext
loop%>
all the best
abhishek
Previous Topic: Re: ORACLE CERTIFIED PROFESSIONAL TEST EXAM
Next Topic: Re: ORACLE CERTIFIED PROFESSIONAL TEST EXAM
Goto Forum:
  


Current Time: Wed Dec 07 12:59:53 CST 2022