Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box with a SQL row-source
Message
From
26/10/2000 10:27:16
 
 
To
26/10/2000 10:12:23
Fida Shamsoodeen
Combined Systems (Pty) Ltd
Centurion, South Africa
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00434556
Message ID:
00434570
Views:
35
Hi, Fida!

When you choose SQL row source type for combobox or listbox, you can put you SQL Select statement just into the RowSource property. Combobox will run this query automatically when created in ru-time. Note that you will need to use 'INTO CURSOR ...' in the SQL query, otherwise it will not work. You may close that temporary cursor in the Destroy method of combobox or listbox. Important warning: Never use 2 or more comboboxes/listboxes based on the same cursor, sometimes this cause weird error messages.
If you want to run query again or change query for combobox/listbox in runtime, use following way:
Combobox.RowSource = ''
Combobox.RowSourceType = 0
Combobox.RowSourceType = 3 && SQL
Combobox.RowSource = 'SELECT ....'
In addition, in desighn time you can put only short query into the RowSource property because it allows only 255 characters maximum. You can use longer query string in the Init method of combobox by direct assignment of query string.

>Can anyone please help with this.
>I usually make a ComboBox with the RowSourceType normally as Fields.
>Now i wish to choose SQL statement. The problem is where do i put the SQL statement and how do i call it?
>
>I would also like to do the same for a ListBox
>
>Any help would be appreciated
>Thanks
>Fida
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform