0

I have select Query that selects distinct value from a column. Is is possible to use these distinct values in my mapbasic program to make buttons and button labels?

More Info:

SQL Query : Select vendor from table_name ;

Now the selected vendors name are used to make buttons but I don't know how to get each row from table and put it in mapbasic variable. I am used to JAVA programming but don't know how it works in mapbasic. In java program we store the table in resultset and loop through it to get the row of column. I need to know how is it done in map basic. I read the mapbasic guide but could not get information about this kind of stuff.

asked Aug 17, 2011 at 5:13
1
  • What buttons? Of course, if it is a text field, you can use the text. You can also use these for function name calls I guess. You'll need to expand on what you need to do. As a word of advice, in future, could you put as much information as you can in your questions, as it makes them easier to answer, and we're all here to help. Commented Aug 17, 2011 at 6:17

1 Answer 1

2
Open Table "MyTab.tab" as MyTable interactive
or Select Vendor from MyTable as Vendor
Fetch First From MyTable 
Do While Not EOT(MyTable)
 strVendor = MyTable.Vendor
 ...do stuff (call program to make buttons?)
Fetch Next from MyTable
Fetch First From Vendor
Do While Not EOT(Vendor)
 strVendor = Vendor.Col1
 ...do stuff (call program to make buttons?)
Fetch Next from Vendor

etc, etc

answered Aug 17, 2011 at 6:59
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.