DBLIB function

Brian Bruns camber at ais.org
Mon Jul 8 13:20:39 EDT 2002


Here is a quick implementation....i'll add it when i get a chance.

DBBOOL DBISAVAIL(DBPROCESS *dbproc)
{
TDSSOCKET *tds = dbproc->tds_socket;

   if (tds->state = COMPLETED && /* is there a query pending? */
       tds->s ) {   /* not sure if needed, but make sure socket is live */
      return TRUE;
   } else {
      return FALSE;
   }
}


The usual caveats about not compiling and such apply ;-)

Brian
> Hello Bill,
> 
> DBISAVAIL is a function defined in the dblibrary (SYBinclude) provided by
> Sybase.
> Since I am trying to use the same application to connect to MS  SQL Server
> (with minimal changes to the application),
> 
> How can I achieve this functionality using FREETDS, would I be able to use
> DBDEAD to find out the database server is alive or not?
> 
> Anagh
> 
> -----Original Message-----
> From: Bill Thompson [mailto:thompbil at exchange.uk.ml.com]
> Sent: Monday, July 08, 2002 9:23 PM
> To: TDS Development Group
> Subject: [freetds] Re: DBLIB function
> 
> 
> Anagh,
> 
> 
> > I am not able to find an equivalent to   DBISAVAIL(dbproc) in FreeTDS
> > DBlib
> > 
> 
> No, I can't find it either except defined in sybdb.h . From the manual,
> I'm not sure of its purpose, and I've not come across this function
> before. The manual says this about it...
> 
> "This routine indicates whether the specified DBPROCESS is available for
> general use. When a DBPROCESS is first opened, it is marked as being
> available, until some use is made of it. Many DB-Library routines will
> automatically set the DBPROCESS to "not available," but only dbsetavail
> will reset it to "available." This facility is useful when several parts
> of a program are attempting to share a single DBPROCESS."
> 
> Is your use of DBISAVAIL necessary for your program ?
> 
> > I have a program on a Solaris platform which connects to Sybase Database
> > using Sybase DB Library,
> > I am trying to convert that application to connect to my SQL Server using
> > FreeTDS Dblib,
> >
> 
> FYI, and if you need a short term solution to the DBISAVAIL issue, you can
> still use Sybase's dblib to talk to SQL server, provided you call
> dbsetversion(DBVERSION_46) at the appropriate point in your program...
> 
> Bill
> 
> ---
> You are currently subscribed to freetds as: [anaghnath_paul at satyam.com]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
> **************************************************************************
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
> distribution or forwarding of any or all of the contents in this message is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
> **************************************************************************



More information about the FreeTDS mailing list