[Gambas-user] Problem with the EXEC[] function
Rolf Schmidt
rolf.frogs at ...221...
Mon Mar 7 15:44:45 CET 2005
Hi
I fight since three days agains the EXEC[] function for external calls.
First why I use it: I would like to have some special setup for a postgresql
database.
Second: Postgresql is requiered because I need a lot of it's capabilities
which are not available in mysql.
Third: I would check if the setup of the database returns no error.
The code example:
PUBLIC DBisCreated AS Boolean
PUBLIC SUB Process_Read()
DIM sline AS String
LINE INPUT #LAST, sline
' message.Info(sline)
returndata = returndata & sline
IF sline = "CREATE DATABASE" THEN
DBisCreated = TRUE
ELSE
DBisCreated = FALSE
ENDIF
END
PUBLIC FUNCTION createDB() AS Boolean
CAskDB.ShowModal()
EXEC ["createdb", "-h", FHV.konfig.Key("host"), "-U",
FHV.konfig.Key("user"), "-E", "UNICODE",
FHV.konfig.Key("database")] WAIT FOR READ
' why is the flag always false?
IF DBisCreated = TRUE THEN
EXEC ["psql", "-h", FHV.konfig.Key("host"), "-u", FHV.konfig.Key("user"),
"-d", FHV.konfig.Key("database"), "-f",
"/home/entwicklung/hausverwaltung/HV/pgdatabase"] WAIT FOR READ
' why does this function never comes back - could it be, that it sends some
' informations via the error chanel? - How can I fetch these too?
ENDIF
END
Many thanks for any help
Rolf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050307/64051cec/attachment.sig>
More information about the User
mailing list