FoxMySQL

(v1.4.1    23-02-2006)


     Realization of library "FoxMySQL" for work with FoxPro 2.6 for DOS with MySQL is brought to your attention. The library "FoxMySQL" refers on developed by Valeriy Kuznetsov library FsOX, supports TCP/IP of the report on base Sockets API in environment FoxPro 2.5 for DOS (for Windows 95/98). It is possible for downloading on http://natalie-tours.ru/my/fsox/.

In library "FoxMySQL" are realized:


1) Connection to a MySQL-server;
2) A choice of a database;
3) An insert, updating and removal of records;
4) Reception of a selection in a text file with dividers between fields;
5) Reception of a selection in a dBASE III PLUS file (dbf File).

The library is in process of development, therefore some functions meanwhile are not realized.
We express gratitude to Valeriy Kuznetsov and vi.k for the given help and support in development of library "FoxMySQL".

The Description of functions
Function MySQLCon
Parameters host_IP, mysql_port, user, password, LogFile, BuffFile
Where:
host_IP - 4 byte line which corresponds to IP-address of a server;
mysql_port - port of a MySQL-server;
user - the user;
password - the password of the user;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored;
Type of the result: 'N' - Numeric;
Result: (See socket() from packer FsOX).


Function MySQLUseDB
Parameters Sock_N, DBName, LogFile, BuffFile
Where:
Sock_N - socket's number on which connection with a MySQL-server is carried out;
DBName - a name of a database;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored.
Type of the result: 'N' - Numeric;
Result:
0 - The database is chosen;
-1 - Error at data reception from a server;
-3 - Error at performance of query;
-5 - Error at sending the data to a server.


Function MySQLIns
Parameters Sock_N, ModiStr, LogFile, BuffFile
Where:
Sock_N - socket's number on which connection with a MySQL-server is carried out;
ModiStr - an Insert string;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored.
Type of the result: 'N' - Numeric;
Result:
more than 0 - Value of a field such as auto_increment, which was generated at an insert of record;
0 - In the table there is no field such as auto_increment;
-1 - Error at data reception from a server;
-3 - Error at performance of query;
-4 - Unknown error at performance of query;
-5 - Error at sending the data to a server.


Function MySQLChange
Parameters Sock_N, ModiStr, LogFile, BuffFile
Where:
Sock_N - socket's number on which connection with a MySQL-server is carried out;
ModiStr - Line for updating the data;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored.
Type of the result: 'N' - Numeric;
Result:
more or less than 0 - Quantity of the processed records;
-1 - Error at data reception from a server;
-3 - Error at performance of query;
-4 - Unknown error at performance of query;
-5 - Error at sending the data to a server.


Function MySQL2File
Parameters Sock_N, FileName, StrQuery, FieldList, Delim, LogFile, BuffFile
Where:
Sock_N - socket's number on which connection with a MySQL-server is carried out;
FileName - Name of a text file where the data will be saved;
StrQuery - Value of the 'Select' query;
FieldList - logical value, which indicate if the list of the fields is visible or not;
Delim - Character value, which delimit fields;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored.
Type of the result: 'N' - Numeric;
Result:
more or less than 0 - Quantity of the records received and written down in a file;
-1 - Error at data reception from a server;
-3 - Error at performance of query;
-5 - Error at sending the data to a server.


Function MySQL2Dbf
Parameters Sock_N, FileName, StrQuery, LogFile, BuffFile
Where:Sock_N - socket's number on which connection with a MySQL-server is carried out;
FileName - the name of the dBase file (extension of the file should be specified);
StrQuery - Value of the 'Select' query;
LogFile - a file for conducting magazine;
BuffFile - the buffer where the data which were sent with a server are stored.
Type of the result: 'N' - Numeric;
Result:
more or less than 0 - Quantity of the records received and written down in a file;
-1 - Error at data reception from a server;
-3 - Error at performance of query;
-5 - Error at sending the data to a server.


Global variables, which are uses in FoxMySQL:
ErrMsg - the text of error, which has arisen at last performance of query;
MErrCod - MySQL-code of the error, which has arisen at last performance of query;
AffRows - Quantity of the processed records, at successful performance of query;


foxmysql.prg (main library "FoxMySQL")
password.plb (the Library which realizes enciphering of the password)
password.c (the Code of library for realization of enciphering of the password)
fsox.plb (library for realization TCP/IP)
fsox_x.plb (library for realization TCP/IP)
test.prg (the Test program which uses "FoxMySQL")

Yours faithfully
Miroslav Nyameshchuk


Main    Foxmysql    Programms    History    Guest_book    Foxmysql (English)    FTP4DN    Foto    E-mail



Яндекс.Метрика
Хостинг от uCoz