Print Page | Close Window

Sql Version - MapPath not needed

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7370
Printed Date: 04 April 2026 at 8:09am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Sql Version - MapPath not needed
Posted By: kmacy
Subject: Sql Version - MapPath not needed
Date Posted: 18 November 2003 at 12:48pm

I was looking through the code and noticed if you are running the Sql Server version there are a couple of lines in the code that you can comment out (or wrap in an if then statement checking for Sql version).

I wouldn't even bring it up but the server.mappath is an expensive method because it has to read the file system each time it is called. 

So, unless Borg says different, I'm going to comment out the following 2 lines in the common.asp file. (Only for SQL SERVER version!)

1) strDbPathAndName = Server.MapPath("admin/database/wwForum.mdb") 'This is the path of the database from this files location on the server

2)strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDbPathAndName 'This one is for Access 2000/2002 .

Borg,
Actually, you might just want to move:
'Set the diffrent variables for diffrent database types
If strDatabaseType = "SQLServer" Then %>

up a few lines to right under :
Set adoCon = Server.CreateObject("ADODB.Connection")

and then add a "Not" since you are already testing for SqlServer anyway.



-------------
Ken Macy



Replies:
Posted By: kmacy
Date Posted: 18 November 2003 at 1:15pm

Just for grins, I re-ran the base test of AspForum7.6 3 more times and came out to: (if you don't know what I am talking about read my earlier post)

64 requests per seconds (exact same as before)

Then I commented out the server.mappath call mentioned above and reran the test 3 times and got this:

68 requests per second.

May not seem like a lot but that simple little change is a 6% increase. Not bad for just making a simple little change.

 



-------------
Ken Macy


Posted By: WebWiz-Bruce
Date Posted: 19 November 2003 at 2:51am
Thanks I'll look into it.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net