Click to See Complete Forum and Search --> : Re: asp to oracle connection error.


Mike
03-14-2000, 05:00 PM
What is the error?

"Moshea" <moshea@talk21.com> wrote:
>
>Hi all.
>
>I've created a simple script with a SQL statement to an Oracle database
and
>non-surprisingly, it gives me error. Thus, I've debugged the script and
>checked that connection can successfully be made. Hence, I thought that
>the error should be somewhere else. Every time when I made some changes
>on the script, I can reload it, unless I reboot the machine. Can you PLEASE
>help?????
>
>The script is as follow:
>
><HTML>
><HEAD>
> <TITLE>Database Connection</TITLE>
></HEAD>
><BODY>
><CENTER>
> <H1>Our Users Information</H1>
></CENTER>
>
><%
> On Error Resume Next
>Response.Write ("creating connection...<BR>")
> Set oConn = Server.CreateObject("ADODB.Connection")
>Response.Write ("opening connection...<BR>")
> oConn.Open "DSN=test;UID=Moshea;Password=Tsang"
>Response.Write ("connection opened...<BR>")
> Set oRs = oConn.Execute("SELECT * FROM ID_table")
>Response.Write ("writing fields...<BR>")
>%>
>
><TABLE>
><TR>
> <% For Each oField In oRs.Fields %>
> <TD>
> <% Response.Write oField.Value %>
> </TD>
> <% Next %>
></TR>
></TABLE>
>
><%
> oRs.Close
> Set oRs = Nothing
>%>
>
></BODY>
></HTML>
>
>Thanks a million!!!
>
>Moshea

Wade
03-15-2000, 02:44 PM
Looking at your code, I'll bet the error is in the oConn.Open line. You forgot
to include the provider.

Use this:

oConn.Open "Provider=MSDAORA;Data Source=test;User ID=Moshea;Password=Tsang;"

Note that the data source test is not an ODBC data source but an Oracle connection
string

Good luck.

Wade.

"Moshea" <moshea@talk21.com> wrote:
>
>Hi all.
>
>I've created a simple script with a SQL statement to an Oracle database
and
>non-surprisingly, it gives me error. Thus, I've debugged the script and
>checked that connection can successfully be made. Hence, I thought that
>the error should be somewhere else. Every time when I made some changes
>on the script, I can reload it, unless I reboot the machine. Can you PLEASE
>help?????
>
>The script is as follow:
>
><HTML>
><HEAD>
> <TITLE>Database Connection</TITLE>
></HEAD>
><BODY>
><CENTER>
> <H1>Our Users Information</H1>
></CENTER>
>
><%
> On Error Resume Next
>Response.Write ("creating connection...<BR>")
> Set oConn = Server.CreateObject("ADODB.Connection")
>Response.Write ("opening connection...<BR>")
> oConn.Open "DSN=test;UID=Moshea;Password=Tsang"
>Response.Write ("connection opened...<BR>")
> Set oRs = oConn.Execute("SELECT * FROM ID_table")
>Response.Write ("writing fields...<BR>")
>%>
>
><TABLE>
><TR>
> <% For Each oField In oRs.Fields %>
> <TD>
> <% Response.Write oField.Value %>
> </TD>
> <% Next %>
></TR>
></TABLE>
>
><%
> oRs.Close
> Set oRs = Nothing
>%>
>
></BODY>
></HTML>
>
>Thanks a million!!!
>
>Moshea

ray m
03-17-2000, 12:50 PM
Use the latest Micorsoft drivers and not the Oracle ones.

"Mike" <michael.viglianco@bankofamerica.com> wrote:
>
>What is the error?
>
>"Moshea" <moshea@talk21.com> wrote:
>>
>>Hi all.
>>
>>I've created a simple script with a SQL statement to an Oracle database
>and
>>non-surprisingly, it gives me error. Thus, I've debugged the script and
>>checked that connection can successfully be made. Hence, I thought that
>>the error should be somewhere else. Every time when I made some changes
>>on the script, I can reload it, unless I reboot the machine. Can you PLEASE
>>help?????
>>
>>The script is as follow:
>>
>><HTML>
>><HEAD>
>> <TITLE>Database Connection</TITLE>
>></HEAD>
>><BODY>
>><CENTER>
>> <H1>Our Users Information</H1>
>></CENTER>
>>
>><%
>> On Error Resume Next
>>Response.Write ("creating connection...<BR>")
>> Set oConn = Server.CreateObject("ADODB.Connection")
>>Response.Write ("opening connection...<BR>")
>> oConn.Open "DSN=test;UID=Moshea;Password=Tsang"
>>Response.Write ("connection opened...<BR>")
>> Set oRs = oConn.Execute("SELECT * FROM ID_table")
>>Response.Write ("writing fields...<BR>")
>>%>
>>
>><TABLE>
>><TR>
>> <% For Each oField In oRs.Fields %>
>> <TD>
>> <% Response.Write oField.Value %>
>> </TD>
>> <% Next %>
>></TR>
>></TABLE>
>>
>><%
>> oRs.Close
>> Set oRs = Nothing
>>%>
>>
>></BODY>
>></HTML>
>>
>>Thanks a million!!!
>>
>>Moshea
>