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

Problems connecting to database :(

Status
Not open for further replies.

Fursten

Programmer
Dec 27, 2000
403
PT
Hi

I had created a project in InterDev. Then I had a new ASP file. In this, after the <body> statement I did this:
<%
Dim con
Dim rs

set con = CreateObject(&quot;ADODB.Connection&quot;)
con.Open &quot;Provider=SQLOLEDB;&quot; & _
&quot;Data Source = EST40;&quot; & _
&quot;Initial Catalog = XMLTeste;&quot; & _
&quot;User ID = smname;&quot; & _
&quot;Password=&quot;

Set rs = con.Execute (&quot;Select * From Colaboradores&quot;)
%>

<b><%=rs(&quot;ID&quot;)%></b>
</body>
.........

When I make &quot;Preview window&quot;, I get an &quot;HTTP 500 - Internal server error Internet Explorer&quot; message in the browser and I can´t figure out the reason.

I´m using SQLServer7.0, and I had defined a user in it &quot;smname&quot; which is an administrator in windows2000 system. Interdev ans SQLServer are running on the same machine.

Any help is welcome.
Thank you.
 
I suppose u are using Ie 5.0 or above..

Please goto Tools -> InternetOptions -> Advanced & turn off show friendly HTTP errors..

This will result in the Display of the Excat Error & the line number where it is occuring
 
Ok, I made that debugger-Amit. Now I was able to see the error thank you :) However I still don´t solve the problem.

What I was doing was creating a project in master mode. This way, the error message was telling me this:

HTTP 403.1 Forbidden: Execute Access Forbidden
Internet Information Services

This is because I making a project in master mode? How can I solve this?

Anyway, I make the same code in a local project. Now I was able to make preview of that ASP, however no data was showed!

If I make debugg I can see that, despite I made: set con=createObject(&quot;ADODB.Connection&quot;) and then I open it, the con variable are always empty :( This is strange because, If I make &quot;Set&quot; and then I can see the properties and methods of this object. How can it be empty? The result is an empty recordset too :(

The code I made to open was:
con.Open &quot;Provider=SQLOLEDB;&quot; & _
&quot;Data Source = EST40;&quot; & _
&quot;Initial Catalog = XMLTeste;&quot; & _
&quot;User ID = smname;&quot; & _
&quot;Password=&quot;

Thank you for any help :)

Sergio Oliveira


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top