I'm trying to run the server.execute command inside a executed file. It doesn't work. Can anybody tell me why? I've searched all around and haven't found a reason. Could it be because it's not supose to work, or is the syntax diferent then in the first file? It's something like this:
I've tried instantiating the Windows Script Host shell object in ASP, and I'm trying to run this command: "cscript.exe myvbs.vbs parameter1 parameter2"; however, the server runs cscript.exe very briefly, and the task ends. Note, it runs fine from a command prompt. Do I need to give the anonymous user any special permissions in order to do this?
I used to be able to Execute '.VBS' files from ASP pages. I think the facility stopped in IIS6. Security feature I guess - any work arounds available ?
We're trying to write an application that will allow a user to enter an id field from an ASP intranet page and when they hit the enter button, fire off a print job. The problem is, Adobe must be open as the items being printed are PDFs.
We tried firing off a print command using MS SQL cmdShell() (not sure if that is the exact name of the command) and it works, but it never completes. The process hangs in the database because, we think, it hasn't closed Adobe, therefore never coming back to the query. We wrote the query into an ASP page.
Adobe must be open or the documents won't print properly.
Does anyone have any suggestions to how we can automate this?
I have written a stored procedure and I am trying to execute it inside my ASP page. So here is my code. It wont work at all, like when I try and open the page It times outs.
<% dim sqlrs, rs2 sqlrs = "exec SP_GET_KPI_TABLE_HEADERS" set rs2 = server.createobject("ADODB.Recordset") RS2.open SQLrs, CMS, 2, 2 %> Code:
I need to return XML from a SQL Stored Procedure which I will execute through ASP ADO code. Stored Procedure as below:
CREATE PROCEDURE pr_GetJobInfo2 @JobType int, @CntryID int, @JobTitle varchar(8000) OUTPUT AS SELECT @JobTitle = ltrim(rtrim(JobTitle)) FROM dbo.JOBS WHERE JobType = @JobType AND CntryID = @CntryID FOR XML AUTO [code]
Now the output parameter (@JobTitle) cannot be assigned to FOR XML, so what must I do ??? My ASP code reads as: ....
I am trying to execute the following stored procedure from my asp page The asp page is passing a value "@Year" to the stored procedure ut seems to fall over with a declaration problem. Here is the stored procedure Code:
i have a form that action is set to itself, on the same page i m having the insert statement, executed when i submit that form, but when the user refresh that page the query is executed and submit the null values in the table.
i am having a problem in how to create a Open File dialog to enable user to select a image file that will be stored into database. i just want the file path to be stored in database, not the image.
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 a problem. I tried my best but could not solve is. I have a page where user selects the folder name from a drop down list. It takes user to show.asp page, where it how all the files in the folder and also user can click on them and download them. If I select name of the folder from the list, on show.asp it shows all the files and their link.
When I click on the link then most of the file which has long name and have space in their names wont be hyper linked. For example if files name is Virus Control.vsd or file name is INCIDENT-ACCIDENT INVESTIGATION REPORT.htm. If I click on them it will say "The page cannot be found". Code:
I have setup a site that allows users to login with a username and a password that are stored in a mysql database, now what i need to do is set it up so the users can only download specific file(s) related to their username. With my current set up using all asp and iis 5.0 all the users can download the same file from a certain directory. I was thinking of somehow using the session variable of the username as a variable in the download path of the file, but i don't know if this is a correct method of doing this or the correct syntax.
This does not seam to work for me in IE, but does in Netscape? What I am trying to accomplish is this.
On the footer of everypage we have a link that opens a comment page, example [<a href="#" onclick="javascript:view_win(/comment/comments2.asp');" class="notes">Send Comments</a>]. I am trying to write asp code to that takes the referering page and then gives the the filepath of that page which searches a database of web authors, and then returns the authors email address. after that I loop to add input sendto's for each one found. Code:
I'm needing some help on this. I need to know how to parse a file path for the file name in a browse box. Lets say I have a browse box in a form with the input of
C:/somedirectory/somefile.asp
I need a piece of code that could convert the input into just somefile.asp?
In my ASP file, located at the "/test" directory of the website, I include another ASP file as below.
<!--#include file="../templates/_header.asp"-->
Inside the _header.asp file, how can I get the current file (_header.asp) directory? I need to get the web relative/absolute directory of _header.asp, but instead even if I can get the physical directory location of that file should be fine.
I tried Request.ServerVariables("") with almost all the variables, but none gave me what I wanted. This is necessory, becase the location of _header.asp and the file which includes that can vary.
Is there an easy way to find out the path of the current asp page? When looking at http://localhost/images/listing.asp I want to be able to extract "http://localhost/"
I am attempting to upload files to a folder on a remote server. However the folder is different for each user based on login. Is there anyway to do this using the code below. If not can someone tel me of a way to do it.
Dim DestinationPath DestinationPath = Server.mapPath("UploadFolder")
what I'm doing is executing a query based on login for a varible called "uploadFolder", so I want my destination path to be something like <% DestinationPath = Server.mapPath("rsRecord(uploadFolder)")%>
I am not able to save the file path into database remaining everything is working good i can upload the image to the folder and save the data to the database. I am using MySQL database .....
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:
The file uploader code I've been using won't let me use Request.Form and BinaryRead on the same page so I've resorted to having the file upload code on another, seperate page that is spawned from the first. Trouble is, the path to store the file at is determined on the first page and I don't know how to pass it along to the second.
I usually use SQL Server, but have occasionally had to use Access. This is such an occasion. My research, mainly at aspfaq.com, has been that you need to put the file path in your connection string, like this (watch out for the wrap):
I have one COM (.dll) for uploading files to server. Its working fine on server A but same code and file not working on server B giving error Path/File access error .
I have a simple asp form which writes to a csv. The code it's based on (from "ASP for Dummies") is:
Set peoplefile - _ filesys.OpenTextFile( _ "c:inetpubwwwrootgbgbpeople.txt",1)
The form is going live soon, and I'd like just a dash of due diligence in terms of security. I tried using a relative link to the gbpeople.txt file which didn't work. Is there a better way around this without reinventing?
If the physical path of a page is : " e:facecgi_bindetails\_Nviews.asp "
and i want to remove "\_Nviews.asp" portion from this path ...means whenever the page refreshes,no matter what the name of the page is ....the last portion of the name of the page with slash must skip out from this path string .....how can i do this while using VBscript Functions.....like using Split(),RIGHT(),LEN(),LEFT()...etc..
I am trying to create a log of certain events on the website by writing them to a text file. The logging code is in an "included" file that is inserted into the pages that need to be monitored. Currently, the target text file is just specified in the FSO MapPath as "thelog.txt", so it writes the log to a text file within the same folder as the web page.
The problem is that I don't want to grant browsers Write access to my pages folder, so I need to have a separate directory to hold the log text file that browsers can have Write access to. The web site is hosted on a shared server that I do not have direct access to. In the past, occasionally an error has popped up that states the exact location, but I can not get that to repeat. I know it is something like "D:customersmyuseridwww"
How can I find out the actual location on the server so I can use an absolute path to write all the logs to one file in one location?