Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL as source of combo box

Status
Not open for further replies.

jerold

Programmer
Aug 30, 2000
52
PH
How can i make a user-defined sql as source of combo box
without generating the result query window?
Please help me.
Thank you very much.
 
Hi,

Basically what you can do is do a SQL Select stament into a cursor.

eg, SELECT * FROM customer INTO CURSOR lrCustomer

Therefore you can actually assigned the rowsource of the Combo Box to the lrCustomer. For more information check out
SELECT-SQL in the msdn.

Hope that helps.

Yue Jeen

 
1. Where will I put my sql statement as source of the combo box?

2. What will I put on the control source of the combo box?
 
I have created the query for my table and save it as cursor as its output settings. Then I assigned sql as rowsourcetype of my combo box and the name of the cursor as rowsource. When I run the form, Im getting an eror message like this:Unrecognized command...
Could help me the proper way of setting up this combo box
with sql as source.
Thank you very much.
 
You get 'Unrecognized command...' because SQL statement should be assigned to RowSource property when you yse 'SQL' for RowSourceType. When form loaded, VFP tries to run such SQL. You assigned alias there, when VFP expect SQL statement. So, what VFP can tell in such case? :)
Use 'alias' source type, when you already have an alias (no matter that it is made by SQL).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top