Jeremy Kister | 7 Sep 05:26

connecting to MSSQL 2005

I'm having a difficult time connecting to a mssql 2005 server.

solaris 10u5 sparc
freetds-0.82, hacked*
DBD::Sybase 1.09
perl 5.8.8
DBI 1.607
Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)
  Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

*hacked = I had to modify cspublic.h for DBD::Sybase to compile.  I'm only 
assuming it was the right thing to do:
--- freetds-0.82.orig/include/cspublic.h        2007-06-25 
05:48:20.000000000 -0400
+++ freetds-0.82/include/cspublic.h     2008-09-06 02:21:13.683192000 -0400
@@ -446,7 +446,10 @@
  #define CS_VERSION_150 15000

  #define BLK_VERSION_100 CS_VERSION_100
-#define BLK_VERSION_110 CS_VERSION_100
+#define BLK_VERSION_110 CS_VERSION_110
+#define BLK_VERSION_120 CS_VERSION_120
+#define BLK_VERSION_125 CS_VERSION_125
+#define BLK_VERSION_150 CS_VERSION_150

  #define CS_FORCE_EXIT  300
  #define CS_FORCE_CLOSE  301

---

(Continue reading)

Andrew Victor | 26 Aug 12:37

[PATCH] Invalid gmtime() call

hi,

There is an invalid / unnecessary call to gmtime() in cs_dt_crack().
The input parameter 'time_t tmp_secs_from_epoch' is never initialized,
and result 'struct tm* t' is never used.

So the gmtime() call and variables can just be removed.

Regards,
  Andrew Victor
diff -urN freetds-0.82/src/ctlib/cs.c freetds-0.82.new/src/ctlib/cs.c
--- freetds-0.82/src/ctlib/cs.c	2007-12-23 23:12:02.000000000 +0200
+++ freetds-0.82.new/src/ctlib/cs.c	2008-08-26 09:21:00.000000000 +0200
@@ -824,8 +824,6 @@
 {
 TDS_DATETIME *dt;
 TDS_DATETIME4 *dt4;
-time_t tmp_secs_from_epoch;
-struct tm *t;
 TDSDATEREC dr;

 	if (datetype == CS_DATETIME_TYPE) {
@@ -837,7 +835,6 @@
 	} else {
 		return CS_FAIL;
 	}
-	t = (struct tm *) gmtime(&tmp_secs_from_epoch);
 	daterec->dateyear = dr.year;
(Continue reading)

Igor Korot | 22 Aug 22:30

Is ConfigDSN implemented in FreeTDS ODBC layer

Hi, (Freddy),
Is ConfigDSN implemented in FreeTDS?

Thank you.
Igor Korot | 22 Aug 19:57

Fw: Re: [Iodbc-list] SQLWCHAR: what it resolves to?

Hi,
This is the reply from the iODBC maintainer.
Sebastien, James and Freddy - FYI.

It is an addition to the unixODBC E-mail I sent earlier.

-----Forwarded Message-----
>From: Patrick van Kleef <iodbc <at> openlinksw.com>
>Sent: Aug 21, 2008 6:33 PM
>To: Igor Korot <ikorot <at> earthlink.net>
>Subject: Re: [Iodbc-list] SQLWCHAR: what it resolves to?
>
>Hi Igor,
>
>
>> 1. Is there a macro which I can check on compile time that will  
>> indicate that iODBC
>> is installed? Does it include a version number?
>
>There are no special version settings at compile time in sql.h to  
>switch between driver managers. There is only the ODBCVER to denote  
>what version/level of ODBC is supported.
>
>However there are several methods you can use to determine at  
>configure or compile time what to use:
>
>1. In configure.in you can make a small check that calculates the  
>sizeof(SQLWCHAR)
>
>2. In configure.in you need to make checks anyway for which driver  
(Continue reading)

Hema Gonaboina | 22 Aug 09:47

I am Not getting connection.. to SQL SERVER

Hi Guys !
I installed the FreeTDS based the rules through the below link..
 http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServerFromRailsOnLinux

I installed the FreeTDS
 # tsql -S YOUR_DB_DEFINITION_NAME -U USERNAME -P PASSWORD The Command Worked fine 
> The Server located in remote system.. it's name is the rohitm(System Name) in which the sqlserver presented
> The database name which i have to connect is hsaedi_development
user name is "sa" 

 My /etc/odbc.ini File is as below
[SqlDB]
Driver	= FreeTDS
Description	= ODBC via FreeTDS
Server	= rohitm
Port	= 1433
Database	= hsaedi_development
User	= sa
Password	= password
Mars_Connection	= No
Logging	= 0
LogFile	= 

/etc/odbcinst.ini File is as below

[FreeTDS]
Description	= TDS driver (Sybase/MS SQL)
Driver	= /usr/local/lib/libtdsodbc.so
Setup	= /usr/lib/odbc/libtdsS.so
CPTimeout	= 
(Continue reading)

Chris Reeves | 21 Aug 19:16

Prepared statements with no parameters exhibit strange behaviour


I noticed some strange behaviour last week when using ODBC to prepare and
execute a statement with no parameters. This could be readily reproduced using
a call sequence along the lines of:
  SQLPrepare(handle, "select * from foo where bar = 1", SQL_NTS);
  while (1) {
    SQLExecute(handle)
    SQLNumResultCols(handle, &nCols)
    printf("Number of columns: %i", nCols);
    while (SQLFetch(handle) != SQL_NO_DATA) {
      // Some code (or no code)
    }
    SQLFreeStmt(handle, SQL_CLOSE)
  }

This call sequence would produce something like:
  Number of columns: 65
  Number of columns: 0 
  Number of columns: 65
  Number of columns: 0 
  Number of columns: 65
  Number of columns: 0 
  Number of columns: 65
  Number of columns: 0 
  ...
assuming it didn't just die with:
08S01 (20004): [unixODBC][FreeTDS][SQL Server]Read from the server failed
on the third call to SQLExecute.

Removing the calls to SQLFetch would eliminate the problem (number of columns
(Continue reading)

steve strychowski | 20 Aug 21:22

compiling freetds under 64b linux

what do i need to do to compile freetds under redhat linux 5.0 64b 

I have compiled freetds with the following per
http://www.freetds.org/userguide/config.htm

./configure --enable-msdblib
make
make install
make clean

i then used ODBCConfig to set the .ini files
then added my "servers" to the freetds.conf file

i can connect with isql and tsql and it seems to work fine.  However, i
don't know if i am using a 64bit version or 32bit version of the driver.
The problem is when i use oracle dg4odbc i get the following error.
ntered hgolofns at 2008/08/20-14:25:26
 libname=/usr/local/lib/libtdsodbc.so.0.0.0, funcname=SQLCancel
 symbol_peflctx=0xae5c65f0
 hoaerr:0
Exiting hgolofns at 2008/08/20-14:25:26
Entered hgolofns at 2008/08/20-14:25:26
 libname=/usr/local/lib/libtdsodbc.so.0.0.0, funcname=SQLDescribeParam
 hoaerr:28500
Exiting hgolofns at 2008/08/20-14:25:26
Failed to load ODBC library
symbol: /usr/local/lib/libtdsodbc.so.0.0.0(SQLDescribeParam)
Exiting hgolofn, rc=28500 at 2008/08/20-14:25:26
Exiting hgoinit, rc=28500 at 2008/08/20-14:25:26 with error ptr
FILE:hgoinit.c LINE:282 FUNCTION:hgoinit() ID:Loading ODBC aray of
(Continue reading)

Lagos, Ioannis | 20 Aug 11:25

SQLServer - No Connection

I have installed the unixODBC-2.2.12, freetds-0.82 on a RH 2.6.9-55.EL
x86_64, Apache/2.0.52 (Red Hat), PHP/4.3.9

I use odbc to connect to a SQL Server.

tsql  is connecting successfully.

isql -v myDSN is connecting successfully.

A php script executed from shell successfully and I get results.

But, if the same php script is executed from the Browser, I get an error
connection!

(Trying to connect from php with odbc_connect.)

Have any idea for this ?

My Environment is as:

Libraries located in /usr/local/lib

Env var          LD_LIBRARY_PATH = /usr/local/lib

      FREETDS=/usr/local/etc

>From phpinfo I get the following info:

--with-unixODBC=shared,/usr'

(Continue reading)

James K. Lowden | 19 Aug 16:13

sgml encoding

Hi Freddy, 

> 	* doc/userguide.sgml: remove strange characters

What is the encoding of doc/userguide.sgml?  I assume ISO 8859-1, but you
replaced >0x7F characters with SGML character entities.  Jade converts the
ISO 8859-1 to UTF-9 HTML output just fine.  

I prefer to be able to use umlauts and such, and X supports ISO 8859-1
with no problem.  Is it an issue on your UTF-8 system?  

--jkl
Venkatanaga Chitta | 18 Aug 17:15

while executing 'make' of freetds in AIX

Hi

I am running the make of freetds-0.82 in AIX 5. I get the below error ,
could you please help?

ld: 0711-317 ERROR: Undefined symbol: .tdsdump_open

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.

collect2: ld returned 8 exit status

make: The error code from the last command is 1.

Stop.

make: The error code from the last command is 1.

Stop.

make: The error code from the last command is 1.

Stop.

make: The error code from the last command is 1.

Stop.

Regards,

(Continue reading)

Chris Reeves | 15 Aug 18:25

Setting ODBC timeouts

Hi all,

I have been trying to set login and connection timeouts using the tdsodbc
driver, without too much success. After reading many of the threads regarding
timeouts (particularly the one around January 2007) I upgraded from 0.63-3.2
(Debian etch package) to 0.82-4 (Debian lenny package). The code in question
works correctly when there is no interruption in the connection, but I am
currently testing cases where there is an interruption.

I set the SQL_ATTR_LOGIN_TIMEOUT and SQL_ATTR_CONNECTION_TIMEOUT attributes
using SQLSetConnectAttr and later calls to SQLGetConnectAttr suggest that
these attributes have indeed been changed. Despite this, no matter what I set
these two attributes to, the login always takes 40 seconds to time out and the
connection timeout appears to be 'infinite'. The timeouts in
/etc/freetds/freetds.conf are both set to 1. The code I'm using runs along the
following lines (but with additional error checking included - all calls
return SQL_SUCCESS).

/// Begin code excerpt

SQLUINTEGER currTimeout = 0;
SQLGetConnectAttr(connHandle, SQL_ATTR_LOGIN_TIMEOUT, &currTimeout, 0, NULL);
std::cout << "Current login timeout is: " << currTimeout << std::endl;
SQLGetConnectAttr(connHandle, SQL_ATTR_CONNECTION_TIMEOUT, &currTimeout, 0,
NULL);
std::cout << "Current connect timeout is: " << currTimeout << std::endl;

SQLUINTEGER timeout = 30;
SQLSetConnectAttr(connHandle, SQL_ATTR_LOGIN_TIMEOUT, (void*)timeout, 0);
SQLGetConnectAttr(connHandle, SQL_ATTR_LOGIN_TIMEOUT, &currTimeout, 0, NULL);
(Continue reading)


Gmane