This topic is locked

active/inactive records

4/7/2005 10:19:15
ASPRunnerPro General questions
author

hello,

I was wondering if anybody has cutomized thier app to only show active records.
I have been trying but have run into a few issues.
First I added a new column to my table called status.
I have the default value =0 (active) inactive =1
I created a new xxxx_list.asp and renamed it to xxxx_list_active.asp.
I then renamed all of the istances the following variable in the new page gstredit to gstredit2
I then created a new variable called gstrsqla entry in the xxxx_variables.asp file in the include dir.
here it is:

gstrSQLA = "select [Company ID], [Company Name], [Street], [City], [State], [Zip Code], [Company Phone Number 1], [Company Phone Number 2], [Company Website], [Support Website], [Contact Page Website], [Other Company Website], [User ID] From [dbo].[Company] where [status] = 0"
so its a copy of gstrsql but added the where [status] = 0
now if I go to the page I only see active records (exactly waht I wanted.)
but here's the problem - if I try to do a simple page serach I get an odbc error "error around 'from'"

Does anybody know a way around this, why does the search reload the page and try to use this query again.
Or can somebody explain what the the search process does(i cant figure it out).
Does anybody have a diffrent way of doing this or any suggestions.

Thanks

Rhino
Does anybody know what

Sergey Kornilov admin 4/8/2005

Hi,
you can create View in SQL Server on the top of this query. After that you can use this view as a datasource in ASPRunner.

Z
znetman 4/8/2005

That sounds like a great idea for records that are not going to be edited in the app (view only).
Is there away that you can set it up so the records can be edited?
Thanks,

zack

Sergey Kornilov admin 4/11/2005

zack,
simple view with WHERE clause will be updatable in SQL Server.

Z
znetman 4/11/2005

Sergey,
It worked! I had never tried to Update a Simple SQL View.
Thanks for the Tip!
Zack