I used to have an .asp script called whereami.asp that I could load into a directory on the web and then go to the URL and it would display the full path of that directory i.e D:Inetpubwwwrootmysitemydirectorywhereami.asp
But I've lost this script does anybody have the code that will do this. I seem to remember it was about 6 lines long - but as I am not that hot at asp I don't really know for sure.
I am wondering if there is a command to determine what the current directory is.
My reason for this is that i have a include file called connection.asp sat in a folder called Data. My connection.asp file holds the connection details. I need to determine whether the file calling the include is in the root folder or not.
EG. if it is the root folder the location of the db will be "Data/dbMarkShop.mdb" but if it is another folder, say a Scripts folder, the location of th db would be "../Data/dbMarkShop.mdb"
I downloaded a component which will enable me to upload data to my server. Currently i am using my localhost to develop the files. The component is called Aspfree upload [from http://www.freeaspupload.net] and it has variable called uploadsDirVar which you specify the directory which you want to upload the files to.
However i dont know the real path in my clients isp, so for examle i cant use "c/inetpub/wwwroot/database".
My files are structured as bellow: alpha/admin/pages --this is where my scripts are located. The directory i wish to upload the files are at alpha/database. I've tried uploadsDirVar = "../../database" and it did not work.
does any one here know of a good way to to determine whether or not a given path is a directory (e.g., "c:mydir") or a file (e.g., "c:mydir myfile.txt")?
i started attacking this problem by using filesystemobject to check whether or not a directory existed for the path. if so, it was a directory path. if not, i checked to see if a file existed for it. if so, it was a file path. Code:
Well, it was my experience that the generated stuff didn't work, but I didn't want to make a definitive statement and have someone more knowledgeable come through and tell me how wrong I was.
So now I'll agree: DON'T use Word to generage your code. It is a very bad idea, and for what (it looks like) you're trying to do, it is so easy that writing it in notepad would only take a few minutes, and be much nicer.
I have written a script to update user information in the Active Directory using ADSI. Here is part of it:
Set User = GetObject("LDAP://<GUID=" & GUID & ">")
User.Department = DepartmentName
User.SetInfo
Set User = Nothing
This works fine unless DepartmentName is an empty string ("").
Then I get error 0x8007200B: "The attribute syntax specified to the directory service is invalid." This happens with all the attributes I have tried, including TelephoneNumber . Do I need to delete the value of the attribute instead of setting it to an empty string? If so, how do I do it?
I get a 404 status back indicating that the file is not found, which is incorrect. I am able to locate XLS and DOC files on the same directory. Any ideas why I cannot find a DWG (Drawing) file?
I am not sure if this is a question for this forum or the IIS forum but here goes. I have a dedicated server on which I am hosting about 80 websites at the moment, all of which have been created by copying a template site. All of these sites have an identical structure and are located in the same directory on the server, C:Inetpubvhosts. Several times when I have needed to make an adjustment to the sites I have to go into the remote desktop connection to the server and go site by site, copying and pasting files. For example, as each site has the same pages, ie., map.asp, sometimes I make a change to that page and have to copy it to every site. Could I write some sort of script using the FSO and execute it from one site and have it loop through each site on the server making the neccessary change(s)?
At first glance, the question in the subject line seems way too easy. But I am finding some situations in my app where the value in a variable is some sort of blank-like value, such as Null or " " or "", but I cannot tell which.
Of course, in order to find out the value, I did a response.write, and added a nonsense word afterward, to help make sure it is writing it out for me.
How do I go about testing to see if a value is not equal to NULL? isNULL provides the opposite functionality, but all my attempts at the former return a FALSE value.
Based on what the user selects in a combo box I need to find the value from another column in the same record. This is what I am using:
rsPrice.movefirst rsPrice.Find "Component='Desktop'" If (rstPrice.BOF = True) or (rstPrice.EOF = True) Then response.write("The Price for the Component Not Found")
else curPrice =rsPrice("Score") End If
I keep getting an error messages:
Microsoft OLE DB Provider for SQL Server (0x80040E29) Rowset does not support scrolling backward.
I'm coding in classic asp and can't figure how to get IE6 to display some kind of descriptive message about code errors? I have the correct settings under ADVANCED in IE's options selected.
What bugs me is sometimes IE will report the line number and a message, and then other times it's the standard "The page can't be displayed." When you have hundreds of lines of code, how can you fight this?
I am attempting the following for a real estate website. I want to list the agents for the office all of whom have a unique identifier with an Auto Number type. As I loop through the recordset, I also want to open another table called listings. This table has a field called agent whose value is a number and corresponds to an agent in the agent table.
If there is a listing in the listing table, I want to insert a link to "View Listings", if not, no link. I am having a hard time doing this and if someone could point me in the right direction I'd appreciate it. I tried the Find method but to no success.
I want to find numbers in one comma seperated string which are not in another one. For instance if I have two strings "strString1" and "strString2 how can I find numbers in "strString1" which are not in "strString2" Example:
strString1 = "1,3,6,12" strString2 = "1,6"
In this case the numbers I want to end up with are 3 and 12.
I am working on a survey and I have gotten the pages done to collect the data but now I am having trouble finding the correct syntax for displaying some of the data back to the user. I basicly need one to do this
Text on site <field1*field2*1.5> More Text on site.
and a seperate one to do this:
if field1=a then write "message one" if field2=b then write "message two"
I am looking for a way create a distance calculator from city to city, zip to zip, so on so forth. I know this has been done many times. Does anyone have this around by any chance. Also does anyone know of a place I can get the db or text file I need for this? I know there are some floating about but haven't came across a decent one yet.
I keep getting an error message: missing right parenthesis and I cannot for the life of me figure out why. Please help me find the problem! It may simply be that I've been staring at the code too long and I'm missing something obvious.
I know the path and first and last part of the filename.
Example filename: A01-30420.jpg
I have the A01- and the .jpeg. The ##### portion could be anything, but always numeric (sofar).
The A01 is unique, i.e. there will only be one file of A01-#####.jpg
I'm using fileExists object to confirm a file exists when I have the full filename but havn't been able to figure out how to get the full filename when I only have a partial.
I could rename the files, i.e. drop the -##### but I'd have to do that everytime I get new ones so I'd like to work with the original filename if at all possible.
I have a web page, where users fill out their name and address, and I send them a free catalog.
The problem is that someone is filling my form out about 100 times a day throughout the day with peoples information, who don't want the catalog!
I have tracked the ip address (all different) and the http referrer, which doesn't really tell me much. and looked in the iis logs, which lists the ipaddresses.