I need to be able to view a list of files (could be large number!) on a web page and hv been considering using the filesystemobject just to create an array. However their maybe a large number of files and they may need to be sorted.
I am trying to setup an ASP code to write a text file to the client side, not the server side, for the purpose where it will be email attachment.
The following code seems to only work on the server side and was wondering if there as an equivalent out there for the client side since I am trying to avoid potential interruptions on the server side:
Const TemporaryFolder = 2 Dim myFSO, WriteStuff, myAttachment, tfolder Set myFSO = CreateObject("Scripting.FileSystemObject") Set tfolder = myFSO.GetSpecialFolder(TemporaryFolder) if (right(tfolder,1) <> "") then tfolder = tfolder & "" end if myAttachment = tfolder & "test.txt" Set WriteStuff = myFSO.CreateTextFile(myAttachment, True)
Anyone has done declaring temp table in ASP code, and then populate the temp table, and then inner join with other table and so on? I encounter some sql error it seems indicate asp can't do such operations..
I have data that needs to write to a temp table (there is a lot of data sometimes). Once they are finished, the user approves their input and it goes to a permanent table.
I give them the option of deleting that data by cancelling their request.
The problem I have, just to be on the safe side, what can I do to protect myself if the user closes or perhaps browses away from the page? Is there any sort of an window command whereby I could enable a sort of a kill-like function?
I am trying to write a sub that will delete a spreadsheet file created by the web user. THis is the code I have inserted into the global.asa file, but it is not working.
sub Session_OnEnd 'delete the temporary excel spreadsheet Set objFSO = Server.CreateObject("Scripting.FileSystemObject") objFSO.DeleteFile(Server.mappath("temp/<%=session.sessionid%>.xls")) Set objFSO = Nothing end sub
I have made sure that the temp folder has permissions set for the IUSR_machinename account to be able to delete files. I am running IIS 5 on a windows 2000 server.
I want to do the following but am not able to do it.I have one query which is:
SQL2 = "SELECT * From totalcloser INNER JOIN zipcode ON totalcloser.zip = zipcode.zip order by totalcloser.zip"
I want to store result of this query in a temp table so that now i can go ahead and compare the results in the temp table with some other table.I know i can do this in Access..but i want to do this by coding (in my program itself) where the query runs and dumps the query results in temp table and then the second query runs and does comparisons and displays the result on screen.Towards the end ,we can flush the contents of the temp table.
I recently installed IIS lockdown, and ever since my ASP pages have been hell. One problem is that now after a user views my ASP page which reads my local Access DB, the temporary file, .ldb, stays in the folder forever!
This temp file is created when a user opens the file, so I checked out the .ldb file and it says the ADMINISTRATOR is opening the file! How can the internet user be using the ADMIN account?! This is not good news! I will share my code for my page; however I have a feeling the code isn't the problem, but a setting is. Code:
This query sort on the basis of Lft and Rgt columns.
The name of the array is: aEmp.
My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.
Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.
In working with arrays, I have found that I am unable to dimension and array with a variable that has an integer value but I can redimension one this way. I haven't see any information that tells me if this is a requirement, although it appears to be because I get an error if I try it.
Ex.
Dim b b = 10 Dim a(b) ' this errors out but Dim a() ' this Redim a(b) ' works
I want to create a new array called arrNames2 and copy contents of arrNames to arrNames2.
I then want to loop through my db and add more names (while going through the loop) to arrNames2. What is the best way to do this? Do I have to keep redim the array wehn I add more names?
I have a page in my admin system where the user can edit products they have added. The problem I am having is with Related Products. These are all listed in a multiple list. What I need to do is have those selected when the product was added, already be highlighted in the multiple list on the product edit page. Here is my post from another forum.
For some reason, when I try to run the following array, I'm getting an error:
dim cat(0)
cat(0)="0407" cat(1)="0102"
'I will be adding more to this array, but just trying with two for starts.
for counter = 0 to 1
itno=cat(counter)
'I get an error when it runs through this function
Function rightvar(theVar,lengthNeeded) Dim sResult sResult=theVar if Len(theVar)< lengthNeeded then sResult= String(lengthNeeded - Len(theVar)," ")& theVar rightvar=sResult End Function
The problem is that in my 5 years of programming in various languages i have never really understood arrays (DUMB @$${lol}) What i want to do is offer an advanced search of a database table on my website. I currently offer the functionality so that the whole of the database can be viewed within the web page so that it doesn't need to be downloaded/need access to view it. What i need to do is run a script that takes all of the column headings that i have and put them into an array. Then with the array i need to output each element into a drop down box.
Ok what I have is a little script which runs through my stock compares how many of one item we have compared to what we need and displays the out come.
What id like to do is make an array with the item name so lets say If how many is needed is greater then 0 then add the name of that consumable to an array and move on until the end.
Then I want to use the arry to display each consumable on an order form. Anyone have any idea how to do this in ASP or can give me any advice on a better way to do it?
I have a form that has fields named Title1, Title2, and so on to title 12
I want to set up an array that goes through all the input feild values that I already put into variables such as Title1, Title2...so on. It then replaces ' with '' so the apostrophe can be entered into the database. So it:
Creates an array by looping through the variables that get the form feilds.
Then loops through the array and replaces the ' with '': Title1=(Replace(Title2, "'", "''"))
I'm looking to make an admin page for a web photo gallery, and I need to make a drop down menu showing all files in a given directory that do not have comments in a database for the given filename.
I'm curious about the most efficient way to do this. I don't want to query the database separately for each file as this would be horribly inefficient. I'm thinking about two arrays, one containing all filenames in the photo directory, and one containing filenames from the database that have descriptions.
Is there a simple way in ADO to do a set operation on arrays, that is to produce array C that has all elements in array A that are not contained in array B?I can do this with while loops, but there must be a better way.
I am editing an old mail script that uses a a sendTO array to designate who actually gets the email. I want to add a value (an email address) at the end of the array so it is sent the same mail as any mail that goes through the form(teh form has one huge dropdown list now).
I just don't know how to simply add the value to the bottom of the list Any clues (i found some examples but there was way to much extra code that i was having trouble sifting out)?
I have two recordsets that I want to populate within an array.
The array will always have two columns, but the number of rows is unknown (sometimes 2 rows other times 200 rows). I'm not too familiar working with arrays.
I want populate the array using a loop. How would I define and populate the array within loop so that I don't lose values and each new set of values are populated into the array through each iteration of the loop? Code: