PxPlus User Forum

Main Board => Discussions => Language => Topic started by: michaelgreer on May 04, 2021, 10:27:38 AM

Title: Opening MySQL on a remote server using ADO command tag
Post by: michaelgreer on May 04, 2021, 10:27:38 AM
I have a situation where I need to access a SQL database on a different server than the one where I am running PxPlus (same network).  Can someone give me a working example of an open command  to do this. It is not clear to me from the documentation where I specifiy the ip address for the server.
Title: Re: Opening MySQL on a remote server using ADO command tag
Post by: EVa on May 04, 2021, 11:00:50 AM
The syntax would [MySQL]Database;Table;host=ip_addr;user=name;pswd=password;etc...


Title: Re: Opening MySQL on a remote server using ADO command tag
Post by: Devon Austen on May 05, 2021, 08:26:39 AM
If you are connecting to a MySQL database you likely want to use the [mysql] tag in your open. The [ado] tag is used for connecting with Microsoft SQL Server databases.

The example in the post above is correct and you can use the host= option to specify the server address where the MySQL DB is hosted. I would also add that you may need to also use the port= option to specify the port the MySQL server is running on. For details of the different [mysql] options please see https://manual.pvxplus.com/?command_tags/mysql.htm

OPEN (HFN)"[MySQL]Database;Table;host=ip_addr;port=port_num;user=name;pswd=password;"