Suntower
Posts: 225
|
Posted: 08/28/2006, 5:25 PM |
|
Hello,
I have a grid, with a linked Search which started out as a Table type. It required some joins that were too complex for the Query Builder so I converted it to SQL and adjusted the joins. Great.
But then I attempted to add a new text control to the Search. I added the text control and then another clause to the WHERE. I then added the parameter at the bottom of the Query Window and generated the page.
Then I get the dreaded ADODB.Recordset error '800a0cc1 in the Show method of the grid. More specifically at the line:
CachedColumns(j * CachedColumnsNumber) = Recordset.Recordset.Fields("PRODUCTID")
CachedColumns(j * CachedColumnsNumber + 1) = Recordset.Recordset.Fields("LOCATIONID")
CachedColumns(j * CachedColumnsNumber + 2) = Recordset.Recordset.Fields("CMPRODUCTJOIN_LOCATIONID")
CachedValuesNumber = i
...I've read some articles on this error and they indicate that it is because of having ambiguous column names in the SQL Query.
Great. But here's the thing: I don't -have- any ambiguous columns in my query. I -had- them when I created the grid and using a table type, but that was all resolved long ago. It seems as if the project is storing the column names from back when I used a table and won't let go.
For example, the line 'Recordset.Recordset.Fields("PRODUCTID")' refers to back when I created the grid. Currently, there -isn't- a field in the recordset called 'ProductID' (Probably why I'm getting the error.)
Anyone else run into this?
It happens -every- time I:
1. Create a table type grid
2. Change the grid to SQL type
3. Try to alter the linked Search form.
Is there a way around this without having to redo the whole grid and search form every time I want to make changes to the Search?
Frustrated.
---JC
_________________
---On a campaign for more examples and better docs! |
|
|
peterr
Posts: 5971
|
Posted: 09/28/2006, 12:11 AM |
|
This always worked for me without problems, although I quickly review all related elements in detail. Possibly you forgot to change the field name in the sorter or another place that doesn't seem obvious at first.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Suntower
Posts: 225
|
Posted: 09/28/2006, 8:29 AM |
|
The problem is always the same: If one changes the column names in the SQL statement -after- converting the initial table based query to 'SQL', bad things happen. Even if I have checked -all- component names.
The specific problem is in the section of generated code InitCachedColumns()
The CachedColumns() array seems to be -stuck- with the column names from the original table-based SQL statement.
My current workaround is to alias my column names to force them to match the CachedColumns() array. Which is a total pain.
---JC
_________________
---On a campaign for more examples and better docs! |
|
|
|