Array similar Table...

User avatar
sal21
PlatinumLounger
Posts: 4481
Joined: 26 Apr 2010, 17:36

Array similar Table...

Post by sal21 »

I have this code sql:

Code: Select all

....
        SQL = "SELECT IMP_OPERAZIONE, NR_ASS, ASS, CONT, NR_CIRC, CIRC, COMMISS, ACC_CC, ADD_CC, NR_CDI, CDI, RESTO, COD, OPERAZIONE FROM L0928_SI ORDER BY IMP_OPERAZIONE"
    Set RST0 = New ADODB.Recordset
    RST0.CursorType = adOpenForwardOnly
    RST0.LockType = adLockReadOnly
    RST0.Open SQL, CONN

If Not RST0.EOF Then
        strDBRows = RST0.GetRows
        RST0.Close
    Else
        MsgBox ("QUERY VUOTA")
        Exit Sub
    End If
....
The last item in select query is OPERAZIONE...
Now i need to retrive all value from strDBRows based my_var_find is = to the value of OPERAZIONE in array...

I think is similar to select where in sql query, or not?

User avatar
HansV
Administrator
Posts: 79365
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Array similar Table...

Post by HansV »

Why don't you add a WHERE clause to the SQL?

SQL = "SELECT IMP_OPERAZIONE, NR_ASS, ASS, CONT, NR_CIRC, CIRC, COMMISS, ACC_CC, ADD_CC, NR_CDI, CDI, RESTO, COD, OPERAZIONE FROM L0928_SI WHERE OPERAZIONE='" & my_var_find & "' ORDER BY IMP_OPERAZIONE"
Best wishes,
Hans