Help connection

M

momo

Hello all,

I am getting 500 Internal Server Error. I have tried disabling the show
friendly error in IE and I have tried it on Firefox. It will not give me the
reason why it will not work, I only get 500 Internal Server Error. I have
tested the code up to the point of Set objConn and it works but when it gets
to the objConn.open dsn that's when I get the error. I wish to find out why
it is not allowing it to get pass this point. I have control of the server
where this is hosted and if there is anything I need to do, I can do it.
Please help!



<!--#include file="dsn.asp"-->
<%

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.open dsn <======== My Problem Is Here



++++++++++++++++++++++++++++++++++++++++++
+ file: dsn.asp +
++++++++++

<%
dim dsn
dim Conn
dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\vhosts\mydomain.com\httpdocs\_private\database\books.mdb;
Jet OLEDB:Database;"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open dsn
%>
++++++++++++++++++++++++++++++++++++++++++
 
T

Tim Slattery

++++++++++++++++++++++++++++++++++++++++++
+ file: dsn.asp +
++++++++++

<%
dim dsn
dim Conn
dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\vhosts\mydomain.com\httpdocs\_private\database\books.mdb;
Jet OLEDB:Database;"


VSScript doesn't work like this. Statements end at end-of-line unless
you explicitly say otherwise. This statement should look something
like this:

dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data" & _
"Source=C:\Inetpub\vhosts\mydomain.com\httpdocs\_private\" & _
"database\books.mdb;Jet OLEDB:Database;"

The "&" is a concatenation operator, the trailing "_" tells the
interpreter that the statement continues on the next line
 
M

momo

Thanks Tim for replying. The statement is on continious line. The strange
thing is that dsn.asp works when used in another .asp page.

dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Inetpub\vhosts\mydomain.com\httpdocs\_private\database\books.mdb;
Jet OLEDB:Database;"
 
B

Bob Barrows [MVP]

momo said:
Hello all,

I am getting 500 Internal Server Error. I have tried disabling the
show friendly error in IE and I have tried it on Firefox. It will not
give me the reason why it will not work, I only get 500 Internal
Server Error.

It sounds as if you have to turn it off at the web site using IIS Manager.
Barring that, you will need to use some error-trapping to find the error

on error resume next
objConn.open dsn <======== My Problem Is Here
if err <> 0 then
response.write err.description
response.end
end if

Bob Barrows
 
M

momo

Thanks Bob,

I tried that and got error "Could not use ''; file already in use." I could
not find where it is in use. Could you help and could you tell me how to
turn it on in IIS Manager.
 
B

Bob Barrows [MVP]

momo said:
Thanks Bob,

I tried that and got error "Could not use ''; file already in use." I


This is usually a permission problem: all users of an mdb file need Modify
permissions for the folder containing the file, not just the file itself. If
your site uses Anonymous access, then you need to grant this permission to
the IUSR_machinename account.
 
B

Bob Barrows [MVP]

momo said:
Could you help and could you tell
me how to turn it on in IIS Manager.

It's in the Application Configuration dialog in the Debugging tab
 
M

momo

In the debugging tab "Send detail ASP error messages to clients" is already
selected. But it still does not show me the error. Do I have to check either
of the two boxes under "Debugging flags"?
 
B

Bob Barrows [MVP]

No.
As long as the browser is configured correctly, you should receive the
detailed errors.

You should probably be using error-trapping anyways. Many users find it very
jarring to be sent to the generic error pages.
 
M

momo

Thanks Bob,

But I find it very odd that it is not working for me. As I mentioned
earlier, I have tried unchecking the "show friendly error" box in IE and I
have Firefox and it still does not show me the error. Anything else you
could suggest?
 
R

Roland Hall

in message
: Sorry, I've never had to do anything else.

Do you have to restart the web site after making the change in IIS?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
B

Bob Barrows [MVP]

Roland said:
in message


Do you have to restart the web site after making the change in IIS?

Not that I recall - pressing the Apply button sufficed iirc. But it can't
hurt ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top