#1 2017-06-02 13:57:17

NoSaint50
Member
Registered: 2017-05-26
Posts: 4

SQL Server 2012 and SynOLEDB in 64 bit app

Hi,

I've been working on another "educational" bit of code to try out SQL and TSQLHttpServer. The sample is below and it works perfectly in 32 bit mode, but I get an access violation in line 1982 of SynOLEDB.pas (First chance exception at $000000000090A716. Exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION') when I recompile and run in 64 bit. I'm guessing this might be the SQL Client Driver is selecting the 32 bit one, so is there a property needed to flip it to 64 bit?

  Props := TOleDBMSSQL2012ConnectionProperties.Create('SQLExpress', 'AdventureWorks', '', '');
  try
    Conn := Props.NewConnection;
    try
      Conn.Connect;
      Query := Conn.NewStatement;
      try
        Query.Execute('select * from Sales.Customer where AccountNumber like ?', true, ['AW000001%']);
        Result := Query.FetchAllAsJSON(true, nil, false);
        Query.Free;
      finally
      end;
    finally
      Conn.Free;
    end;
  finally
      Props.Free;
  end;

Offline

#2 2017-06-02 14:04:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: SQL Server 2012 and SynOLEDB in 64 bit app

I guess a 64-bit app won't be able to load a 32-bit driver, by design.

Problem may be somewhere else.
Are you using the latest revision of the framework?
(current is 1.18.3680)

Offline

#3 2017-06-02 14:20:40

NoSaint50
Member
Registered: 2017-05-26
Posts: 4

Re: SQL Server 2012 and SynOLEDB in 64 bit app

Ah, good point ...

I have Delphinus installed and it's not showing any update .. version is 1.18.2975. Maybe I need to do a little manual upgrading?

Offline

#4 2017-06-02 15:56:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: SQL Server 2012 and SynOLEDB in 64 bit app

You may try it...

Offline

Board footer

Powered by FluxBB