Hi,
Has anyone been able to access a SQLServer database from STX?
Either by ODBC or in another way?
If so, please give an example of how this is done.
Regards,
Jan
...
session := SQL::ODBCSession new.
session connectWithUsername:user password:password dbname:database.
...
statement := session newStatementFor:('SHOW TABLES LIKE ''%1'';' bindWith:tableName).
cursor := statement execute.
[ cursor next notNil ] whileTrue:[
row := cursor rowAsArray.
....
].
...
statement := session newStatementFor:('SELECT * FROM %1' bindWith:tableName).
cursor := statement execute.
[cursor next notNil] whileTrue:[
obj := cursor rowAsObject.
...
].
...
session disconnectSmalltalk loadPackage:'stx:libdb/libodbc'Smalltalk loadPackage:'stx:libdb/libodbc'| session |
session := SQL::ODBCSession new.
self halt.Users browsing this forum: No registered users and 1 guest