Useful Tips in ASP and SQL

By: angeldiana | Posted: 14th May 2009

Useful Tips in ASP and SQL



ASP and SQL are most widely used server side program and Database respectively. I thought of giving few tips in ASP as well as in SQL.

Tips on good "ASP dealing with the Database" Coding Practices:

• When dealing with Databases it is always advisable to "Open the connection at the latest and Close it at the earliest".

• Don't create recordsets for insert and update statements. If your database connection name is 'DBConn' then use DBConn.execute (SQLString).

• Use stored procedures to the Max. They are inevitable faster than executing SQL statements.

• For the display of records for 'read only and forward only cursor movement' operation use the 'Set rsRecordSet=DBConn.execute("Select SQL statement")' statement.

• Set all variables assigned using the 'SET' operator to 'Nothing' as soon as you are finished with using them. This includes the Connection Object, Recordsets, fields, etc

Null Data Entry: When working in your SQL data display pane you might want to place a null value that stores the value truly as ''. For achieving, this just select the cell and press the 'Ctrl'+'0' (Zero) keys.
This article is free for republishing
Printed From: http://www.a1articles.com/useful-tips-in-asp-and-sql-892108.html

Back to the original article

Tags: variables, databases, server side, data entry, null value