Simple Server.MapPath problem?



Why does this not work as it should?

I expect index.aspx to show:.

Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\inetpub\wwwroot\ChatSimple\db\chatusers.mdb

Instead, I get:

Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\inetpub\wwwroot\ChatSimple\chatusers.mdb\chatusers.mdb

It is running on Windows XP Pro, SP1, IE6.


1) IIS has been set with:

ChatSimple, Properties, HTTP Headers, Enable Content Expiration
(ticked), Content Should "Expire Immediately"

Then restarted from the cmd line with:
net stop W3SVC
net start W3SVC


2) Here is the Global.asax.vb

+ + + + + + +

Imports System.Web
Imports System.Web.SessionState

Public Class Global
Inherits System.Web.HttpApplication

Public Sub New()
MyBase.New()
InitializeComponent()
End Sub

Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

Sub Application_Start(ByVal sender As Object, ByVal e As
EventArgs)
Application("ChatConnString") =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("/db/ChatUsers.mdb")
End Sub

End Class

+ + + + + + +

3) Here is the index.aspx page:

+ + + + + + +

<%@ Page Language="vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<title>Chat Simple</title>
</HEAD>
<BODY>
<%Response.Write(Application("ChatConnString"))
Response.End %>
</BODY></HTML>

+ + + + + + +

.



Relevant Pages

  • Application variable caching problem. Whats going on?
    ... Restarted IIS, just for good measure. ... >net start W3SVC ... > Public Sub New ... > Private components As System.ComponentModel.IContainer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: New User confused with MessageBox.show
    ... >> Public Sub New ... >> 'Form overrides dispose to clean up the component list. ... >> Private components As System.ComponentModel.IContainer ... The following procedure is required by the Windows Form Designer ...
    (microsoft.public.vsnet.ide)
  • Re: New User confused with MessageBox.show
    ... >> Public Sub New ... >> 'Form overrides dispose to clean up the component list. ... >> Private components As System.ComponentModel.IContainer ... The following procedure is required by the Windows Form Designer ...
    (microsoft.public.vsnet.ide)
  • Re: Simple Server.MapPath problem?
    ... > net start W3SVC ... > Imports System.Web.SessionState ... > Public Sub New ... > Private components As System.ComponentModel.IContainer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to Dispose a User Control and Remove Handlers
    ... textbox to remove the usercontrol have a look for that, ... Public Sub New ... Private components As System.ComponentModel.IContainer ... Public Class UserControl1 ...
    (microsoft.public.dotnet.languages.vb)