|
jonance -> RE: fp2002 corrupts asp code (12/11/2002 18:04:24)
|
In case it helps, here is the FP generated Global.ASA file WITH the code that works...is there anything askew you can see? ------------------------------------------------------------------------- <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart ' ==FrontPage Generated - startspan== Dim FrontPage_UrlVars(11) ' --Project Data Connection Application(" buttons_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/links.mdb" FrontPage_UrlVars(0) = " buttons_ConnectionString" Application(" buttons_ConnectionTimeout" ) = 15 Application(" buttons_CommandTimeout" ) = 30 Application(" buttons_CursorLocation" ) = 3 Application(" buttons_RuntimeUserName" ) = " " Application(" buttons_RuntimePassword" ) = " " ' --Project Data Connection Application(" editor_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/editor.mdb" FrontPage_UrlVars(1) = " editor_ConnectionString" Application(" editor_ConnectionTimeout" ) = 15 Application(" editor_CommandTimeout" ) = 30 Application(" editor_CursorLocation" ) = 3 Application(" editor_RuntimeUserName" ) = " " Application(" editor_RuntimePassword" ) = " " ' --Project Data Connection Application(" links_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/settings.mdb" FrontPage_UrlVars(2) = " links_ConnectionString" Application(" links_ConnectionTimeout" ) = 15 Application(" links_CommandTimeout" ) = 30 Application(" links_CursorLocation" ) = 3 Application(" links_RuntimeUserName" ) = " " Application(" links_RuntimePassword" ) = " " ' --Project Data Connection Application(" louisvilleguide_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/louisvilleguide.mdb" FrontPage_UrlVars(3) = " louisvilleguide_ConnectionString" Application(" louisvilleguide_ConnectionTimeout" ) = 15 Application(" louisvilleguide_CommandTimeout" ) = 30 Application(" louisvilleguide_CursorLocation" ) = 3 Application(" louisvilleguide_RuntimeUserName" ) = " " Application(" louisvilleguide_RuntimePassword" ) = " " ' --Project Data Connection Application(" items_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/items.mdb" FrontPage_UrlVars(4) = " items_ConnectionString" Application(" items_ConnectionTimeout" ) = 15 Application(" items_CommandTimeout" ) = 30 Application(" items_CursorLocation" ) = 3 Application(" items_RuntimeUserName" ) = " " Application(" items_RuntimePassword" ) = " " ' --Project Data Connection Application(" addalocality_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/addalocality.mdb" FrontPage_UrlVars(5) = " addalocality_ConnectionString" Application(" addalocality_ConnectionTimeout" ) = 15 Application(" addalocality_CommandTimeout" ) = 30 Application(" addalocality_CursorLocation" ) = 3 Application(" addalocality_RuntimeUserName" ) = " " Application(" addalocality_RuntimePassword" ) = " " ' --Project Data Connection Application(" publicmarketplace_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/publicmarketplace.mdb" FrontPage_UrlVars(6) = " publicmarketplace_ConnectionString" Application(" publicmarketplace_ConnectionTimeout" ) = 15 Application(" publicmarketplace_CommandTimeout" ) = 30 Application(" publicmarketplace_CursorLocation" ) = 3 Application(" publicmarketplace_RuntimeUserName" ) = " " Application(" publicmarketplace_RuntimePassword" ) = " " ' --Project Data Connection Application(" jobs_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/jobs.mdb" FrontPage_UrlVars(7) = " jobs_ConnectionString" Application(" jobs_ConnectionTimeout" ) = 15 Application(" jobs_CommandTimeout" ) = 30 Application(" jobs_CursorLocation" ) = 3 Application(" jobs_RuntimeUserName" ) = " " Application(" jobs_RuntimePassword" ) = " " ' --Project Data Connection Application(" events_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/events.mdb" FrontPage_UrlVars(8) = " events_ConnectionString" Application(" events_ConnectionTimeout" ) = 15 Application(" events_CommandTimeout" ) = 30 Application(" events_CursorLocation" ) = 3 Application(" events_RuntimeUserName" ) = " " Application(" events_RuntimePassword" ) = " " ' --Project Data Connection Application(" helpfullinks_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/helpfullinks.mdb" FrontPage_UrlVars(9) = " helpfullinks_ConnectionString" Application(" helpfullinks_ConnectionTimeout" ) = 15 Application(" helpfullinks_CommandTimeout" ) = 30 Application(" helpfullinks_CursorLocation" ) = 3 Application(" helpfullinks_RuntimeUserName" ) = " " Application(" helpfullinks_RuntimePassword" ) = " " ' --Project Data Connection Application(" maine_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/maine.mdb" FrontPage_UrlVars(10) = " maine_ConnectionString" Application(" maine_ConnectionTimeout" ) = 15 Application(" maine_CommandTimeout" ) = 30 Application(" maine_CursorLocation" ) = 3 Application(" maine_RuntimeUserName" ) = " " Application(" maine_RuntimePassword" ) = " " ' -- Application(" FrontPage_UrlVars" ) = FrontPage_UrlVars ' ==FrontPage Generated - endspan== End Sub Sub Session_OnStart FrontPage_StartSession ' ==FrontPage Generated== End Sub Sub FrontPage_StartSession On Error Resume Next if Len(Application(" FrontPage_VRoot" )) > 0 then Exit Sub sFile = " global.asa" sRootPath = Request.ServerVariables(" APPL_PHYSICAL_PATH" ) if Left(sRootPath,1) = " /" then sSep = " /" else sSep = " \" if Right(sRootPath,1) <> sSep then sRootPath = sRootPath & sSep sRootPath = sRootPath & sFile ' discover the VRoot for the current page; ' walk back up VPath until we match VRoot Vroot = Request.ServerVariables(" PATH_INFO" ) iCount = 0 do while Len(Vroot) > 1 idx = InStrRev(Vroot, " /" ) if idx > 0 then Vroot = Left(Vroot,idx) else ' error; assume root web Vroot = " /" end if if Server.MapPath(Vroot & sFile) = sRootPath then exit do if Right(Vroot,1) = " /" then Vroot = Left(Vroot,Len(Vroot)-1) iCount = iCount + 1 if iCount > 100 then ' error; assume root web Vroot = " /" exit do end if loop ' map all URL= attributes in _ConnectionString variables Application.Lock if Len(Application(" FrontPage_VRoot" )) = 0 then Application(" FrontPage_VRoot" ) = Vroot UrlVarArray = Application(" FrontPage_UrlVars" ) for i = 0 to UBound(UrlVarArray) if Len(UrlVarArray(i)) > 0 then FrontPage_MapUrl(UrlVarArray(i)) next end if Application.Unlock End Sub Sub FrontPage_MapUrl(AppVarName) ' convert URL attribute in conn string to absolute file location strVal = Application(AppVarName) strKey = " URL=" idxStart = InStr(strVal, strKey) If idxStart = 0 Then Exit Sub strBefore = Left(strVal, idxStart - 1) idxStart = idxStart + Len(strKey) idxEnd = InStr(idxStart, strVal, " ;" ) If idxEnd = 0 Then strAfter = " " strURL = Mid(strVal, idxStart) Else strAfter = " ;" & Mid(strVal, idxEnd + 1) strURL = Mid(strVal, idxStart, idxEnd - idxStart) End If strOut = strBefore & Server.MapPath(Application(" FrontPage_VRoot" ) & strURL) & strAfter Application(AppVarName) = strOut End Sub Function FrontPage_FileExists(fspath) On Error Resume Next FrontPage_FileExists = False set fs = CreateObject(" Scripting.FileSystemObject" ) Err.Clear set istream = fs.OpenTextFile(fspath) if Err.Number = 0 then FrontPage_FileExists = True istream.Close end if set istream = Nothing set fs = Nothing End Function </SCRIPT> <head><title>Web Settings for Active Server Pages</title><html xmlns:mso=" urn:schemas-microsoft-com:office:office" xmlns:msdt=" uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" > <!--[if gte mso 9]><xml> <mso:CustomDocumentProperties> <mso:connectionstatus msdt:dt=" string" >buttons=1 editor=1 links=1 louisvilleguide=1 items=1 addalocality=1 publicmarketplace=1 jobs=1 events=1 helpfullinks=1 maine=1</mso:connectionstatus> </mso:CustomDocumentProperties> </xml><![endif]--> </head>
|
|
|
|