HC Gateway 1.0.3
© 2000 Code 66 - All rights reserved

HCGateway in .sea.hqx format 808kb
HCGateway in .sit.hqx format 946kb


Introduction.
HCGateway is a gateway application that enables applications like Hypercard™, or Hypercard™ stacks to access and manipulate data that exists on any database server that can be accessed from the Macintosh via ODBC. The user must supply and understand how to configure ODBC to connect to a particular database. Any 3rd party ODBC drivers must also be supplied by the user.
HCGateway was written for Hypercard™, thats why the name

How to purchase?
Just go to: http://order.kagi.com/?95E

New in HCGateway:
1.0.3 Added command SCHEMA
1.0.3 Added command FIELDS
1.0.3 HCGateway now comes with a sample Hypercard stack.
1.0.2 Fixed potential problem when active logfile was deleted/moved..
1.0.1 Added menuitem for online purchase.


Quick guide to how it works.
The application, in this case Hypercard send an AppleEvent request misc, eval, to the HCGateway.
In Hypercard 2.4 you just type request command-string from program "HCGateway", where commandstring is the Command (SQL Command) that you want to execute, prefixed by a command to HCGateway on how to treat the SQL command passed.

Important Note on ODBC driver Alerts.
Some ODBC Drivers tend to show alerts on failed logins etc. Those alerts cant be bypassed by HCGateway, and when HCGateway in the background, those alerts can lock the machine. So, if this happends, try to switch HCGateway front. This usually happens on Login.
There are only for different HCGateway command prefixes:

LOGIN:<datasource>,<username>,<password>
This is the login command prefix. Before this command is issued, all other command will return an error. Error messages starts with a "!". If the login is successful, HCGateway return an OK.
The best solution is to place the logincommand in the on stackOpen.

EXIT:
This is the logout command prefix. Issue this when you want to logout from the curent database. A good place is to put it on the on stackClose section somewhere.

SCHEMA:
This is the schema command prefix. This commands returns a list of all tables in the selected database.

FIELDS:
This is the fields command prefix. This command returns a list of all fields in the given table, and their kind and if they accept NULL or not.

EXECUTE:<SQL command>
This is the prefix that is used for all type of operations that doesnt return data. Use this prefix for any Insert, Update and Delete operations. This call either returns an OK or an errormessage from the server.

SELECT:<SELECT statement>
This is the prefix that is used for SELECTs, i.e. retrieving sets of data from the server. HCGateway returns data as rows as follows:
<field1><tab><field2><tab>...<fieldn><cr>
Each field is separated with <tab> $09, the line is terminated with a <CR> $0D. Any errors are returned starting with "!", and followed by the errormessage from the Server.