This topic is locked
[SOLVED]

 Hide Chile Record Link

10/2/2010 9:00:51 PM
ASPRunnerPro General questions
R
Roger author

So I have a situation where I need to hide the CHILD Record link on the LIST if there less than 1 Child Records OR a condition in a Flag value in the same table is not what we need [for example -> if NOT cint(strValue) = 0 then some action...] [this is the link that says (Children(X))]), not sure what it's called. I have some users that are getting confused and click on the link even if there are no linked (child) records.
Also, when using DAL during login, I'm trying to update the last login field in a table. I can do this using "RAW" sql and it works, but I'd like to change my projects to start using DAL syntax and gifts.
To be honest, the docs are a little confusing and in some cases the axamples work (with a little editing of table/column names), in others they just generate error codes. I guess what I mean is when cna/should I use DAL as apposed to RAW SQL?
ps, not to worry about the actual sybtax in the above explanantion, I understand that aspect.
TX all.

Sergey Kornilov admin 10/2/2010

There is an option in ASPRunnerPro to hide child link if no child records exist.
In regards to second question - need more info. What exactly confuses you? What exactly doesn't work? What's your code and what are error messages?

R
Roger author 10/3/2010



There is an option in ASPRunnerPro to hide child link if no child records exist.
In regards to second question - need more info. What exactly confuses you? What exactly doesn't work? What's your code and what are error messages?


Yup, I know that one can hide the link if "No records exist", but to the second part, how can we hide it if a certain condition is truefor a given records?
My appologies with regard to DAL, the confusing part for me is when or in what events to use DAL? Here is an example (code inserted into BeforeLogin Event via the GUI), and I changed the appropriate data:

dim rsExists

set rsExists = dal.SYS_Users.Query("Acct_Status='True'","")

if not rsExists.eof then

' if record exists do something

else

' if dont exist do something else

end if

rsExists.Close : set rsExists = Nothing
I get this error:

Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)

[Microsoft][ODBC SQL Server Driver][SQL Server]Conversion failed when converting the varchar value 'True' to data type int.

/flexr/usr/include/dal_source.asp, line 1151
I've also noted that DAL cannot be used in certain events (can't recall which one that caused me grief, so we can forget this one until I run into it again).
Thanks.

R
Roger author 10/3/2010



There is an option in ASPRunnerPro to hide child link if no child records exist.
In regards to second question - need more info. What exactly confuses you? What exactly doesn't work? What's your code and what are error messages?


Another little ditty, when I turn ON Dispkay No of child, turn OFF hide if no child, and enable preview details in line, I get this:

Messagespreview it should be Messages(x)

Sergey Kornilov admin 10/3/2010

In regards to DAL question:

Conversion failed when converting the varchar value 'True' to data type int.
You are trying to feed the text value of 'True' to int field Acct_Status, which is not correct.

Correct WHERE clause is Acct_Status=1, no matter if you use DAL or raw SQL.
DAL is a shortcut for those who are not familiar with SQL. Both do exactly the same job.

R
Roger author 10/5/2010



In regards to DAL question:

Conversion failed when converting the varchar value 'True' to data type int.
You are trying to feed the text value of 'True' to int field Acct_Status, which is not correct.

Correct WHERE clause is Acct_Status=1, no matter if you use DAL or raw SQL.
DAL is a shortcut for those who are not familiar with SQL. Both do exactly the same job.


i am sorry, I should have reposted that I fixed the converson error, I chose the wrong field in the editor, and as for the ohter part of the post that you did't answer, resetting the page fixed that one.
Cheers and thanks for the heads up.