Connect to a MySQL database using LISP

Hi,

I'm currently trying to connect a server MySQL database using Lisp.
(I'm aware of https://forum.bricsys.com/discussion/20305/connect-to-a-mysql-database-using-lisp)

I successfully managed to use ADOLISP.lsp and perform an SQL expression using this connection string :
	(setq
		MYSQL_USER "xxx"
		MYSQL_PWD  "xxx"
		MYSQL_HOST "xxx.x.x.x"
		MYSQL_DB   "xxx"
	)		 
				 
  ;; Connecting to the database ...
  (setq ConnectString
         (strcat	"Provider=MSDASQL;Driver={MySQL ODBC 3.51 Driver}"
			";Server=" MYSQL_HOST ";Database=" MYSQL_DB ";UID=" MYSQL_USER ";PWD=" MYSQL_PWD ";Option=3"
	)
  )
The thing is, I had to manually install the MySQL ODBC 3.51 Driver (from the MySQL website) on my computer in order for the code to work.

Although, since i would like my LISP codes to be shared with everybody in the office (shared lisp library), I am looking for a solution that would not require that every user install the required ODBC driver.

Is there a solution that i can implement using LISP to install or skip the need for the OCDB driver?
We are all using a Windows 10 x64bit computer.

Comments

  • In order to communicate with MySQL or any other database (oracle, access etc) you need a piece of database specific software, which exposes data and the SQL query language of the particular database(in this case MySQL) to external software like Bricscad and the Lisp environment ! So it is not possible to skip the driver installation because you need its functionality to connect to Bricscad and Lisp via COM.
    If you want to automate the installation of the driver within your network by deploying this installation to several computers, you would have to ask your windows admin (if any) to do it; this is a windows admin skill. I have installed similar oracle drivers to 10-20 computers one by one and took me almost 2 hours...
    It is a simple repetitive task.....
  • Thanks a lot @Konstantin Sakellaris.
    It is simply the hard truth.

    I'm seeing some light since I think i can programatically copy the installation files package and then simply run a batch file to install the driver. I'll test that out! Hope i can run the batch file without admin rights (or manage to programatically give admin right to run it)
  • You can do Shell and Startapp form a lisp to run external programs eg Notepad, Excel etc or a Bat file.

    The second thing is I use powershell and lisp to unzip a selected file make a directory and unzip files to that directory, as I have no access to a INSTALL program maker, so use lisp. Happy to provide more info.