Hi
I am using VB6 and an MS SQL Express database. I have an SQL statement that has a variable in the Select section.
sql_str = "SELECT DISTINCT " & dist_filt & " from sessions WHERE " & filt(level)
The dist_filt variable holds the field name i am interested in and the filt(x) holds a string.
The SQl statement works fine and the recordset opens up. My problem is in the next part, i am trying to do the following to fill an array.
With recordset
.movefirst
arr(x)=! & dist_filt
etc
My problem is with the syntax for the ! & dist_filt. Normally of course this would be arr(x)=!field but I have been struggling with the syntax to build the ! into this without it being enclosed in quotes.
Any help wouldbe gratefully recieved.
I am using VB6 and an MS SQL Express database. I have an SQL statement that has a variable in the Select section.
sql_str = "SELECT DISTINCT " & dist_filt & " from sessions WHERE " & filt(level)
The dist_filt variable holds the field name i am interested in and the filt(x) holds a string.
The SQl statement works fine and the recordset opens up. My problem is in the next part, i am trying to do the following to fill an array.
With recordset
.movefirst
arr(x)=! & dist_filt
etc
My problem is with the syntax for the ! & dist_filt. Normally of course this would be arr(x)=!field but I have been struggling with the syntax to build the ! into this without it being enclosed in quotes.
Any help wouldbe gratefully recieved.