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

ASP PAGE HELP

Status
Not open for further replies.

stors2002

Technical User
Aug 6, 2002
1
NL
Hi all
I'm developing one site. And my ASP page is not displayed in the web site. Database connection is there on the page and i'm checking username and password. I'm using IIS server.
can anybody give me some sample code of the ASP to check with access database (user name and password)...??
what options i have to set of IIS to enable ASP pages on my website. i'm begginer.
thank you
sachin
 
First, run an easier sample like:
Code:
<%
Option Explicit

Response.Write &quot;If you see this in your browser, settings are fine&quot;
%>
Save it under your folder as test.asp and in your browser type in the address:
If you see the text then your IIS is configured correctly.

Now, to check you connection to Access try this out:
<%
Dim strConnect
Dim objCommand, sql_string, rsObj
strConnect = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _
&quot;Data Source=YOUR FILENAME AND PATH HERE&quot; & _
&quot;Persist Security Info=False&quot;

sql_string = &quot;SELECT * FROM tablename&quot;

Set objCommand = Server.CreateObject(&quot;ADODB.Command&quot;)
objCommand.ActiveConnection = strConnect
objCommand.CommandText=sql_string
objCommand.CommandType=adCmdText
Set rsObj = objCommand.Execute
Set objCommand = Nothing

If rsObj.EOF Then
&quot;Nothing in this table&quot;
Else
Do While NOT rsOBJ.Eof
Response.Write &quot;Value: &quot; & rsObj(&quot;fieldname&quot;) & &quot;<br>&quot;
rsObj.MoveNext
Loop
%>

In the above example you will have to replace the following things:
YOUR FILENAME AND PATH HERE
Shoulb be the path/filename for your mdb

tablename
Should be the name of a table in your database

fieldname
Should be the name a of a field in that table


Let us know how it goes.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
HI Tarwn
i tried your clue. But it seems that my ASP page doesn't work. That means that my IIS is having some problem. Can u pleae tell me what configuration i have to make so that it will work properly.
I uploaded the simple ASP page that u told me. but in vain
any way thankx

regards
sachin
 
what error did you get from Tarwn's example when you tried to view the page? Hope that helps,
Ted
admin@onpntwebdesigns.com
 
Tell us exactly what screen you are getting and we should be able to help you find out whether it is a file permissions problem or an IIS default configuration problem. Also, did you use localhost to try to view your page? If you received a server not found error try using filename.asp and see if that makes a differance.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Hi
It gioves me error
&quot;THE PAGE CANNOT BE DISPLAYED&quot;
at the bottom it shows me error
&quot;HTTP 500 - Internal server error
Internet Explorer &quot;

I think there is some problem in IIS setting. Because it works in APACHE.
thank you
regards
sachin
 
See if you can pull up the page
This is the help files for IIS, including installation and setup of IIS. If this will not open, the instructions for setting up the help permissions can be found at:
C:\WINNT\help\iishelp\common\htmla.htm
It details the settings you need to display the help files for IIS. This should help you resolve your problems.

On another note, if you are already running Apache on the same machine than you will need to set up one of the two web servers to run on another port (such as 8080) otherwise whichever one that was installed first will answer all of the requests. If this is the case, then the reason the page cannot be found/displayed is because Apache is answering the request rather than allowing IIS to handle it.
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top