[BNM] 2 questions of ASP/VB

Dave Child dave at ilovejackdaniels.com
Mon Apr 10 18:16:38 BST 2006



> 1. Does VB support variable variables,  ie using the value of a variable
> as a variable name?

Yes, using Eval.

firstvar = "fish"
secondvar = "wife"
var = Eval(firstvar & secondvar) 'var = fishwife

I think that's right, though it's been a while and my ASP's a bit rusty.

> 2. With a ASP/VB to Access via ADO connection setup, is it possible to
> get the server to auto-truncate the input value of a field - so that if
> a field is set up as say text / 50 characters long, and the input is
> longer, it just truncates to 50 chars rather than throw an error?  Or do
> I have to truncate separately before writing to the database?

You can catch errors and hide them, or truncate data. Don't think you can  
do what you want and just add the first 50 chars without truncating before  
inserting.



-- 
http://www.ilovejackdaniels.com - Web design and development resources.



More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service