Welcome! Log In Create A New Profile

Advanced

How to use a variable in HExecuteSQLQuery?

Posted by Ola 
Ola
How to use a variable in HExecuteSQLQuery?
March 30, 2009 08:35PM
Hi all,

I am building a Treeview control and trying to use HExecuteSQLQuery-commands in it, but with poor results. Sample:

iGroup is int (... and has been given some value...)

FolderQuery is Data Source

IF NOT HExecuteSQLQuery(FolderQuery,...
"SELECT SPFOLDER.FOLDERNAME AS NAME FROM SPFOLDER WHERE SPFOLDER.SPGROUPID = iGroup") THEN

...gives an error, complaining that the iGroup-variable is not a file item. Now the question: Is it possible to use non-fileitem variables in a HExecuteSQLQuery-command? How?

Thanks in advance for any hints and tips

Ola Pedersen
[www.pienoismalli.com]
Paulo Oliveira
Re: How to use a variable in HExecuteSQLQuery?
March 30, 2009 08:41PM
IF NOT HExecuteSQLQuery(FolderQuery,...
"SELECT SPFOLDER.FOLDERNAME AS NAME FROM SPFOLDER WHERE SPFOLDER.SPGROUPID = "+iGroup) THEN

assiming that SPFOLDER.SPGROUPID is int or some other numeric type var.
Gee,

This forum really is slow... It took a whopping 360 seconds to get a solution to a problem:-)

Thank you Paulo!

Ola
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: