VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. I

by Matt Hawrysko (2 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 18th March 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. It is a good idea to clear the contents of

Rate Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. I



' through an ODBC driver.
nameRS.Open _
("SELECT CUST_ORDER_NO, DELIVERY_DATE FROM CUST_ORD_HDR WHERE            CUST_NO='" & tempCUSTnumber & "' ORDER BY DELIVERY_DATE")
' I don't know if anyone else has had trouble figuring out the
' SQL syntax in VB6.                
Screen.MousePointer = vbHourglass
' Build the array for the listbox.
 ReDim arrayActualOrder(0)
   Do Until nameRS.EOF
     Screen.MousePointer = vbHourglass
     arrayActualOrder(i) = nameRS!CUST_ORDER_NO 
     ' myODBCList2 is a ListBox on the Main Form
     myODBCList2.AddItem arrayActualOrder(i)
     ReDim Preserve arrayActualOrder(UBound(arrayActualOrder) + 1)
     nameRS.MoveNext
     i = i + 1
   Loop
Screen.MousePointer = vbDefault
    End If

Download this snippet    Add to My Saved Code

Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. I Comments

No comments have been posted about Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. I. Why not be the first to post a comment about Passing a string variable to the SQL WHERE Statement and fills a ListBox with the data retrieved. I.

Post your comment

Subject:
Message:
0/1000 characters