This topic is locked

couple of things

10/24/2006 12:03:42 AM
ASPRunnerPro General questions
F
fatboylives author

Hi all.
Basically, the new beta version with WYSYG editor for the pages is a true winner. I am trialing the program to write webpages to add faults and problems to a database. I work in a service industry.
First off. In the last stable version, I used to be able to use the page that lets you change how a field was displayed etc to hide things. What I mean is I have a field called entrered that is of type date. I used to hide the field and make its default value Now(). However, I cannot work out how to hide it in the beta version. I can make it read only but how do I hide it?
And second, really not a problem but need some guidence.
I use the ADD page for the 2500 users in the building I manage to add faults etc to the system. As you can imagine, some of the faults I have already been notified of. So at the top of the page above where the ADD part is, I would like to display a list of jobs that I already know of from say the last 3 days.
I know the sql will be something like

select description, status

from faults

where ((date is not older that 2 days) and (not closed))
Not correct but you will get the idea.....
Where can I find some info on how to achieve this....
However, a great program...

Peter

J
Jane 10/24/2006

Peter,
please see my answers below:

  1. there is no hidden format in the ASPRunner 4.1. You can easy uncheck this field on the ADD page on the Choose fields tab and set the default value in the BeforeAdd event on the Events tab.

    Here is a sample code:
    Function BeforeAdd(dict)

    dict("FieldName") = NOW()

    BeforeAdd = True

    End Function


2. you can do it using AddOnLoad event.

Here is a sample code:

http://www.xlinesoft.com/asprunner/docs/sh...omer_orders.htm

If you'll have difficulties with SQL query post your table structure here and I'll help you.

F
fatboylives author 10/24/2006

Thanks Jane. I get what you mean re the sql part but I will get the help if you can and I will understand hopefully after that.
My table is called faults

Structure (well the fields I want to display)

ID : Integer

Block : integer Links to another table and displays another field

Description : Longtext

Status : integer

entered : datetime
The block field links to the LOCATIONS table field ID (of type integer) and displays the filed BLOCK (of type) text.
I want to display records with a status of less than 100 and entered less than 72 hours ago like

id block description status entered

345 AW3 Tap is leaking 35 12/12/2006 10:56
Hope that makes sense...

J
Jane 10/25/2006

Here is the SQL query you need:

select ID, Block, Description, Status, entered from faults where (Status<100 and entered>NOW()-3



Use this query in your AddOnLoad event.

F
fatboylives author 10/25/2006

Here is the SQL query you need:

Use this query in your AddOnLoad event.


Sorry to be a pain in the backside but am I meant to drop that code into the event or drop the code from the example given in the first reply then use this SQL query in my case?

J
Jane 10/26/2006

Hi,
you need to use this code in the event.

Here is a sample:

Sub AddOnLoad()

set rstmp = Server.CreateObject("ADODB.Recordset")

strSQL = "select ID, Block, Description, Status, entered from faults where (Status<100 and entered>NOW()-3"

rstmp.Open strSQL, dbConnection
do while not rstmp.eof

Response.write rstmp("ID") &" "&rstmp("Block") & " " & rstmp("Description") & " " & rstmp("Status") & " " & rstmp("entered") & "
"

rstmp.MoveNext
loop
rstmp.Close : set rstmp =nothing

End Sub

F
fatboylives author 10/26/2006

Hi,

you need to use this code in the event.

Here is a sample:


Thanks Jane. I am at home now and will try in the morning when I get to work. Sorry that you have to support with code as well as the program.....
Lets see what happens.