Optimizing A Multidimentional-array-to-file Code

I have a multidimensional array that is actually 1 dimension (but it comes from a recordset.getrows). My goal is to put every single line of the recordset in a textfile.

currently, here is my code:

for i = 0 to UBound(Res,2)
fileContent = fileContent & res(0,i))
Next
createTxtFile(path,fileContent)

The problem is, I have 5000 lines and it takes about 10 minutes. I was thinking of doing a Array.Join but I don't think that works with multidimentional array. Also thinking of converting my useless multidimentional array into a sing dimensional array but how?

View Replies


ADVERTISEMENT

Optimizing Multidimensional Array Code

I have a multidimensional array that is actually 1 dimension (it comes from a recordset.getrows that returns 1 column). My goal is to put every single line of the recordset in a textfile. currently, here is my code Code:

for i = 0 to UBound(Res,2)
fileContent = fileContent & res(0,i))
Next
createTxtFile(path,fileContent)

I have 5000 lines and it takes about 10 minutes. I was thinking of doing a Array.Join but I don't think that works with multidimentional array. Also thinking of converting my useless multidimentional array into a sing dimensional array but how?

View Replies View Related

Optimizing Code On ASP Page

We have a report page which deals with more than 3000 records and 80 columns. The records are displayed on a third party control VS flexgrid versioned 7.0.

Currently we are having a client side array populated from the server side using response.write . Is there any other means to optimize the performance on this page?

View Replies View Related

Optimizing Asp Database Calls

I'm very interested in finding out what ways you experts out there have made your data dips more efficient in your asp (not asp.net) code.

I have a wizard-type application that dips into the database with each page, I know there's a better way to do this out there, just pressed for time and can't think right now.

View Replies View Related

Optimizing - Large Db Result Set

when creating a webpage that must display a large result set, the page load time is unbearable. Unfortunately, there are a lot of records and they all need to be displayed, at once, on this one page.

To reduce file size, I have minimized the amount of HTML tags used to dislay these records. My only other idea is to write javascript matrix to hold the data, and then to use dom to create the page on the client side. Are there any tried and true ways of speeding up page loads?

View Replies View Related

Reading Tab Delimited File Into An Array

I'm trying to read a tab-delimited file into an array so I can pick out different fields for a report. I keep getting a "Type Mismatch" error that I don't understand.

sReceiveFile = "receipt.txt"
sDataFile = sReceiveFolder & sReceiveFile
sDelimiter = "Chr(9)"

Dim objFileSystem, objFile
Set objFileSystem= CreateObject("Scripting.FileSystemObject")

Set objFile = objFileSystem.OpenTextFile(sDataFile,1)
sReadLine = objFile.readline

Do While objFile.AtEndOfStream <> True
Response.Write "<UL>" & Chr(10)
'Response.Write objFile.ReadLine & "<br>"
sSplit = split(objFile.Readline,"Chr(9)")
Response.write sSplit ' I want to see the contents and this line is giving me the error
Response.Write "</UL>" & Chr(10)
Loop
objFile.Close

%>

View Replies View Related

Read Tab Delimited File Into An Array With ASP

I need to read a tab delimted file into an array with ASP. Should be
easy enough, I know it is in Perl and PHP. Can someone show me how
that's done or post a link to an example.

This is what I'm trying to do in perl:

#!/usr/bin/perl -w

my $file = "myfile.txt";
open(FILE, $file);
while(<FILE>){
my ($f1, $f2, $f3) = split(' ', $_); # or @array = split(' ', $_)
print "F1:$f1 F2:$f2 F3:$f3
";
}
close(FILE);

View Replies View Related

Reading Array Elements From A Txt File

i am able to read from a txt file and this is the code:

View Replies View Related

Create An Array From A Text File

I have a textfile that I'd like to put into an Array using VBS. The text file has over 6200 entries. Is it possible to put those entries into an array automatically using VBS? So far all the resources I've looked at show manual creation of the array.

View Replies View Related

Delete A Line In Text File Or From An Array

I have an Access DB with newsletter preferences in it. What I am trying to do is select small groups to send a custom newsletter out to. So my localhost criteria web page goes to the Access DB and pulls the email addresses that match my current criteria. I then write that list out to a file (newsletterlist.txt). Maybe that is my problem, but I wanted to do that so if my machine crashed while processing, I would know where to recover it. I had looked at arrays and dictionaries but dictionaries aren't good from what I found for hundreds of entries and arrays I can't keep track of..argh.

Anyways, I then wanted to loop through the file (newsletter.txt) find the next email address, with it I can query back to the DB and get preferences and assemble the email and out the custom newsletter goes.

I've seen where MS says deleting a line using the FileSystemObject is not possible, though wanted to see if anyone has found a work around.

Performance isn't that much of an issue for me, as I figured I'd set the thing to running and go to dinner! So anyone have suggestions - even if it means taking the text info to an array, somehow delete one of the addresses and then put it back to a file...anything that can one by one delete the addresses so I know that it all has worked as there would be no email addresses left in the file.

View Replies View Related

ASP File Changes - Drops ASP Code

I have written a classic ASP calendar that has been on my organization's website for a couple of years now, and it has worked fine.

I do all of my writing to files on my hard drive, then when the files are working properly, I upload the files to the server. Therefore, the files on my hard drive should be identical to the ones on the server. This has worked fine in the past - I have had two fully functional calendars, one on my hard drive, the other online. Until now, they both looked and worked identically.

Now, I'm trying to modify the main file, "calendar.asp". It no longer works, and the online copy still works flawlessly. When I looked at the local file (calendar.asp), all of the ASP code had been stripped from the file. Of course, the online copy is still intact and working.

