Scripting with custom tokens
Updated: 21 May 2010 | 3 comments
I am trying to set a custom token as a variable in a vbscript.
I set up the custom data source in the tools menu.
The line is:
strVariable = %#DB-Alias*"Select Field1 from Table where Field2 = whatever"%
I've also tried:
strVariable = "%#DB-Alias*"Select Field1 from Table where Field2 = whatever"%"
DB-Alias is the name I set up in custom data sources.
Either way it sets strVariable to null.
I'm not sure what I'm missing, any help would be appreciatted.
Thanks.
discussion Filed Under:
Comments
Custom tokens
Try this format. I use custom tokens all the time and haven't had any trouble.
%#*"select data from dbo.myCustomTable where id='123'"%
Custom tokens
Your solution unfortunately doesn't cover the two issues:
I am encountering the same issue when I try to look up information based on a computer's serial number.
Does your token work if you
Does your token work if you use it in a DOS task? You can do it direct from DS instead of a batch file.
i.e. echo %#DB-Alias*"Select Field1 from Table where Field2 = whatever"%
Also, you may need to put inverted commas around 'whatever', in your query.
Would you like to reply?
Login or Register to post your comment.