postgres

User avatar
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

postgres

Post by kajot »

if FW_OpenAdoConnection open postgres ?

best regards
KAJOT
best regards
kajot
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Post by kajot »

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

Re: postgres

Post by kajot »

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

Re: postgres

Post by kajot »

Does anyone use Postgres ?
best regards
kajot
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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

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
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Post by kajot »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Post by kajot »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Post by kajot »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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
kajot
Posts: 309
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: postgres

Post by kajot »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: postgres

Post by nageswaragunupudi »

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
Post Reply