yourguide
Posts: 44
|
Posted: 05/18/2012, 11:53 AM |
|
I need a grid that pulls data from two totally different database connections.
Anyone have any ideas where I should begin?
Custom editing the code is no problem... I am just new to Codecharge and want to do things the right way.
Thanks!
_________________
Independent, self-employed, web developer. |
|
|
DataDoIT
|
Posted: 05/18/2012, 12:54 PM |
|
A grid component or control can't have multiple connections. Your
options are:
1. Have the grid pull data from connection1, then use events in the grid
to pull data from the second connection, such as Before Show, Before
Show Row, label Before Show, etc. You'll not be able to use the Sorter
on fields from the second connection.
2. Use a database view or stored procedure to combine the data needed,
then reference that view or SP from the CodeCharge grid control.
|
|
|
yourguide
Posts: 44
|
Posted: 05/18/2012, 1:18 PM |
|
Thank you for your quick reply.
I think option 1 is the best, so now I just have to figure out how the Dlookup command is used to run a Dlookup before I display the one value I need to pull from another database.
That sounds right doesn't it? Im so new at this...
_________________
Independent, self-employed, web developer. |
|
|
DataDoIT
|
Posted: 05/18/2012, 1:34 PM |
|
Easy breezy. Just remember to quote where appropriate. Ex:
Expression: "yourField"
Domain: "yourTable"
Criteria: "yourKey=" . CCToSQL($Container->ds->f("yourKey"),
ccsInteger)
Connection: Connection2 <--- the name of your second connection
Convert result to: Integer
Type of Target: Control
Target: Name of your Control
Tip: Don't use fancy names for your connections. Stick with
"Connection1", or "Connection2", etc. It'll make things easier later
for reusing code or referencing code in your own library.
|
|
|
yourguide
Posts: 44
|
Posted: 05/18/2012, 1:42 PM |
|
THANK YOU! That saved me some real time!
So if I worked through the tutorials would it help me learn these kinds of techniques? Or is there a Book or something for CodeCharge?
_________________
Independent, self-employed, web developer. |
|
|
|