Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP under IIS can only be viewed locally
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP under IIS can only be viewed locally

 Post Reply Post Reply
Author
Paul King View Drop Down
Newbie
Newbie


Joined: 11 July 2003
Location: United Kingdom
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Paul King Quote  Post ReplyReply Direct Link To This Post Topic: ASP under IIS can only be viewed locally
    Posted: 11 July 2003 at 8:28am

Hi,

I am trying to bring in an access database using ASP and it works when I sit at the server but when I go client side all I can see is the code, am I being blonde?  Do I need to turn on something in IIS to enable ASP externally?

here is the code in case it makes a difference

Thank you all for stopping by and reading this

Paul

<%

' Declare variables


Dim cnnSimple  ' ADO connection
Dim rstSimple  ' ADO recordset
Dim strDBPath  ' path to our Access database (*.mdb) file


' MapPath of virtual database file path to a physical path.
' If you want you could hard code a physical path here.
strDBPath = Server.MapPath("ServiceCallManagement1.mdb")


' Create an ADO Connection to connect to the scratch database.
' We're using OLE DB but you could just as easily use ODBC or a DSN.
Set cnnSimple = Server.CreateObject("ADODB.Connection")

' This line is for the Access sample database:
cnnSimple.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

' We're actually using SQL Server so we use this line instead:
'cnnSimple.Open "Provider=SQLOLEDB;Data Source=10.2.1.214;" _
' & "Initial Catalog=samples;User Id=samples;Password=password;" _
' & "Connect Timeout=15;Network Library=dbmssocn;"


' Execute a query using the connection object.  It automatically
' creates and returns a recordset which we store in our variable.

'Set rstSimple = cnnSimple.Execute("SELECT * FROM employees")

'Code to display Access Info based on WiredContact Record

VarFirstName=Request.QueryString("salutation")

Set rstSimple = cnnSimple.Execute("SELECT * FROM employees WHERE FirstName= '" & VarFirstName & "' ORDER BY EmployeeID")


' Display a table of the data in the recordset.  We loop through the
' recordset displaying the fields from the table and using MoveNext
' to increment to the next record.  We stop when we reach EOF.
%>

<table border="1">
<%
Do While Not rstSimple.EOF
 %>

 <tr>
  <td><FONT FACE=ARIAL size="2"><b>Employee ID</b></FONT></td>

  <td><FONT FACE=ARIAL size="2"><b>First Name</b></FONT></td>

  <td><FONT FACE=ARIAL size="2"><b>Last Name</b></FONT></td>

  <td><FONT FACE=ARIAL size="2"><b>Title</b></FONT></td>
 </tr>


 <tr>

  <td><%= rstSimple.Fields("EmployeeID").Value %></td>

  <td><%= rstSimple.Fields("FirstName").Value %></td>

  <td><%= rstSimple.Fields("LastName").Value %></td>

  <td><%= rstSimple.Fields("Title").Value %></td>

 </tr>

 <%
 rstSimple.MoveNext
Loop
%>


</table>
<%
' Close our recordset and connection and dispose of the objects
rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing


%>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.