Devart Forum Index

The time now is Thu 09 Sep 2010 12:24

Example in builder C++ 2010

 
Post new topic   Reply to topic    Devart Forum Index -> Universal Data Access Components
View previous topic :: View next topic  
Author Message
cosimelli@criap.it



Joined: 21 Jun 2010
Posts: 12

PostPosted: Tue 22 Jun 2010 08:45    Post subject: Example in builder C++ 2010 Reply with quote

Can we have same simple example in C++ of a connection with a table and the upgrate of it through append/post operation with PgDAC?
Back to top
View user's profile Send private message
bork
Devart Team


Joined: 12 Mar 2010
Posts: 467

PostPosted: Thu 24 Jun 2010 14:49    Post subject: Reply with quote

Hello

Please provide us your E-mail to send the sample application.
Back to top
View user's profile Send private message
cosimelli@criap.it



Joined: 21 Jun 2010
Posts: 12

PostPosted: Thu 24 Jun 2010 15:11    Post subject: Reply with quote

My E-Mail is cosimelli@criap.it
Back to top
View user's profile Send private message
cosimelli@criap.it



Joined: 21 Jun 2010
Posts: 12

PostPosted: Tue 29 Jun 2010 11:43    Post subject: Reply with quote

Hello Boris,
I've opened your example and I've done this :
1. I've set a valid connection throw Username,pw, database, server, port of my system. And works.
2. I've run your application
3. I've press the button to Create the table. And works
4. I've Opened the table with your button. And Works
5. I've added 3 record pressing tree times your button 'Append data'. And OK
6. I've pressed the button 'Update data' and rise an Exception ' Update failed. Found 3 records'.
7. Closing the message the table seems good. But If I see the table with PgAdmin all the tree records are updated. Why? The same things is If I modify a record in the DBGrid and I press the 'post' button of the DB Navigator.

Thank you.
Fabio
Back to top
View user's profile Send private message
bork
Devart Team


Joined: 12 Mar 2010
Posts: 467

PostPosted: Wed 30 Jun 2010 14:00    Post subject: Reply with quote

Hello

If you press the 'Append data' button 3 times then 3 equal records will be added to database. When you try to update record then the following SQL query will be generated:
Code:
update test_table set ID=..., Name='...' where ID=... and Name='...'

If several records have the same value in all fields then all these records will be updated. There is no other way to update a record. To update your table correctly you should create primary or unique key in your table and specify this key in the KeyFields property of TPgQuery or TPgTable.

You can learn how to add primary or unique key in the PostgreSQL documentation.
Back to top
View user's profile Send private message
cosimelli@criap.it



Joined: 21 Jun 2010
Posts: 12

PostPosted: Thu 01 Jul 2010 11:52    Post subject: Reply with quote

I've found the problem in my application. There is a field, in my table, named 'user' that give me the error in the INSERT and UPDATE procedure.

Thanks for the Help
Fabio
Back to top
View user's profile Send private message
RichTat



Joined: 04 Mar 2008
Posts: 4
Location: UK

PostPosted: Thu 22 Jul 2010 14:24    Post subject: Reply with quote

Hello bork

I have just installed UniDAC for RAD Studio 2010 but the example in Delphi 2010 won't compile - error cannot find DBAccess.
Could I have the C++ Builder 2010 sample also to try, please.
My email address is: richard@reetec.co.uk
Thanks
RichTat
_________________
Richard Tatlow
Back to top
View user's profile Send private message Visit poster's website
bork
Devart Team


Joined: 12 Mar 2010
Posts: 467

PostPosted: Fri 23 Jul 2010 16:15    Post subject: Reply with quote

Hello

The problem is that RAD Studio cannot find DBAccess file. There can be some causes:

1. UniDAC was installed incorrectly (for example if RAD Studio was run during UniDAC installation). Try to uninstall UniDAC and install it again without running RAD Studio. And please check after the installation that the library path was updated successfully. Check the value of RAD Studio -> Tools -> Options -> Library Win32 -> Library Path, it should contain the following paths: "C:\Program Files\Devart\UniDac for RAD Studio 2010\Lib" and "C:\Program Files\Devart\UniDac for RAD Studio 2010\Lib"

2. Please check if the C:\Program Files\Devart\UniDac for RAD Studio 2010\Lib folder contains the DBAccess file. If this file is unavailable then you don't have enough permissions. Try to install UniDAC to another folder or try to install it with administrator permissions.

3. If UniDAC was installed correctly and the C:\Program Files\Devart\UniDac for RAD Studio 2010\Lib folder contains the DBAccess file, then check if you have enough permissions for this folder.

We provide two demos for CBuilder. You can find them in the following folders: "C:\Program Files\Devart\UniDac for RAD Studio 2010\Demos\Miscellaneous\CBuilder\" and "C:\Program Files\Devart\UniDac for RAD Studio 2010\Demos\Miscellaneous\VirtualTableCB\"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Devart Forum Index -> Universal Data Access Components All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum