Re: dbdatecrack producing erroneous results

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Tue, 24 Apr 2012 14:04:58 -0400
Ken Collins <[email protected]> wrote:

> 
> https://github.com/rails-sqlserver/tiny_tds/blob/master/ext/tiny_tds/tiny_tds_ext.h#L4-5
> 
> From my README on the project.
> 
> I want to configure FreeTDS using --enable-msdblib and/or
> --enable-sybase-compat so it works for my database. ...
> you do not NEED
> to use any of these, nor will they hurt anything since we control
> what C structure names we use and this has no affect on what database
> you use!

How do you deal with the fact that Microsoft defines dbdatecrack() to
return months 1-12 and Sybase uses 0-11?  

--enable-msdblib emulates Microsoft's definition of DB-Library.  It
changes (from memory):

1.  names of members of the datetime structure
2.  range of months for dbdatecrack()
3.  timeout/exit behavior in the error handler

Use of --enable-msdblib is best determined by the programmer's
expectation of how db-lib works.  If there is existing code, the smart
programmer will adapt his expectation to that of the code.  ;-)

For those following along at home, please note that --enable-msdblib
affects the API *only*.  It doesn't change the protocol.  FreeTDS can
connect to any TDS server with or without that option configured.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.