The only editor I have used on these files is Notepad (actually, Notepad ++, an enhanced Notepad). I would understand if I had tried to edit the files with Frontpage (I'm using Frontpage to upload files to the server, but that's all I use it for), but these local files haven't been touched by Frontpage.

What Gives? How can a file selectively remove it's own code and disable itself??!!!

I try exporting the files from the server, and though the server files still have their ASP code, the browser can't find one of the include files, which is plainly in the same folder as the calendar.asp file. The file "adovbs.inc" is no longer reachable from my hard drive, even if I export ALL of the files in the "calendar" folder to my hard drive.

What can be hoseing up my local files, and how can I prevent it? Although I have downloaded ALL of the files from the online copy to my hard drive, why do the files behave differently than they do online? What kind of trickery is this?

View Replies View Related

Load ASP Code From Another File

I am writing a small CMS type system for our intranet at work and I am trying to have a main "index.asp" that does all the work in a template folder and every time I add a new section instead of making a new copy of this file I would like to have some generic "index.asp" file that is nearly empty that just calls the "template/index.asp" file and let's it do the work.

The way each page in the intranet works is by using the same asp file but by having a few configuration files in their directory that point it to different menus, titles etc.

Is there a way to load an asp file from another one? I tried creating an index.asp containing just <!-- #INCLUDE FILE="templates/index.asp"--> but it doesn't seem to do it.

View Replies View Related

File Upload Code

I have a page for uploading files. I got the codes courtesy from Shadow Wizard's shadowuploader file which is posted online. as the asp upload is something new and i am not familiar with, anyway i tested the page to upload some files but there was an error displayed Error Type:

Microsoft VBScript runtime (0x800A004C)
Path not found
/shop/ShadowUploader.asp, line 283

it refers to this highlighted code in red. what does this error suggest. can anyone explain.

View Replies View Related

Code To Use File In A Directory

I'm coding a page where you can download a lot of different files( 100-1000) but I don't want to code each file(linking and all) it would take weeks to do that. I tried with a database and asp code rding the databse but it not saving a lot of time since I got to complete the databse.

I wanna know if we can code with asp something to automaticly read each file and list them in html so I dont have to code 1000 x the samee thing.

View Replies View Related

Include A File Code

I want to put this code in all my asp programs. code'objrs.cursorlocation=adUseclient' in all my asp programs. i hve created around 30 asp programs but forgot to place this one.

So is there any way to write only this code(objrs.cursorlocation=adUseclient) in any program, and include this file in all this 30 programs using #include file.

In all 30 programs , i have written code
set objrs=server.CreateObject("adodb.recordset")
objrs.open strsql,objconn,3,3

View Replies View Related

Code Behind File Not Being Refreshed

we're running IIS 5 and trying to do a simple update to a code behind file (Login.aspx.vb) we copy the file over to the server, but we're not seeing the updates. the server is still reporting errors on line numbers in the file that no longer exist. we've even stopped / restarted the service, with no luck.

View Replies View Related

Simple ASP File Upload Code

Can anyone tell me where I can find some 'simple ASP File Upload code'? I've googled 'File Upload' but they all seem to be very involved with a lot of files. I'm still considered a novice when it comes to ASP.

View Replies View Related

Simpe Code For File Upload

I have search the web last day all day and i did not find how to make a simple upload in APS not classes and third parties and don't know what .dll's that must be copyed on the server just 3-4 lines of code just like in PHP:

<input type="file" name="img">
$dir = "img/";
copy($img,$dir.$img) or die ("Error");

............

View Replies View Related

Code To Convert File Sizes

i have the following code that converts a file size into a readable format (10MB for example) to show to the user Code:

View Replies View Related

Encrypt An Asp File Source Code

we have an Enterprise Application on ASP and MS SQL 2000. Would like to know if I can convert the asp app to an exe or encrypt / encode / hide the source code so that no one accessing the server can touch / modify / copy the same.

View Replies View Related

Picture File Upload Code

I am looking for some code somewhere that is capable of getting information from a file submitted with the Form File tag and then uploading it to a remote server. Does anyoen know of anything?

View Replies View Related

Rebuilding Of An Array From An Existing Array

I dump the entire recordset into an array:

If not rs.EOF Then
aEmp = rs.GetRows()

Contents of the array are in this order:

EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName

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.

View Replies View Related

Array Integers Vs Array Variables

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

Code:

View Replies View Related

ASP Code - Anti Spam Verification Code

I'm looking for sample code that will require a use to enter a code from a scued image format.

I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.

I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.

View Replies View Related

Create A New Array From An Array

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?

View Replies View Related

Array In Sql

i want to excute given logic

select * from Product_Table where Product_Code in

ARRAY

i.e i want to select Product_Code from VB array and not from a query
is it possible.

View Replies View Related

Array

I know I can do this programatically using a loop but I thought there might be
some easier or more effective way.

I am trying to invert an array.

i.e.

array1 = 1,2,3,4,5

but I want to get

array2 = 5,4,3,2,1

Is there something like array2 = invert(array1)?

View Replies View Related

Array

I have to following code:Code:

dim arrRes(9),getal,som
arrRes=Array(4,4,4,4,4,5,5,5,5,5)
for getal=0 to 9
som=som+arrRes(getal)
next
response.write("Het klasgemiddelde is " &som/10)

I get a type not match error on the second line

View Replies View Related

ASP Array?

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.

Code:

View Replies View Related

Array

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

Can someone help me understand why?

View Replies View Related

Array

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.

View Replies View Related

Asp Array

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?

View Replies View Related

Array

I am doing the following:
Code:

dim n
n=4'ubound(arrsequences)
response.write "n:" & n
dim arrproductNames(n)
dim arrproductSeq(n)

and getting the following error:
Microsoft VBScript compilation error '800a0402'
Expected integer constant
process.asp, line 33
dim arrproductNames(n)

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved