Hi Mark,
Specifying a connection via the dsn: message needs a defined data source name from the 32-bit ODBC control panel. I usually configure this as part of a deployed application's setup script.
Specifying a connection directly from application code needs the connectString: message using the parameter names for the particular database type you're using. Those for MySQL are detailed here:
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-without-dsn.html
For your example this would give (depending on the version of the MySQL ODBC connector you're using):
aReStore connectString: 'DRIVER={MySQL ODBC 8.0 ANSI Driver};SERVER=192.168.1.150;DATABASE=test_database;USER=root;PASSWORD=123456'.
Using a connection string in this way is supported in recent versions of ReStore. If you're using an older version let me know and I can supply a patch file to enable this.
Hope this helps.
John
On Wednesday, August 12, 2020 at 10:05:05 AM UTC+1, Mark Davis wrote:
Hi John,
I should have been more specific; the server is installed on a remote server. So, I have to provide an ip address in the script to get a connection? All smalltalk clients will access the server via ip address when deployed. So can only guess the ip
address must be provided:
aRestore := SSWReStore new.
aRestore dsn: 'dbname=test_database;hostname=192.168.1.150'.
aRestore uid: 'root'.
aRestore pwd: '123456'.
aRestore useTransactionsWithoutVersioning.
aRestore supportsFullTableRecords: true.
aRestore connect.
afterwhich, the script adds the appropriate classes:
aRestore
addClass: ClassA;
addClass: ClassB;
addClass: ClassC.
aRestore synchronizeAllClasses.
aRestore disconnect.
aRestore := nil.
I'll give this a whirl in the morning and see how it goes.
Hopefully this is the correct procedure to connect to the remote server opposed to connecting to a database on the same dev machine.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)