[Gambas-user] How do I execute this istruction

francesco.difusco@libero.it francesco.difusco at ...69...
Mon Sep 13 14:39:23 CEST 2004


How do I execute this istruction ?

EXEC ["mdb-schema", DbName, "-T", tablename] FOR READ AS p2

I am writing this code to get all the tables in an mdb database. I get the
database name, and then, by the command mdb-tables I get all the tables of this
database. The command
mdb-schema DbNAme

gives me the structure of the entire database or of a single table. If I write

mdb-schema DB-Name I get the structure of all the tables in the database, but I
can specify a table name,

mdb-schema DbName -T Tablename

and I get all the fields description of a single table.

I want to capure the output of these commands in a Gambas program, so I wrote
some code. The folowing code is executed after I click over a button, button1.

At the opening of the form I fill a listbox with all the tables name of the
selected database.
Then I select an item in the listbox and press button1.

"Tabelle" is tables in Italian :-)

PUBLIC SUB Button1_Click()
DIM tablename AS String
DIM p2 AS Process
IF tabelle.Index<>-1 THEN
textbox1.text=tabelle.Current.text
tablename=tabelle.Current.text
EXEC ["mdb-schema", DbName, "-T", tablename] FOR READ AS p2
ELSE
textbox1.text="Nessun elemento selezionato"
EXEC ["mdb-schema", DBname] FOR READ AS p2
Object.Attach(p2, ME, "proc2")
ENDIF
end

But when I execute the program and I select an item in the listbox, the program
is blocked. If I don't select an item in the list, teh program works correctly.

Francesco





More information about the User mailing list