Solved

instrrev using jscript

Posted on 2002-04-18
2
739 Views
Last Modified: 2008-02-01
I need to achieve the following piece of vbscript using jscript,
sMapPath = Server.MapPath("\")
sMapPath = Mid(sMapPath, 1, InStrRev(sMapPath,"\")-1) & "\db\mydb.mdb;"

So I basically need jscript equivilants of Mid and InStrRev
0
Comment
Question by:awestrope
2 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
ID: 6951482
Mid <--> substr
InStrRev <--> lastIndexOf

I think following snippet should work.. I haven't tried it.

var sMapPath = Server.MapPath("\");
sMapPath = sMapPath.substr(0, sMapPath.lastIndexOf("\")-1);
sMapPath = sMapPath + "\db\mydb.mdb;";
0
 

Author Comment

by:awestrope
ID: 6951556
Close, helped me get there anyway!
sMapPath = Server.MapPath("\\");
sMapPath = sMapPath.substr(0, sMapPath.lastIndexOf("\\"));
sMapPath = sMapPath + "\\db\\mydb.mdb;";
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JQuery Date Time picker not showing 29 114
SQL Server Web Traffic Limitations 4 54
API not working 33 56
SP to delete duplicates 15 62
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now