Classic ASP SQL Injection Protection

Stored Procedures and/or prepared statements: https://stackoverflow.com/questions/1973/what-is-the-best-way-to-avoid-sql-injection-attacks Can I protect against SQL Injection by escaping single-quote and surrounding user input with single-quotes? Catching SQL Injection and other Malicious Web Requests With Access DB, you can still do it, but if you’re already worried about SQL Injection, I think you need to get off Access anyway. Here’s … Read more

Code to loop through all records in MS Access

You should be able to do this with a pretty standard DAO recordset loop. You can see some examples at the following links: http://msdn.microsoft.com/en-us/library/bb243789%28v=office.12%29.aspx http://www.granite.ab.ca/access/email/recordsetloop.htm My own standard loop looks something like this: Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset(“SELECT * FROM Contacts”) ‘Check to see if the recordset actually contains rows If Not … Read more

Case expressions in Access

You can use the IIF() function instead. IIF(condition, valueiftrue, valueiffalse) condition is the value that you want to test. valueiftrue is the value that is returned if condition evaluates to TRUE. valueiffalse is the value that is returned if condition evaluates to FALSE. There is also the Switch function which is easier to use and … Read more