If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > A+b=c

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-02, 06:27
jvdzwaan jvdzwaan is offline
Registered User
 
Join Date: Nov 2002
Posts: 10
Question A+b=c

Here is a small script that i have to sumit some data from a field.
What i want. I got in my access databe 2 columns.
One called "Impact". And one called "Reoccurrence".
In the form you can select several data from pull down menu.

Now i want to have a script that does put a VALUE in a other COLUMN called "PRIO". (when the other 2 columns have a specific VALUE)

So when you make the selection HIGH in "Impact". And TOP in "Reoccurrence" then there must be the VALUE HIGH PRIO in column "PRIO"

I was thinking to do this in the HANDLERS.ASP that i did make to submit the data into my access DB.
Here is the script for the handler.

Can sombody give me the code to make what i want?

-------------------------------------------------------------
<%

'Open Connection

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "problemman"
SQL=""

Dim NameValue(125,2)
intformfields = 0
For each item in Request.Form

IF Item = "PMID" OR Request.form(Item) = "" OR Request.form(Item) = "Submit Changes" OR Request.form(Item) = "notneeded" THEN
intformfields = intformfields + 1
ELSE
NameValue(intformfields,0) = "Checklist."&Item
NameValue(intformfields,1) = Request.form(Item)
intformfields = intformfields + 1

END IF

Next

SQLStart = "Update Checklist Set "
SQLEnd = " WHERE (((Checklist.PMID )= "& Request.form("PMID") &"));"

'SQLEnd = " WHERE (((Checklist.Title )= '"& Request.form("Title") &"'));"
SQL = ""

For i = 0 to 124
IF trim(NameValue(i,0)) <> "" THEN
'response.write i&". "&NameValue(i,0)&" = "&NameValue(i,1)&"<BR>"
SQL = SQL & NameValue(i,0) & "='" & NameValue(i,1) & "',"
END IF
Next

SQL = Left(SQL, len(SQL) - 1)

Conn.Execute(SQLStart & SQL & SQLEnd)

SQL = "Checklist.prio" = High

SQL = "Checklist.Last_Updated"& "='" & Now() & "'"

IF Request.Form("status") = "Closed" THEN
SQL = "Checklist.Problem_closed"& "='" & Now() & "'"

Conn.Execute(SQLStart & SQL & SQLEnd)


'Set RS= Nothing
'RS.Close
END IF

%>
__________________
just joost :-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On