Error connecting with PGDBE

SqlQuery is a library and utility program that utilizes the best features of Xbase++ and eXpress++ for SQL browsing of data via ADSDBE, PGDBE and ODBCDBE.
Message
Author
bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Error connecting with PGDBE

#1 Post by bamunz@earthlink.net »

I am getting an error on SqlQuery trying to connect with PGDBE. I am connecting fine with my program using:
cConnStr := "DBE=pgdbe;server=MAIN;db=MUNZ;uid=postgres;pwd=..."
DbeLoad("pgdbe")
dbeSetDefault("pgdbe")
oSession := DacSession():New(cConnStr)

but have tried both the following ini entries:

[PG_1]
Name=MUNZ (PostGreSql)
ConnectString=
ServerDict=Main
Database=MUNZ
UID=postgres
PWD=...

[PG_2]
Type=PG
Name=Munz2
Driver=
Server=localhost
Database=MUNZ
UID=postgres
PWD=...
ConnectTimeOut=0

For some reason it won't let me attach error log

FATAL ERROR LOG
No continue after this Error!
SYS Thread-ID: 2700
Module: EXE
Error Codes: EH: 10 Sub: 0(0) OS: 0 XPP: 0
Call Stack of Thread 1 (1208):
@DC_GETLIST@I@EVENTLOOP(4265)
@DC_GETLIST@I@READGUI(3970)
DC_READGUI(113)
@SQLQUERY@I@SHOWDIALOG(1361)
MAIN(190)
Call Stack of GUI Thread (1380):
Call Stack of Thread 4 (2700):
@SQLQUERYCONNECTION@I@CONNECTPG(13347)
@SQLQUERYCONNECTION@I@CONNECT(13085)
@SQLQUERY@I@BUILDTREEBRANCH(3200)
(B)@SQLQUERY@I@TREEWINDOW(1417)
(B)_TreeItemBlock(6250)
@DC_GETLIST@I@EVENTLOOP(4798)
@DC_GETLIST@I@READGUI(3970)
DC_READGUI(113)
@SQLQUERY@I@TREEWINDOW(1453)
(B)_ResizeTree(1388)
_GUIRUN(6925)
(B)GuiRun(6912)
File: C:\SqlQuery20\SQLQUERY.EXE
TimeStamp: 20200406 16:22
End of FATAL ERROR LOG.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error connecting with PGDBE

#2 Post by rdonnay »

What version of SqlQuery are you using? Most current version is 2.0.159. Click on Help - About Sqlquery

I need to see if SqlQuery is building the connect string correctly.

If you are using SqlQuery then you should have the source: SQLQUERY.PRG.

Look at the method named METHOD SqlQueryConnection:ConnectPg(oSqlQuery)

This should start at about line 13529 (build 2.0.159)

Add a debug statement at line 13555 to view the value of cSqlConnect before it is passed to DC_DacSession().

WTF cSqlConnect

Run PBUILD SQLQUERY to rebuild SQLQUERY.DLL

Run the program and try to connect again.

The connect string in the debug window should look the same as that used in your application.
The eXpress train is coming - and it has more cars.

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: Error connecting with PGDBE

#3 Post by bamunz@earthlink.net »

I am on 2.0.158 and when I go to help and Download Latest Version it says it is latest version.
Where do I get 2.0.159?

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error connecting with PGDBE

#4 Post by rdonnay »

You can also do this with 258. 259 was the lastest build added to eXpress++.

Look for the method I referenced and add the debugging.
The eXpress train is coming - and it has more cars.

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: Error connecting with PGDBE

#5 Post by bamunz@earthlink.net »

The error is in loading the DBE in SqlQueryConnection:ConnectPg

IF !('PGDBE'$aDbeList) .AND. !DbeLoad( "PGDBE",.f.)
DC_WinAlert('Database-Engine PGDBE not loaded')
RETURN .f.
ENDIF

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error connecting with PGDBE

#6 Post by rdonnay »

I am guessing that you don't have PGDBE.DLL in the path where you are running SqlQuery.exe
The eXpress train is coming - and it has more cars.

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: Error connecting with PGDBE

#7 Post by bamunz@earthlink.net »

It was in the SqlQuery20 folder with exe but not in path.

Thanks

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Error on Multi-table Select

#8 Post by bamunz@earthlink.net »

I posted following message on The Alaska Forum last week and have also run the SQL with SqlQuery successfully.


I have been testing with Postgres with the PGDBE and this is first
multi-table select I have tried.

cSQL = "SELECT loan.*, customer.l_name, customer.f_name, customer.mi,
customer.generation, customer.paddress, customer.city, customer.state,
customer.zip, customer.hm_phone, customer.wk_phone, customer.cell FROM loan,
customer WHERE customer.contr_no > 0 AND customer.contr_no = loan.contr_no"
oStmt := DacSqlStatement():fromChar(cSQL)
oStmt:build():execute()

I get the following error:

oError:args : -> VALTYPE: U VALUE: NIL
oError:canDefault : Y
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : {NIL, -1, D}
oError:description : D
oError:filename :
oError:genCode : 9001
oError:operation : ABSTRACTSQLSTATEMENTBUILDER:EXECUTESTATEMENT
oError:osCode : 0
oError:severity : 2
oError:subCode : -1
oError:subSystem : Remote SQL dacSession


I can copy and paste that select string in PGAdmin and it returns results
without a problem.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error connecting with PGDBE

#9 Post by rdonnay »

Are you saying that this statement runs ok under SqlQuery but not in your application?
The eXpress train is coming - and it has more cars.

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: Error connecting with PGDBE

#10 Post by bamunz@earthlink.net »

Yes it works with SqlQuery and pgadmin but that command I posted errors out.

Post Reply