#1 2014-11-03 13:09:32

aruncs08
Member
Registered: 2014-10-13
Posts: 27

mORMot with Postgre 'Connection Error' in Sample 28 program (!Newbie!)

Hi!

I am just trying to run the mORMot Sample 28. I have installed Postgre 9.3 and created DataSourceName for PostgreSQL Unicode(x64) driver in ODBC Data Source Administrator.

My Postgre Data source name is 'PostgreSQL35W' and I don't know where to mention this Data source name in this below sample code?

My Source Code:

aProps := TODBCConnectionProperties.Create('','Driver=PostgreSQL Unicode'+
      {$ifdef CPU64}'(x64)'+{$endif}';Database=postgres;'+
      'Server=localhost;Port=5433;UID=postgres;Pwd=password','','');

Error:
First chance exception at $763DC42D. Exception class EODBCException with message
'TODBCLib error: [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
'.
Process RESTserver.exe (2300)

My Question:
In the above Source Code, I gave all my Postgre credentials as it is. But where do I give Data source name which I have created in ODBC Data Source Administrator?
And my doubt was, without mentioning this DSN name how could the program knows which driver or database does we have?

Thanks in advance.

Offline

#2 2014-11-03 13:22:32

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: mORMot with Postgre 'Connection Error' in Sample 28 program (!Newbie!)

You should install 32bit ODBC driver for PostgreSQL.

Offline

#3 2014-11-03 15:16:49

aruncs08
Member
Registered: 2014-10-13
Posts: 27

Re: mORMot with Postgre 'Connection Error' in Sample 28 program (!Newbie!)

Thanks @DigDriver, it works now smile

Offline

#4 2014-11-03 20:12:27

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

Re: mORMot with Postgre 'Connection Error' in Sample 28 program (!Newbie!)

For PostgreSQL, Zeos 7.2 is preferred.
It is much lighter (just 2 dll to copy with your exe), and much faster.

Offline

Board footer

Powered by FluxBB