PDA

View Full Version : ASP search database


rich
02-28-2006, 12:42 PM
hello all. i found a very smart search function using Access/ASP here - http://www.stardeveloper.com/articles/display.html?article=2000051001&page=1 Originally it works fine - lists the records well. But when u search for nothing, or just open the search.asp page, it comes up with an error - "Microsoft VBScript runtime (0x800A0009)
Subscript out of range: '[number: 0]'". If anyone can have a quick lock at the code, i would appreciate any help there. One assumes that all i need is to change the structure just a little......

davidj
02-28-2006, 01:40 PM
where the form field variables are caught

use an IF

im not sure of the syntax in asp but you should be able to work this out

if (formfield ==''){formfield = 'x'}
this will stop any nulls being sent. Hopfully your script should be able to handle recordsets that are empty. just replace the x with something you know wont exist in the db