bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Jun 03, 2020 6:04 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Apr 07, 2020 6:36 am 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
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.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 8:16 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4125
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 8:29 am 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
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?


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 8:56 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4125
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 11:01 am 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
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


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 11:36 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4125
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 1:36 pm 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
It was in the SqlQuery20 folder with exe but not in path.

Thanks


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 2:47 pm 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
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.


Top
 Profile  
 
PostPosted: Tue Apr 07, 2020 4:01 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4125
Location: Boise, Idaho USA
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.


Top
 Profile  
 
PostPosted: Wed Apr 08, 2020 7:40 am 
Offline

Joined: Fri Apr 17, 2015 11:09 am
Posts: 23
Yes it works with SqlQuery and pgadmin but that command I posted errors out.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group