PDA

View Full Version : ODBC broken in 1.9.16.17



ltheoret
09-11-2016, 00:33
Hi,

The ODBC include file in ODBC352.inc. says something about the month variable conflict. or already declared. in version 1.9.16.17.

Reloaded 1.9.15.0 works great.

yes some of us still use it.

Luc

ErosOlmi
09-11-2016, 08:03
Hi Luc,

thanks for reporting.
Yes I got it and I will fix for next version. At work I still use it in some script.

If in the meantime you want to fix it ... change \thinBasic\Inc\ODBC352.INC amending the first 75 line into:


' ########################################################################################
' ODBC352.INC - Constants, types and declares of the ODC API.
' ########################################################################################


'#IF NOT %DEF(%ODBC352_INC)
%ODBC352_INC = 1


'#IF NOT %DEF(%WINAPI)
' #INCLUDE "WIN32API.INC"
'#ENDIF


'//-----------------------------------------------------------------------------
'// File: sqltypes.h
'//
'// Copyright: Copyright (c) Microsoft Corporation
'//
'// Contents: This file defines the types used in ODBC
'//
'//-----------------------------------------------------------------------------


%ODBCVER = &H0352


TYPE DATE_STRUCT
_year AS INTEGER
_month AS WORD
_day AS WORD
END TYPE


TYPE TIME_STRUCT
_hour AS WORD
_minute AS WORD
_second AS WORD
END TYPE


Type TIMESTAMP_STRUCT
_year As Integer
_month As Word
_day As Word
_hour As Word
_minute As Word
_second As Word
_fraction As DWord
End Type


'/*
' * enumerations for DATETIME_INTERVAL_SUBCODE values for interval data types
' * these values are from SQL-92
' */


%SQL_IS_YEAR = 1
%SQL_IS_MONTH = 2
%SQL_IS_DAY = 3
%SQL_IS_HOUR = 4
%SQL_IS_MINUTE = 5
%SQL_IS_SECOND = 6
%SQL_IS_YEAR_TO_MONTH = 7
%SQL_IS_DAY_TO_HOUR = 8
%SQL_IS_DAY_TO_MINUTE = 9
%SQL_IS_DAY_TO_SECOND = 10
%SQL_IS_HOUR_TO_MINUTE = 11
%SQL_IS_HOUR_TO_SECOND = 12
%SQL_IS_MINUTE_TO_SECOND = 13


TYPE SQL_YEAR_MONTH
_year AS DWORD
_month AS DWORD
END TYPE


TYPE SQL_DAY_SECOND
_day AS DWORD
_hour AS DWORD
_minute AS DWORD
_second AS DWORD
_fraction AS DWORD
END TYPE





The change add an underscore char in front of "year", "month", "day", "hour", "minute", "second" inside few TYPEs otherwise they are recognized as reserved words.
I will fix in next version I'm working on allowing reserved words inside TYPEs to be used as TYPE element names.

Thanks
Eros