Solved

VB and ASP optimization tasks

Posted on 2004-03-30
2
390 Views
Last Modified: 2013-11-13
i am running an standard exe using Wscript.shell. my Vb program accepts 2-5 parameters and connects to a remote database and downloads those tables from SQLserver. the parameters i pass are the table names. it will download the data and zip them and email the user as attachment and uploads these files to a ftp server using Inet object. Is there a way to speed up the process ? and how can i close the VB program if connection to remote database fails or data download is stuck or for some other reason. can anyone give me step by step code to do these optimization tasks and to speed up the entire process.plz help me the project is due today and i have everything ready but its running too slow.

I appreciate ur help in this regard
Thanks
Rama
0
Comment
Question by:ramakrishna1080
2 Comments
 
LVL 4

Expert Comment

by:sokolovsky
ID: 10721558
Post your code, at least part that connects to a remote database and downloads those tables from SQLserver
0
 
LVL 17

Accepted Solution

by:
inthedark earned 500 total points
ID: 10722663
How many seconds does it take at present? Provide a timing for each part of the process. Emailing is a very slow method of data exchange.  This is because the Zipped data has to be expanded to base64 encoding.  Then a connection to an SMTP server  has to be made, this can take ages (anything upto 1-2 minutes for before the server lets you start sending. The smtp server then contacts the destination MX server and repeats the process.

If you are send via the vbSendMail app. I have reworked the base64 encoding so that it is serveral times faster, but I don't think this is where the slow point is.

In theory the maximum speed could be calculated.

The worker dll has to connect to an SQL server and get the records. For best  speed this yould be using a client locatoed recordset using a readonly+forwardonly options.

Guestimation for a system which does not use email (all depends on size of data):

System A initiates the request for data from System B to be upload onto System C.

If System B was listening on a port using as winsock control.

Process for system B.

Accept the request 0 seconds

RS Open
Say a smallish recordset should only take about a second to open the recordset.

Convert RS to a file
Using the RS.Save with the adPersistADTG should take about 0.5 seconds to save the data.

ZIP the data
Again this should only take about a second.

Convert to base64
Should take about 1 sec per MB.

Send the data back to the client, using winsock. This depends on speed of internet/lan. Much more time is running on internet.

Process on system A continues after all data has been received.

Decode the base64 data takes about 1 second per MB.

FTP to System C

FTP the data to the destination server say about 1 second for this. But longer if uploading via the internet.

So the total time should only be about 6-7 seconds per megabyte if both systems are on a resonable lan.

You could shave some further time by sending the request drectly to System C eg:

System A contracts System C (the destination for the data) and send the parameteres needed.  System C contracts System B and gets the data and then saves the data locally.  This should be looking about 3-4 seconds.


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
countHi2 challenge 7 52
VBS file using code from 2nd file (txt or vbs) 4 30
Re-position the objects 7 96
rhino JavaScript import, load 25 66
This article will show, step by step, how to integrate R code into a R Sweave document
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to implement Singleton Design Pattern in Java.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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