Source language: Translate to:

List in a listbox all item from a dbf file

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

List in a listbox all item from a dbf file

Postby Alex » Fri Aug 15, 2008 6:55 am

Hi,

How can I list in a listbox all item from a table from a DBF file?

For example, in the table Name, how can I get all the name to a listbox?

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Wrangler » Fri Aug 15, 2008 7:28 am

Yup. Get help and copy and paste.

Alex, try reading the help file before you post questions. Everything you need to know on how to do this is in the help files. Then if you have problems while coding this, post your code here.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Alex » Fri Aug 15, 2008 7:33 am

Hi Wrangler,

It is not writen in the help or I don't know where it is.

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Wrangler » Fri Aug 15, 2008 7:41 am

How to get table names, and how to populate a list box is not in the help file? Apparently you aren't spending much time reading it. If you can't find it, look harder.

TRY AND CODE THIS YOURSELF. IF YOU HAVE PROBLEMS, POST THE CODE HERE. NO ONE HERE IS GOING TO BUILD YOUR APPLICATIONS FOR YOU.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby dglojnar » Fri Aug 15, 2008 7:44 am

You can use command dbffield to var, i think this solve Your problem
dglojnar
 
Posts: 112
Joined: Sun Apr 03, 2005 10:52 pm

Postby Alex » Fri Aug 15, 2008 7:45 am

Wrangler,

What I trying to do is not to know the table name, but the info what are in the table. For example:

Name (Table Name)
Car
Bus
Computer
TV
...

How can I get the information from the table?

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Alex » Fri Aug 15, 2008 7:49 am

Hi dglojnar,

Excellent, exactly what I search. I didn't know this command. Thanks a lot.


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby dglojnar » Fri Aug 15, 2008 7:52 am

Here is example:

dbfFieldToVar "[database]" "Name" "[data]" ""

where [database] is your dbf database, Name is a field name and [data] is all names from Name field.

After that create listbox and in list box window put variable [data]

Run and that's it.

I hope this help:-)
dglojnar
 
Posts: 112
Joined: Sun Apr 03, 2005 10:52 pm

Postby Alex » Fri Aug 15, 2008 8:06 am

Hi dglojnar,

Thanks very much, it works as I want.

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Re: List in a listbox all item from a dbf file

Postby kevinp » Sat Dec 29, 2012 9:44 am

That's brilliant. Is it possible to show multiple fields from a DB within a ListBox using this method. e.g.

On page load i have
dbfFieldToVar "C:\Users\admin\Desktop\Neobook\LCCdb\streets.dbf" "STREET" "[street]" ""
dbfFieldToVar "C:\Users\admin\Desktop\Neobook\LCCdb\streets.dbf" "TOWN" "[town]" ""

and I want to show the date in the list box as one line per record e.g.

Street name 1, Town Name2
Street name2 , Town name2

I've tried [street], [town] and also [street][#9][town] but it places each on a seperate line as below

Street name1
Town name1
Street name2
Town name2

I'm sure I'm missing something simple but have become a bit stuck.

Any suggestions would be appeciated
kevinp
 
Posts: 2
Joined: Fri Apr 13, 2012 2:35 pm
Location: UK

Re: List in a listbox all item from a dbf file

Postby smokinbanger » Sat Dec 29, 2012 6:28 pm

You can loop through the records in the database adding the street name and city to the list box.
So if record #1 was: Geek Street in Bend
and record 2 was Main St in Vegas
you could end up with a list box like:

Geek Street, Bend
Main St, Vegas

after running your loop sequence
Just Sayin'...
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest