[thelist] cf vs asp

Madhu Menon madhu at asiacontent.com
Fri Aug 25 11:12:18 CDT 2000

At 08:38 PM 8/25/00, you wrote:
>like a said before, that's because CF adds the layer of
>extrapolation between the OS and the application... so yes, you
>need more code to do it in ASP, but it's all VB code you may have
>sitting around...

Darn right. You could even put it into a function if you wanted to.
Heck, I just use ASP Express that has a wizard for this. Punch in a few 
values and bang! Out comes your entire code.

> > - (correct me if I'm wrong on this) We had to use ODBC to connect to
> > Oracle and SQLServer from ASP.  ODBC isn't a super efficient way of
> > connecting so that could be a disadvantage performance-wise.
>you can connect via ODBC, OLEDB, MS Jet (for Access for

Use OLEDB man! Much faster. In fact, here are a whole bunch o' tips to 
speed up your ASP code:

a) Use a SQL Server stored procedure to execute the query, improving query 
execution time. Make the DB do the work.

b) Instead of "SELECT * FROM Details", select only the columns she wanted 
in the query, reducing the db's work. Select a TEXT field only if you 
absolutely HAVE to.

c) Change the Cache size for the recordset (rs.CacheSize = 10) to 
significantly improve performance. Changing it from the default of 1 ALWAYS 
improves performance.

d) Instead of using ODBC, use raw OLEDB calls to the database. It screams!

e) The most important: Instead of doing rs.MoveNext to loop through 
records, using the GetRows method of the RecordSet object. This transports 
the RecordSet into an array and allows you to free up the connection 
immediately. Combined with the CacheSize property, it gives a boost to 
performance. Arrays are much faster to loop through.

f) Instantiate the db connection only in the line before the query was 
executed instead of the top of the page. Close the connection as soon as 
it's not required.

g) Instead of mixing up ASP with HTML, put the entire HTML part of the page 
as a string and use ONE Response.Write to spit it out in one shot. This 
would make things faster as IIS caches ASP pages ONLY if they contain 
nothing BUT ASP code (thanks to sgd for this one).

Hope this helps to improve your own code speed. I tell you; you'll feel the 
difference when your scripts run like greased lightning.



<<<   *   >>>
Madhu Menon
Webmaster, India.CNET.com
The source for computers and technology

More information about the thelist mailing list