When I change the value of fMySQLSocket to NULL
i.e.,  05 C-cMySQLSocket        pic  x(8).
               88 fMySQLSocket           value NULL.

The compiler shows the following error;
       219 E NULL initial value invalid for 'NULL'

So how can I assign NULL to this condition name variable?

suggest me pls...

ragards
Arun.



 --- Patrick Sherrill <[EMAIL PROTECTED]> wrote: > BTW the error also indicates your 
client is
trying to connect to the
> localhost i.e. the same machine you are connecting from. Try using the IP
> address of the server instead of the servername.  This should also be a
> string (eg. "123.123.123.123").
> 
> You most likely have a parameter/data type problem.  The parameters being
> passed from your COBOL program, are not getting to the 'C' routine as the
> correct data types or parameters (remember NULL is not zero).
> 
> Pat...
> 
> 
> ----- Original Message ----- 
> From: "Arunachalam" <[EMAIL PROTECTED]>
> To: "Patrick Sherrill" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 31, 2003 4:22 AM
> Subject: Re: COBOL Syntax of calling MySQL's C API
> 
> 
> > hi,
> >
> > >From COBOL I have tried to Connect to MySQL using the C API functions
> given by MySQL. Finally I
> > struck up with the error during runtime as "Can't connect to MySQL server
> on localhost (10061)"
> >
> > I have a doubt Is, we have to start explicitly MySQL in the server
> machine?  i.e., mysqld.
> >
> > If so with out start the mysqld in the server I can able to connect to the
> server using MySQLCC,
> > is an utility tool provided by MySQL and MySQLExplorer is a free utility
> tool provided by
> > ToolMagic softwares. More than this I can able to connect to MySQL server
> and fetch the data using
> > simple C++ program using C API of MySQL. I believe, no one do start the
> MySQL in my server.
> >
> > I am running my application in Windows2000 machine (client), myserver is
> at Linux machine
> > (server).
> >
> > So what I can to do?.
> >
> > Arun.
> >
> >  --- Patrick Sherrill <[EMAIL PROTECTED]> wrote: > 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
> 
=== message truncated === 

________________________________________________________________________
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]

Reply via email to