1.     Copyright (C) 1999 G.NET SOFTWARE COMPANY

-this software library is free software and is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

LIBMYSQL.DLL is under

MySQL AB & MySQL Finland AB & TCX DataKonsult AB

     COPYRIGHT.

 

2.     VERY IMPORTANT

-you need to have libmysql.dll (ver. 3.x or 4.x – if you wish to use SSL you must use LIBMYSQL.DLL ver 4.x) in your computer, in the same directory (it’s recommended to use “c:\windows\system” or “c:\winnt\system32”) with GMySQL.dll and GMySQL.tlb. If you don’t have already the libmysql.dll you can go to http://www.mysql.com/downloads/index.html to download the entire MySQL server application(including libmysql.dll).

-in any VBA (Microsoft VB,Excell,Word,Access) you must use:

                   -“Option Explicit”(look carefully in examples)

-initialise string variables which are used in functions for returning data by reference (E.g.:mysql_fetch(),mysql_error()…).If you don’t do this , MSVCRTD.dll will generate a system error. This can be a little uncomfortable but offer speed performance .In fact, this was the reason for which I decide to use only LPSTR instead of BSTR, for strings manipulation.

         

3.     DESCRIPTION

 

          The purpose of this DLL (TypeLibrary) is to make easy accessing and connectivity to MySQL Server

avoiding the ODBC and  complicated ADO. Are over 40 MYSQL C API (base) functions which you can be used in

(theoretically) all software  which has been designed to develop Windows software applications.

 

 

4.     INSTALL

          - the GMySQL.dll(.TLB ) and libmySQL.dll is preferable to be copy and  reside together in WinSys

                                                                   directory (Ex: C:\Windows\System or c:\WINNT\System32)  

          - after you copy this files, must add in "References" the GMySQL.DLL using "Browse" button in the next way :

                   -Visual Basic :

                             -Go to "Project" and click in "References"

                   - Excel :

                             -Go to "Tools", click in "Macro" and select "Macros"(with "Play" sign)

                             -Create a new macro by typing a "macro name" in edit box...

                                     ...button "Create" become enabled and click on this button.

                             or

                                    ...select a existing macro name from the list and click on the "Edit" button.

                             -After Visual Basic editor apear go to "Tools" and select from submenu

                             "References".

                   - Access:

                             - Go to "Tools",select from menu "Macro" and select "Visual Basic Editor"

-         Here,  go again to "Tools" and select "References".

 

5.     How can be used ?

It’s recommended to use only functions which have “mysql_” like prefix. The other functions are obsolete and can not be used in multiple connections/query and can not be used with the new implemented functions.

For the moment the only help is the “Samples” which show you how can be used this “adapted” C API. Look carefully in examples from “Samples” directory.

 

New implemented function in GMySQL :

 

mysql_info                                         -Sub mysql_info(ConID As Long, retInfo As String)

                   mysql_character_set_name                 -Sub mysql_character_set_name(ConID As Long, retChar As String)

                   mysql_stat                                         -Sub mysql_stat(ConID As Long, retStat As String)

                   mysql_get_server_info                       -Sub mysql_get_server_info(ConID As Long, retSinfo As String)

                   mysql_get_client_info                         -Sub mysql_get_client_info(retCinfo As String)

                    mysql_get_host_info                          -Sub mysql_get_host_info(ConID As Long, retHinfo As String)

                   mysql_insert_id                                  -Function mysql_insert_id(ConID As Long) As Long

                   mysql_thread_id                                 -Function mysql_thread_id(ConID As Long) As Long

mysql_change_user                            -Function mysql_change_user(ConID As Long, myUser As String, MyPasswd As String, MyDb As String) As Long

                   mysql_init                                          -Function mysql_init(ConID As Long) As Long

mysql_real_connect                            - Function mysql_real_connect(ConID As Long, Host As String, User As String, password As String, db As String, port As Long, unix_socket As String, clientflag As CLIENT_FLAG) As Long

mysql_options                                   -Function mysql_options(ConID As Long, option As CONNECTION_OPTION, arg As String) As Long

mysql_ssl_set                                    - Function mysql_ssl_set(ConID As Long, key As String, cert As String, ca As String, capath As String, cipher As String) As Long

                   mysql_ssl_clear                                  - Function mysql_ssl_clear(ConID As Long) As Long

                   mysql_shutdown                                - Function mysql_shutdown(ConID As Long) As Long

                   mysql_dump_debug_info                   - Function mysql_dump_debug_info(ConID As Long) As Long

                   mysql_kill                                          - Function mysql_kill(ConID As Long, cPid As Long) As Long

                   mysql_store_result                             - Function mysql_store_result(ConID As Long) As Long

                   mysql_use_result                                - Function mysql_use_result(ConID As Long) As Long

                   mysql_num_rows                               - Function mysql_num_rows(ConID As Long) As Long

                   mysql_num_fields                              - Function mysql_num_fields(ConID As Long) As Long

mysql_real_query                               - Function mysql_real_query(ConID As Long, q As String, length As Long) As Long

                   mysql_errno                                       - Function mysql_errno(ConID As Long) As Long

                   mysql_error                                       - Sub mysql_error(ConID As Long, ErrDesc As String)

                   mysql_eof                                          - Function mysql_eof(ConID As Long) As Long

mysql_fetch_fields                             - Sub mysql_fetch_fields(ConID As Long, fieldID As Long, resField As String)

                   mysql_fetch_row                               - Function mysql_fetch_row(ConID As Long) As Long

                   mysql_close                                       - Function mysql_close(ConID As Long) As Long

                   mysql_free_result                               - Function mysql_free_result(ConID As Long) As Long

                   mysql_fetch_lengths                           - Function mysql_fetch_lengths(ConID As Long) As Long

                   mysql_affected_rows                         - Function mysql_affected_rows(ConID As Long) As Long

                   mysql_field_count                              - Function mysql_field_count(ConID As Long) As Long

                   mysql_select_db                                - Function mysql_select_db(ConID As Long, db As String) As Long

                   mysql_ping                                        - Function mysql_ping(ConID As Long) As Long

                   mysql_whoami                                   - Function mysql_whoami(ConID As Long, whoami As String) As Long

mysql_fetch                                       - Function mysql_fetch(ConID As Long, fieldID As Long, resLoc As String) As Long

mysql_data_seek                                - Function mysql_data_seek(ConID As Long, RowNumber As Long) As Long

mysql_fetch_field_direct                    - Function mysql_fetch_field_direct(ConID As Long, fieldRes As String, fieldnr As Long) As Long

                   mysql_field_seek                                - Function mysql_field_seek(ConID As Long, fieldnr As Long) As Long

                   mysql_escape_string                          -Function mysql_escape_string(to As String, from As String,                                                                                           from_length As Long) As Long

mysql_real_escape_string                   - Function mysql_real_escape_string(ConID As Long, to As String, from As String, legth As Long) As Long

                   mysql_list_dbs                                   - Function mysql_list_dbs(ConID As Long, wild As String) As Long

                   mysql_list_tables                                - Function mysql_list_tables(ConID As Long, wild As String) As Long

mysql_list_fields                                - Function mysql_list_fields(ConID As Long, table As String, wild As String) As Long

                   mysql_list_processes                         - Function mysql_list_processes(ConID As Long) As Long

                   mysql_refresh                                    - Function mysql_refresh(ConID As Long, param As Long) As Long

 

 

Any problem can be reported at: develop@gonetsoftware.com and on the e-mail subject, you must specify "GMySQL TypeLibrary".

 

Have fun

 

 Gelu