Silvercat
|
Posted: 01/09/2002, 12:53 AM |
|
Can anybody help?
The Tree Form only works seamlessly when the Category ID and PArent Category ID are integers. However, if you need to use it with a Character typed Category ID and Parent Category ID, it fails. I am using ASP+MSSQL and MS ODBC treats the value as a column name instead of a string.
That is, if the link says
http://www.mysite.com/app/TreeTest.asp?FormName=Tree&CAT_ID=A
It gets an Internal Server error which is
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'A'.
It seems that if I manually edit the URL as
http://www.mysite.com/app/TreeTest.asp?FormName=Tree&CAT_ID='A'
it will work fine... but the code generated by code charge doesn't put the quotation mark so it works only with integers.
any idea for work around?
|
|
|
Silvercat
|
Posted: 01/09/2002, 4:44 AM |
|
After testing the Integer based Cat_ID, Par_Cat_ID. I decided to change them to char. I then generate the page in ASP format and it didn't work as expected.
But I have tried to change the URL of the generated code from
www.mysite.com/page?cat_id=A
into
www.mysite.com/page?cat_id='A'
and it did not have the error so I decided to edit the generated file and change all line that refer to sWhere which construct the where clause from
sWhere = " where cat_id =" & sCatID
into
sWhere = " where cat_id ='" & sCatID & "'"
then saved it and tried.
IT WORKED!
I tried it with both text and number type for category ID and it worked!
I don't know if this will work with other database or other language. Maybe this is the way to make code charge to work with IDs with spaces in between too.
For now, this is the only I know how to make it work, anybody have a better solution?
|
|
|
|