#1 2013-04-09 06:27:55

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

ODBC vs OLEDB

Hi Arnaud

In http://synopse.info/fossil/info/5ca10494e0 you state that OleDB is deprecated, and that ODBC is currently the M$ recommended way. I wasn't aware of that, so in that case the news gets worse sad

I get even more errors when using ODBC in combination with MSSQL. I'll see if I can come up wit a failure list that ,may shed some light on it. The MSSQL/ODBC drivers have been installed for both 64bit and 32bit. (Running win7x64)

Offline

#2 2013-04-09 08:03:19

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: ODBC vs OLEDB

* UPDATE: I've created a tickt for this one: http://synopse.info/fossil/tktview/d482 … d1b209bae0

Here's an error I get for ODBC (32Bit) when adding a record:

msg '[HY090] [Microsoft][SQL Server Native Client 10.0]Invalid string or buffer length (0)'

The TSQLrecord that I'm trying to add is the following:

  TSQLUnitTestSampleRecord = class(TSQLRecord)
  private
    fQuestion: RawUTF8;
    fName: RawUTF8;
    fTime: TModTime;
    FAddress: RawUTF8;
    fPostal: RawUTF8;
    FCity: RawUTF8;
    FDatum: TDatetime;
    FFloatNumber: double;
    FIntNumber: Int64;
    FCurNumber: Currency;
    FBlobData: TSQLRawBlob;
    FRaw: RawUTF8;
  published
    property ModTime: TModTime read fTime write fTime;
    property Name: RawUTF8 index 50 read fName write fName;
    property Question: RawUTF8 index 50 read fQuestion write fQuestion;
    property Address_: RawUTF8 index 50 read FAddress write fAddress;
    property PostalCode: RawUTF8 index 12 read fPostal write fPostal;
    property City: RawUTF8 index 50 read FCity write FCity;
    property Datum: TDatetime read FDatum write FDatum;
    property FloatNumber: double read FFloatNumber write FFloatNumber;
    property IntNumber: Int64 read FIntNumber write FIntNumber;
    property CurrencyNumber: Currency read FCurNumber write FCurNumber;
    property BlobData:TSQLRawBlob read FBlobData write FBlobData;
    property BigRawUtf8: RawUTF8 read FRaw write FRaw;
  end;

The call stack when the error occurs is this:

Mormot_ODBCD17.SynDBODBC.TODBCLib.HandleError(-1,3,$CF6820,False,sllNone)
Mormot_ODBCD17.SynDBODBC.TODBCStatement.ExecutePrepared
mORMot_D17.mORMotDB.TSQLRestServerStaticExternal.ExecuteFromJSON('{"ModTime":135103816522,"Name":"Hans Hasenack 0","Question":"{CCB2E30E-9A85-4907-A2EF-E3D50DE0D908}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T09:59:24","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}',soInsert,0)
mORMot_D17.mORMotDB.TSQLRestServerStaticExternal.EngineAdd(TSQLUnitTestSampleRecord,'{"ModTime":135103816522,"Name":"Hans Hasenack 0","Question":"{CCB2E30E-9A85-4907-A2EF-E3D50DE0D908}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T09:59:24","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}')
mORMot_D17.mORMot.TSQLRestServer.URI($18F3A4)
mORMot_D17.mORMotSQLite3.TSQLRestClientDB.InternalURI('root/UnitTestSampleRecord?session_signature=0000004C001F348D57FB5B73','POST',$18F42C {''},$18F480 {''},$18F48C {'{"ModTime":135103816522,"Name":"Hans Hasenack 0","Question":"{CCB2E30E-9A85-4907-A2EF-E3D50DE0D908}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T09:59:24","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}'})
mORMot_D17.mORMot.TSQLRestClientURI.URI('root/UnitTestSampleRecord','POST',nil {''},$18F480 {''},$18F48C {'{"ModTime":135103816522,"Name":"Hans Hasenack 0","Question":"{CCB2E30E-9A85-4907-A2EF-E3D50DE0D908}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T09:59:24","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}'})
mORMot_D17.mORMot.TSQLRestClientURI.EngineAdd(TSQLUnitTestSampleRecord,'{"ModTime":135103816522,"Name":"Hans Hasenack 0","Question":"{CCB2E30E-9A85-4907-A2EF-E3D50DE0D908}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T09:59:24","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}')
mORMot_D17.mORMot.TSQLRestClient.Add($FE7BD8E0,True,False)
SGMormotTestSuitePkg_D17.uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.CreateModelData(False,False)
SGMormotTestSuitePkg_D17.uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.TestTimedCRUD
DUnitTestInspectorD17.TestFramework.TTestCase.Invoke((uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.TestTimedCRUD,$FE7F0380))

