postgres

postgres

Postby kajot » Sun Mar 17, 2019 9:07 pm

if FW_OpenAdoConnection open postgres ?

best regards
KAJOT
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Mon Mar 18, 2019 2:15 am

Yes.
First, you need to install either ODBC connector or preferably OLEDB provider for PostgreSQL.

Then
oCn := FW_OpenAdoConnection( cConnectionString, .t. )

Please refer to the documentation of www.connectionstrings.com to determine the correct connection string to be used.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby kajot » Tue Mar 19, 2019 11:23 am

ask for an example , because none work
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby kajot » Tue Mar 19, 2019 11:35 am

with MSSQL works well
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby kajot » Wed Apr 03, 2019 7:44 pm

Does anyone use Postgres ?
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Wed Apr 03, 2019 8:17 pm

If you have installed Postgre server on your computer, build the samples pgre01.prg and testpgre.prg in the fwh\samples folder. Go to the folder \fwh\samples and build with either buildh.bat or buildx.bat
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby nageswaragunupudi » Wed Apr 03, 2019 10:44 pm

I have just installed Postgre server on my PC.
Both the samples pgre01.prg and testpgre.prg worked for me.

I have also installed Postgre Oledb provider and I am able to connect to the server using ADO, with this connection string.

Code: Select all  Expand view  RUN

Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;
location=myDataBase;User ID=myUsername;password=myPassword;
 


Still testing with ADO. We propose to make improvements, where necessary, to the ado functions in the FWH version under release now.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby kajot » Thu Apr 04, 2019 5:24 pm

in pgre01.prg and testpgre.prg occurs

TPQServer():New( cHost, cDataBase, cUser, cPassword, , cSchema )

when I compliling , I got error
xLINK: error: Unresolved external symbol '_HB_FUN_TPQSERVER referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_PQEXEC referenced from (t.obj)'.
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Fri Apr 05, 2019 2:36 am

please go to \fwh\samples folder.

If you are using xharbour, then buildx pgre01
If you are using harbour, then buildh pgre01.

You will not get any unresolved externals.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby kajot » Fri Apr 05, 2019 5:08 pm

I am using xHarbour.com (simplex ) with Pelles ISO C compiler 3.0

and get error
xLINK: error: Unresolved external symbol '_HB_FUN_TPQSERVER referenced from (t.obj)'.

xLINK: error: Unresolved external symbol '_HB_FUN_PQEXEC referenced from (t.obj)'.

x
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Fri Apr 05, 2019 6:05 pm

Both Harbour and xHarbour provide a library "pgsql.lib" for connecting to PostGre server.
So users of both free xHarbour and Harbour with bcc can straight away connect to PostGre server and start working with.

You need to link the pgsql.lib provided with your commerical xharbour.com
In addition, you need to create an implib for libpq.dll ( available in fwh\samples ) folder and link that too.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby kajot » Fri Apr 05, 2019 9:34 pm

when I add pgsql from FWH s:\lib ( FWH there is in S:)

I get error
Type: C >>>xlink.exe -NOEXPOBJ -MAP -FORCE:MULTIPLE -NOIMPLIB -subsystem:windows -UNMANGLE -LIBPATH:"S:\lib" -LIBPATH:"R:\lib" -LIBPATH:"R:\c_lib" -LIBPATH:"R:\c_lib\win" "t.obj" "errorsys.obj" "mem32.lib" "send32.lib" "png.lib" "r:\c_lib\win\gdi32.lib" "r:\c_lib\win\gdiplus.lib" "xhbzip.lib" "xhbzipdll.lib" "xfw.lib" "s:\lib\pgsql.lib" "libpq.lib" "FiveHCM.lib" "FiveHMX.lib" "OptG.lib" "xhb.lib" "dbf.lib" "nsx.lib" "ntx.lib" "cdx.lib" "rmdbfcdx.lib" "ct3comm.lib" crt.lib kernel32.lib user32.lib winspool.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib uuid.lib wsock32.lib ws2_32.lib wininet.lib advapi32.lib shlwapi.lib msimg32.lib mpr.lib OleDlg.lib version.lib comctl32.lib comdlg32.lib gdi32.lib shell32.lib winmm.lib lz32.lib Netapi32.lib -out:"t.EXE"<<<

xLINK: fatal error: Corrupt library: 's:\lib\pgsql.lib'.
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Fri Apr 05, 2019 9:54 pm

The lib provided by FWH is for Harbour and xHarbour with bcc only. It is not compatible with your xhabour.com
As I said before you need to get it from xhabour.com's libs or build it yourself with xharbour.com's compiler from the contrib sources.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: postgres

Postby kajot » Fri Apr 05, 2019 10:26 pm

when I am using lib from xHarbour.com (R: there is path to xHARBOUR.COM)

[R:\lib\sql.lib]
[R:\lib\libpq.lib]

I get error

xLINK: error: Unresolved external symbol '_HB_FUN_TPQSERVER referenced from (t.obj)'.

xLINK: error: Unresolved external symbol '_HB_FUN_PQEXEC referenced from (t.obj)'.
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Postby nageswaragunupudi » Fri Apr 05, 2019 10:35 pm

Please see my posts above.

You need to link "pgsql.lib".
If this is not available, you need to build it using xhabour.com's compiler from the contrib sources.
I hope the paid xharbour.com provides the sources.
If not, download the sources from free xharbour and build the library.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests