Being COBOL illiterate, I may not be able to help. Two questions come to mind in reviewing the parameters you are passing.
Are the parameters by reference passed as char-like pointers and the parameters by content passed as integers? If they are, then the only issue I see as a possibility is that 'fMySQLSocket' should be passed as NULL not 0. Also make sure mysqld is running on 'myserver'. I hope this helps... Pat... BTW replies to the list usually yield better results. ================================================ ----- Original Message ----- From: "Arunachalam" <[EMAIL PROTECTED]> To: "Patrick Sherrill" <[EMAIL PROTECTED]> Sent: Tuesday, December 30, 2003 8:44 AM Subject: COBOL Syntax of calling MySQL's C API > Hello Patrick, > > The actual calling routines in C is; > > MYSQL *mysql_real_connect(MYSQL *mysql, > const char *host, > const char *user, > const char *passwd, > const char *db, > unsigned int port, > const char *unix_socket, > unsigned long client_flag) > > I have declared the variables with values are; > > 05 C-cMySQLHostName pic x(9). > 88 fMySQLHostName value 'myserver'. > 05 C-cMySQLUserId pic x(4). > 88 fMySQLUserId value 'arun'. > 05 C-cMySQLPassword pic x(4). > 88 fMySQLPassword value 'arun'. > 05 C-cMySQLDBName pic x(6). > 88 fMySQLDBName value 'MyDBMS'. > 05 C-cMySQLPort pic x(4). > 88 fMySQLPort value '3306'. > 05 C-cMySQLSocket pic x(8). > 88 fMySQLSocket value '0'. > 05 C-cMySQLFlag pic x(8). > 88 fMySQLFlag value '0'. > > > It's equivalent COBOL coding for the C coding syntax is; > > CALL "C_mysql_real_connect" > using by reference E-ptrSQLConnect > by reference C-cMySQLHostName > by reference C-cMySQLUserId > by reference C-cMySQLPassword > by reference C-cMySQLDBName > by content C-cMySQLPort > by reference C-cMySQLSocket > by content C-cMySQLFlag > giving E-ptrSQLEnv > > I have tested that before reaching this Calling portion all the variables hold the values what I > have set earlier. but after execution it stores the error as it's value (i.e., "Can't connect to > MySQL server on localhost (10061) ") and the pointer variable E_ptrSQLConnect hold value 0. > > Before invoking this Call I have invoked the "C_mysql_init" funtion and get the pointer value in > E_ptrSQLConnect. > > I could't get where is the possibility of error occurence exist... :( > > Arun. > > > --- Patrick Sherrill <[EMAIL PROTECTED]> wrote: > What is the syntax of your call to connect to > the MySQL server? > > It seems as though no server parameters are being passed, thereby defaulting > > to the local machine which apparently has no mysql server running. > > > > Pat... > > > > CocoNet Corporation > > SW Florida's First ISP > > > > > > > > ----- Original Message ----- > > From: "Arunachalam" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, December 30, 2003 6:18 AM > > Subject: reg MySQL connetion to COBOL > > > > > > > Hi, > > > > > > I am having responsibility to connect MySQL to COBOL. after such a long > > analysing I found there > > > are some C API function to connect to MySQL provided by itself. > > > > > > In COBOL I have the option to CALL external programs written in other > > languages. I follow this way > > > to made connection to MySQL from COBOL. > > > > > > Initially I struck up with Linker error while linking libmysql.lib > > provided by MySQL file into > > > COBOL, i.e, linking of this library file enable the calling of C API > > functions from COBOL and > > > invoke the appropriate function. > > > > > > I resolve this, by convert the libmysql.dll file into libmysql.def using > > pexports.exe (it is a > > > free downloadable utility) and then using LIB.exe in my COBOL compiler I > > convert the libmysql.def > > > file into libmysql.lib, which is understandable lib file format to my > > COBOL compiler. So my COBOL > > > compiler recognize those libmysql.lib file while linking but during > > runtime it shows error as; > > > > > > Can't Connect to MySQL server on localhost (10061) > > > > > > Actually I am trying to connect to the MySQL Server in Linux machine, I > > can able to connect to > > > server via, MySQLCC, MySQL Explorer (a free utility from Toolmagic > > Softwares) and more than that I > > > can connect via simple VC++ program using this C API functions too. > > > > > > I thought that I never missed any single step to be followed while MySQL > > server startup. > > > > > > I appreciate any valuable suggestions with thanks. > > > > > > Regards, > > > Arun. > > > > > > > > > ________________________________________________________________________ > > > Yahoo! India Mobile: Download the latest polyphonic ringtones. > > > Go to http://in.mobile.yahoo.com > > > > > > -- > > > MySQL General Mailing List > > > For list archives: http://lists.mysql.com/mysql > > > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > > > > > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > > > ________________________________________________________________________ > Yahoo! India Mobile: Download the latest polyphonic ringtones. > Go to http://in.mobile.yahoo.com > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]