CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Updating Records With Multiple Column Key [Resolved]

Print topic Send  topic

Author Message
BrooksA

Posts: 3
Posted: 06/16/2011, 6:18 AM

Hi Everyone,

I'm pretty new to CCS and I'm trying to develop a simple application that maintains environmental sample data. Records are stored in a table where every sample is given it's own record and the key for the table is a hybrid key made up of about 4 fields.

I'd like to use the Add/Edit Record to be able to edit a clicked result within the grid, however since I can only identify one primary key (I chose the Point ID) in the application builder, I'm having a little trouble doing this. When i click on a record it populates the Add/Edit boxes with the first record of that Point ID, regardless of which is clicked.

I've tried to use the visual query builder to accomplish this but haven't had much luck.

Any tips/suggestions would be greatly appreciated, this is one of the last things I still need to accomplish to roll out my application.

Thanks,

Adam
View profile  Send private message
Gena

Posts: 591
Posted: 06/16/2011, 6:25 AM

When design you DB then every table should has 1 ID field! This is rule.
_________________
Gena
View profile  Send private message
BrooksA

Posts: 3
Posted: 06/16/2011, 6:37 AM

Quote Gena:
When design you DB then every table should has 1 ID field! This is rule.
The table is being used as the basis for a dynamic pivot table so I haven't put in a separate ID field (instead creating a key made up of 4 fields).

Is the only solution to add another field to the table?

Thanks,
Adam
View profile  Send private message
E43509

Posts: 283
Posted: 06/16/2011, 6:41 AM

Can you post the table create script? That may help us understand.
Typically you would have a 'hidden' auto incrementing primary key in your table that is not based on the values one would use in the tables.
Combo primary keys are workable and used in what are called intersection tables.
If those four fields need to be unique, then instead of a primary key on them, put a unique index on them.
View profile  Send private message
BrooksA

Posts: 3
Posted: 06/16/2011, 8:16 AM

Thank you both for your responses. I took both of your advice and added a field that I don't show in the grid but made the key of the table. The page now functions as I intended it to.

Thank you both for making my first posting experience a positive one!

Cheers,
Adam
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.