[freetds] MS Sql 2005 and prepared queries

Royce Smallbone royce.smallbone at laneend.net
Thu Jul 17 11:55:33 EDT 2008


> >
> > I get am getting the following errors in my odbc log:
> >
> > [[FreeTDS][SQL Server]Invalid data type]
> >
> > Any guidance would be greatly appreciated.
> >
> > Royce
>
> You could enable ODBC trace and post last lines.
> Prepared query should work. Are you sure you are using proper protocol
> version??
>
> freddy77

I am using TDS version 8.0, I have tried 7.0 and 4.2.

Str In = 
[DRIVER=FreeTDS;SERVER=192.168.16.5;Port=1433;DATABASE=synergy_hwy_testing;TDS_Version=8.0;UID=synergy_hwy;PWD=*********]
[length = 119]  


I assume these are the log entries you are interested in, apologies if I have 
posted too much I started from the sql statement down:

[ODBC][16086][SQLPrepare.c][192]
		Entry:            
			Statement = 0x8213fe8            
			SQL = [SELECT access_view, access_print, access_change, access_create, 
access_delete FROM system.view_security_highlevel WHERE ( securi...][length = 
305]
[ODBC][16086][SQLPrepare.c][367]
		Exit:[SQL_SUCCESS]
[ODBC][16086][SQLBindParameter.c][210]
		Entry:            
			Statement = 0x8213fe8            
			Param Number = 1            
			Param Type = 1            
			C Type = -8 SQL_C_WCHAR            
			SQL Type = -9 SQL_WVARCHAR            
			Col Def = 22            
			Scale = 0            
			Rgb Value = 0x810152a            
			Value Max = 22            
			StrLen Or Ind = 0xbfe95df4
[ODBC][16086][SQLBindParameter.c][390]
		Exit:[SQL_ERROR]
		DIAG [S1004] [FreeTDS][SQL Server]Invalid data type

[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 1                
			SQLState = 0xbfe95c2a                
			Native = 0xbfe95c34                
			Message Text = 0xbfe95a29                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95c3a
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_SUCCESS]                    
			SQLState = S1004                    
			Native = 0xbfe95c34 -> 0                    
			Message Text = [[FreeTDS][SQL Server]Invalid data type]
[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 2                
			SQLState = 0xbfe95c2a                
			Native = 0xbfe95c34                
			Message Text = 0xbfe95a29                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95c3a
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_SUCCESS]                    
			SQLState = S1004                    
			Native = 0xbfe95c34 -> 0                    
			Message Text = [[FreeTDS][SQL Server]Invalid data type]
[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 3                
			SQLState = 0xbfe95c2a                
			Native = 0xbfe95c34                
			Message Text = 0xbfe95a29                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95c3a
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLGetDiagRec.c][657]
		Entry:                
			Connection = 0x81c9de8                
			Rec Number = 1                
			SQLState = 0xbfe95c2a                
			Native = 0xbfe95c34                
			Message Text = 0xbfe95a29                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95c3a
[ODBC][16086][SQLGetDiagRec.c][694]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLGetDiagRec.c][579]
		Entry:                
			Environment = 0x80c38b8                
			Rec Number = 1                
			SQLState = 0xbfe95c2a                
			Native = 0xbfe95c34                
			Message Text = 0xbfe95a29                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95c3a
[ODBC][16086][SQLGetDiagRec.c][616]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 1                
			SQLState = 0xbfe95bda                
			Native = 0xbfe95be4                
			Message Text = 0xbfe959d9                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95bea
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_SUCCESS]                    
			SQLState = S1004                    
			Native = 0xbfe95be4 -> 0                    
			Message Text = [[FreeTDS][SQL Server]Invalid data type]
[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 2                
			SQLState = 0xbfe95bda                
			Native = 0xbfe95be4                
			Message Text = 0xbfe959d9                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95bea
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_SUCCESS]                    
			SQLState = S1004                    
			Native = 0xbfe95be4 -> 0                    
			Message Text = [[FreeTDS][SQL Server]Invalid data type]
[ODBC][16086][SQLGetDiagRec.c][735]
		Entry:                
			Statement = 0x8213fe8                
			Rec Number = 3                
			SQLState = 0xbfe95bda                
			Native = 0xbfe95be4                
			Message Text = 0xbfe959d9                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95bea
[ODBC][16086][SQLGetDiagRec.c][772]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLGetDiagRec.c][657]
		Entry:                
			Connection = 0x81c9de8                
			Rec Number = 1                
			SQLState = 0xbfe95bda                
			Native = 0xbfe95be4                
			Message Text = 0xbfe959d9                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95bea
[ODBC][16086][SQLGetDiagRec.c][694]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLGetDiagRec.c][579]
		Entry:                
			Environment = 0x80c38b8                
			Rec Number = 1                
			SQLState = 0xbfe95bda                
			Native = 0xbfe95be4                
			Message Text = 0xbfe959d9                
			Buffer Length = 512                
			Text Len Ptr = 0xbfe95bea
[ODBC][16086][SQLGetDiagRec.c][616]
		Exit:[SQL_NO_DATA]
[ODBC][16086][SQLDisconnect.c][204]
		Entry:            
			Connection = 0x81c9de8
[ODBC][16086][SQLDisconnect.c][341]
		Exit:[SQL_SUCCESS]
[ODBC][16086][SQLFreeHandle.c][273]
		Entry:
			Handle Type = 2
			Input Handle = 0x81c9de8
[ODBC][16086][SQLFreeHandle.c][324]
		Exit:[SQL_SUCCESS]
[ODBC][16086][SQLFreeHandle.c][206]
		Entry:
			Handle Type = 1
			Input Handle = 0x80c38b8




More information about the FreeTDS mailing list