Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What = no record??

Status
Not open for further replies.

madanthrax

IS-IT--Management
Sep 15, 2001
123
AT
Hi guys,

I have been given access to a 'view' from another SQL database which is on the same physical server as my website's database. I have no control over this other database.

All the raw details about a few thousand documents in pdf format are available. The other database classifies the docs into six different groups. My website has to classify them into 17 different groups..AND documents can be in more than one group.

From advice I got on this forum I made a table in my DB that was 'one to many' as they say. All the 'view' docs have a PubID, so I have a table called SubAreas with a field for PubID and SubID, I added another field called Control (more later). The PubID is linked to the PubID in the view by me making a further view in my DB using a left outer join.

This works well, if multiple rows are inserted in the SubAreas table such as:
PubID SubID
2267 120
2267 150
2267 220

(SubID being the code for one of the 17 groups) Then using a recordset with a variable to specify the group number any doc associated with the number displays on my page. This is really cool, and my first attempt at using linked tables.

So what is the problem?
Well I have made a form up with 17 checkboxes on it for my users to classify each of their document's areas. Using a select box they choose the document PubID and tick any number of boxes. Submitting the form which has a move next in it inserts a row for every ticked box just like my example above. The dropdown list is populated by a recordset, and displays about 2000 PubIDs.

I have cut down the number showing by filtering them by the six original view's groups and putting them in different forms which helps a bit, but I need a way of hiding submitted PubIDs or users will forget which docs they have classified.

So I created the Control field in the SubAres table. When the checkbox form is submitted it puts the value 1 into each Control field row. I thought I could select the dropdown recordset results by using the SQL: Where Control = "" , or Where Control <> 1, or Where Control is null, but it does not work.

There is no PubID record at all until an insert is made. Having a default value in the Control field also will not help until it exists.

Is there some kind of EOF value that can be put in an SQL statement? or record does not exist? Or do I need to redesign?

Any help would be apprciated.

&quot;Nothing is impossible until proven otherwise&quot;
 
I'm not entirely sure I understand the problem you are encountering. Can you provide some code that shows what you are doing and what you hope to accomplish?

------------------------------------------------------------------------------------------------------------------------
"I am not young enough to know everything."
Oscar Wilde (1854-1900)
 
ok..this is what i understood...

You have a form...which has

a dropdown box <<< listing 2000 pubid's
17 checkboxes << to check for the categories

so as a user i select a pubid from the dropdown and check all the related checkboxes to specify all the related categories this pubid belongs to...

>>> now the problem starts here...

then what you did is instead of showing 2000 pubid's you separated them yo show only few and made different forms for each...

[red]AND THIS IS NOT A GOOD IDEA AND A BAD DESIGN. PERIOD[/red]

[green]suggestion, use a doubly linked dropdown with first drop down being the view type and second being the one which lists only the pubid of the selected view type from dropdown one...[/green]

>>>another problem

after user finishes filling up the form, you moved on to
show the different form...but you dont have a way to hold the values that the user submitted on the first form...because you neither used SESSION VARAIBLES nor YOU ARE DOING A DATABASE INSERT...

[green]set up ONLY a SINGLE form with double linked list and checkboxes...after user fills the form and hits submit...do an insert in the database and prompt the user asking if he wants to enter for another pubid..if YES redirect him back to the form page...else redirect him to thank you page...[/green]

post back if you have any more questions...

-DNG
 
Thanks for the replies guys.

I realised I had not explained very well, and during thinking about how to explain what the problem was I had a couple of new ideas. I left the DB alone and went to the move next bit in the dropdown. I was trying to get a value from a record in the linked SubAres table that did not exist. So I turned it around with an if else and looked for the entry with a value instead, if it existed the code went straight to move next and did not insert that select. Hey presto it all works fine.

Apologies for wasting your time.

I really don't know how you guys understand whats going on in some of the threads where people ask much more difficult questions and sometimes paste a few pages of code. Its awe inspiring. Keep up the good work.

&quot;Nothing is impossible until proven otherwise&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top