ADO (Database) Code snippets on how to connect to a database, adding records etc

Connect string

Connecting

Deleting records

  • Delete records - ASPCode.net Date added:(1/22/2000 4:10:58 PM) When deleting records it is good enough just to build the SQL statement and call oConn.Execute:

General

Reading records

  • General tips - ASPCode.net Date added:(1/22/2000 4:02:34 PM) Reading records from a table is not hard, reading records in a optimized way is a little tougher. Often I see code like
  • General Open command - ASPCode.net Date added:(1/22/2000 4:04:10 PM) Reading records from a table is not hard, reading records in a optimized way is a little tougher. Often I see code like
  • I need just one single record - ASPCode.net Date added:(1/22/2000 4:05:48 PM) Optimize your code if you know only one record will be used
  • Looping through records - ASPCode.net Date added:(1/22/2000 4:06:56 PM) If you know you are gonna loop through a lot of records ( like when displaying a table of all articles in the system )

Updating records

  • Updating records - ASPCode.net Date added:(1/22/2000 4:09:32 PM) When updating records you basically have two choices.