Recent

Author Topic: Postgres and lazarus - Why doesn't work  (Read 6206 times)

kassai

  • Newbie
  • Posts: 4
Postgres and lazarus - Why doesn't work
« on: April 17, 2006, 06:50:40 pm »
Hi,

I was just started with Lazarus. Wanted to create a database (postgres backend) application. It didn't succeded:-) It was no fault, but didn't anything displayed (so the dbgrid didn't fill up) in the grid. It seems to connected well, because the columns' names (of the table I made a "select * from ") are displayed, but the data space is empty. (the database objects are the built in ones).
(It was worked with the Zeos components (the grid filled up) until I was clicked in the grid, when application was crashed.)

kassai

  • Newbie
  • Posts: 4
RE: Postgres and lazarus - Why doesn
« Reply #1 on: April 17, 2006, 06:52:29 pm »
If anybody cares, please send an email, and I send attached a sample application via email.

Anonymous

  • Guest
RE: Postgres and lazarus - Why doesn
« Reply #2 on: April 18, 2006, 09:01:05 pm »
Additional info:
I was printed out the count of the result set, but it was 0. After it I set up the postgres to log the statements, and as I could see the client can connect, starts a transaction block, performs a query, and then nothing. How can I disable the transaction (or how can I use sqldb without transaction object?) at least when I want to execute queries, because myself this is the root of the problem.


Or, is there a kind person to send me a minimal application through I could learn about this.
My email is kako(AT)zhnet(DOT)hu

thanks

johnf

  • New Member
  • *
  • Posts: 18
RE: Postgres and lazarus - Why doesn
« Reply #3 on: April 19, 2006, 12:07:31 am »
You should really review the information available on the wiki documenation.  
A simple test of the components can be made a design time:
Create a simple app with Lazarus.
Place a pqconnection, a tsqltransaction, a tsqlquery, and a datasource on the form.
Open the pqconnection in the object inspector and set all the properties.  Then set the 'connected' to true.  If it works then all is well with the connection.  If it does not work then you have either a problem with permissions on the database or some other issue.  Make sure the connection works because nothing else will work if the connection is not right.  Then continue setting the required properties of the other controls.  If they work then can then see data.  

But read the wiki it will help you.  My entry is "Adventure of a newbie".
John

kassai

  • Newbie
  • Posts: 4
RE: Postgres and lazarus - Why doesn
« Reply #4 on: April 19, 2006, 07:23:23 pm »
Thanks johnf for answering, but I'm not happy. I red your post in the wiki mentioned above. That only says (maybe only to me) what I already know: something sh..t around the transaction handling, but don't know what.
when I open a transation, and run a query, in the dbgrid appears the columnnames at the label row, and an empty record (but there aren't the data rows the table contents). When "transaction.active:=false;" the label row, and the empty record disappers.
If this database connection is working for anybody, the only conclusion is: "I made something wrong". It isn't amazing 'cause this fourty try are my first with the lazarus. The freepascal examples of postgres -e.g. testpg1.pp- are working normally, so the connection is OK. I am the admin of the postgres server, and every try was performed as "postgres" database superuser.
If you would be so kind to analyze my app(????) I could send you a complete postgres config, dbdump, and the application, what could be the problem?

johnf

  • New Member
  • *
  • Posts: 18
RE: Postgres and lazarus - Why doesn
« Reply #5 on: April 20, 2006, 08:13:38 am »
Sure post it and I'll take a look.  
Send it to jfabiani@yolo.com

 

TinyPortal © 2005-2018