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

ASP is not Executing 1

Status
Not open for further replies.

Andel

Programmer
Feb 15, 2001
366
US
I have an ASP which displays infomation from an Access database. It used to work before in my computer but now it doesn't.

Any help would be appreciated.

Thanks
Andel
andel@barroga.net
 
Can you Give more info.

Have you made any changes to your web server?
Is your folder, the one that contains the .asp file, is a virtual directory on your web server?
 
Thanks for responding vpooks.
I could not recall if I made any changes to my web server.
Yes, my .asp is in the virtual directory. I just checked it again, unless I'm missing something which I don't know.

Andel
andel@barroga.net
 
So.. you can have 2 issues.
1. Either you are not even talking to your Access database. Try to put a debug statement (response.write("")) & see whether you are able to create the connection or not. You may be having.. "on error resume next" statement. Comment that out, which displays the first error. If you are able to create the connection with no errors then..

2. your database file might got corrupted. So.. repair the database & try again.

Hope this helps!
 
What do you mean by it doesn't work? Can you paste in an extract of the error message, or do you get a blank screen? Brett Birkett B.Comp
Systems Analyst
 
BBirkett:
I got a blank screen. When I view the source in IE, I can see my asp code. Normally, I should be seiing the result of the asp.

vpooks:
It gives me blank screen.




Andel
andel@barroga.net
 
Andel!

Can you goto that .asp file from your Netscape browser? Netscape will not tolerate any error messages.

If you still dont know the reason, I guess it is better to get the .asp file. I can go thru it & let you know my comments. Otherwise its difficult to troubleshoot blindly.

 
Hello vpooks,

Here's the code. I don't think there's a problem with the code because this code is from a CD and can't change it. My computer doesn't seem to be able to read an ASP. I think the problem is with my IIS settings on my computer, and that's what I'm trying to find. I'm using W2K Advance Server.

<html>
<head>
</head>
<body>
<p>
<%
openstr = &quot;driver={Microsoft Access Driver (*.mdb)};&quot; & _
&quot;dbq=&quot; & Server.MapPath(&quot;critters.mdb&quot;)
Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
cn.Open openstr

sql = &quot;SELECT jersey, fname, sname, position &quot; & _
&quot;FROM roster &quot; & _
&quot;ORDER BY jersey; &quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.Open sql, cn, 3, 3

On Error Resume Next
rs.MoveFirst
Do While Not rs.EOF
Response.Write Server.HTMLEncode(_
rs.Fields(&quot;jersey&quot;) & &quot;, &quot; & _
rs.Fields(&quot;fname&quot;) & &quot; &quot; & _
rs.Fields(&quot;sname&quot;) & &quot;, &quot; & _
rs.Fields(&quot;position&quot;)) & &quot;<br>&quot; & vbCrLf
rs.MoveNext
Loop

rs.Close
Set rs = Nothing

cn.Close
Set cn = Nothing
%>
</p>
</body>
</html>
Andel
andel@barroga.net
 
Go into your IIS manager, and right click on the default web site, or the web site you are working with, and click properties.

Click on the Home Directory tab, and make sure that Execute Permissions is not set to None.

Also click the Configuration button and make sure that .asp is in the list of extensions.

Brett Birkett B.Comp
Systems Analyst
 
Brett,

Execute Permission is set to &quot;Scripts and Executables&quot; and .asp is in the list.

Any other suggestions?

Andel
andel@barroga.net
 
Create a new asp file something like this:

<%@Language=&quot;VBScript&quot;%>

<%
Dim strTest
strTest = &quot;I hope I can read this...&quot;

Response.write strTest
%>

<HTML>
<BODY>
Did you see it?
</BODY>
</HTML


Save this as something like test.asp
Put it in your IIS root directory and run it from the browser. Then let me know what happens.

:) Brett Birkett B.Comp
Systems Analyst
 
Well then it is definitely a problem with your webserver. Your webserver is not executing the asp code, only the HTML portion. Are you sure you are putting the file in a directory with execute script permissions enabled for IUSR Brett Birkett B.Comp
Systems Analyst
 
Where have you got it associated with Internet Explorer? Tell me exactly and i'll check my settings for you. Brett Birkett B.Comp
Systems Analyst
 
When I opened an .asp file from windows explorer, I chose it to open with Internet Explorer. (Right click the .asp, then &quot;Open With&quot;, &quot;Internet Explorer.&quot; After this, all my .asp files now associated with Internet Explorer. So, if I double click an .ASP file, IE will open it.

Can you tell me what program is associated with all your asp file? Thanks! Andel
andel@barroga.net
 
My .asp files are associated with Interdev... but that isn't the problem.... I think I might have just worked out what you are doing wrong...

The test file I got you to try before.... did you double click on it from windows explorer?? Or did you type an url in IE?

If you are double clicking from windows explorer, then that is probably your problem. You need to type the url of the file in IE... You need to know the name, or ip of your webserver, like this:

Type in IE's Address bar...

Is that what you were doing wrong?
Brett Birkett B.Comp
Systems Analyst
 
No worries!! I was starting to think you might have to reinstall IIS!!! I forget about the little mistakes like that one, that I kept making when I first started out. Guess there is just too much to remember when troubleshooting!

Glad to help! Good Luck! Brett Birkett B.Comp
Systems Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top