In 64Bit mode I get quite a different error message:

msg '[22008] [Microsoft][ODBC SQL Server Driver]Datetime field overflow (0)'

But the call stack is about the same:

Mormot_ODBCD17.SynDBODBC.TODBCLib.HandleError(-1,3,$74F2D00,False,sllNone)
Mormot_ODBCD17.SynDBODBC.TODBCStatement.ExecutePrepared
mORMot_D17.mORMotDB.TSQLRestServerStaticExternal.ExecuteFromJSON('{"ModTime":135103816613,"Name":"Hans Hasenack 0","Question":"{D3370E96-DB9F-4A82-99FF-7F3B1150C33A}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T10:00:51","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}',soInsert,0)
mORMot_D17.mORMotDB.TSQLRestServerStaticExternal.EngineAdd(TSQLRecordClass($3B83470),'{"ModTime":135103816613,"Name":"Hans Hasenack 0","Question":"{D3370E96-DB9F-4A82-99FF-7F3B1150C33A}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T10:00:51","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}')
mORMot_D17.mORMot.TSQLRestServer.URI($12E5B8)
mORMot_D17.mORMotSQLite3.TSQLRestClientDB.InternalURI('root/UnitTestSampleRecord?session_signature=0000004C001F35E1CB970542','POST',$12E698 {''},$12E738 {''},$12E770 {'{"ModTime":135103816613,"Name":"Hans Hasenack 0","Question":"{D3370E96-DB9F-4A82-99FF-7F3B1150C33A}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T10:00:51","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}'})
mORMot_D17.mORMot.TSQLRestClientURI.URI('root/UnitTestSampleRecord','POST',nil {''},$12E738 {''},$12E770 {'{"ModTime":135103816613,"Name":"Hans Hasenack 0","Question":"{D3370E96-DB9F-4A82-99FF-7F3B1150C33A}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T10:00:51","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}'})
mORMot_D17.mORMot.TSQLRestClientURI.EngineAdd(TSQLRecordClass($3B83470),'{"ModTime":135103816613,"Name":"Hans Hasenack 0","Question":"{D3370E96-DB9F-4A82-99FF-7F3B1150C33A}","Address_":"Dit is het adres laan, 23","PostalCode":"1234AA","City":"Nijmegen","Datum":"2013-04-09T10:00:51","FloatNumber":0,"IntNumber":0,"CurrencyNumber":0,"BigRawUtf8":""}')
mORMot_D17.mORMot.TSQLRestClient.Add($2FF44D0,True,False)
SGMormotTestSuitePkg_D17.uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.CreateModelData(False,False)
SGMormotTestSuitePkg_D17.uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.TestTimedCRUD
DUnitTestInspectorD17.TestFramework.TTestCase.Invoke((uTestMormotDBBaseCommon.TMormotDBBaseCommonCRUDTest.TestTimedCRUD,$306CA60))

Last edited by h.hasenack (2013-04-09 08:05:51)

Offline

#3 2013-04-09 10:09:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,183
Website

Re: ODBC vs OLEDB

Yes, OleDB is officially deprecated.
See our blog article: http://blog.synopse.info/post/2012/02/2 … enjoy-ODBC!

Could you try with http://synopse.info/fossil/info/85d7a6bf92 modification?

If it does not work, could you switchs logs on, or step in the debugger and find out what is the generated SQL statement?

Offline

Board footer

Powered by FluxBB