Tech Support Guy banner
Status
Not open for further replies.
1 - 8 of 8 Posts

·
Registered
Joined
·
1,021 Posts
Discussion Starter · #1 ·
I am having trouble getting updates to post on an edit page. I believe the problem may be in the way the dropdown boxes are named and called, but I have not been able to figure out a way to do it better.

For y1 = 1 to 7

%>
[TD]">

<%

Set rsUCAbPD=Conn.Execute(" SELECT DISTINCT ZZAttdCode.AttdCodeAb FROM ZZAttdCode ORDER BY AttdCodeAb ASC ")

MArUCAbPD = rsUCAbPD.GetRows()

rsUCAbPD.Close
Set rsUCAbPD=Nothing

For x = 0 to Ubound(MArUCAbPD,2)
%> "><%Response.Write MArUCAbPD(0,x)%>
<%
Next
%> [/TD]
<%
tab = (tab + 1)
Next

I will attach the whole file, in case more code is needed. The code is quite long and parts of it are inefficient (particularly how the dates are added), but I am new to ASP. Can anyone see why the data is not being updated?
 

Attachments

·
Registered
Joined
·
1,021 Posts
Discussion Starter · #3 ·
No error messages. The dropdown lists are populated correctly. But when the "submit" is pressed the values selected to be updated in the database go unchanged. Still no error message, but instead of getting the "Operation Completed" confirmation - the title of the page is the only thing that appears. I believe something in the way I did the For Loop when building the dropdown boxes (the name of the control) is not matching the way it is stored in the variables.

In the form:

NAME="UCodes"


Later when storing the value:

varU1 = Request.Form("UCodes")(1)


I am not sure how this part of the code works.
 

·
Registered
Joined
·
1,021 Posts
Discussion Starter · #5 ·
I'm confused!! I thought that was used to choose the default choice for the dropdown.

If not, I am not sure what I need to name it. Somehow they need to be named UCodes1 - UCodes 42, but since a loop of 1-7 is used to build each week - I don't know how to accomplish this. Should the first week loop say:

For y1 = 1 to 7

And the second week loop say

For y1 = 8 to 14

And so on.
 

·
Registered
Joined
·
21,334 Posts
Sorry, I missed what you had for the form element name and it is indeed set correctly. Why are you closing the recordset prior to the dropdown being written? Try hard coding the dropdown list with a set of values and see if it will update the table correctly. If it does you will need to rethink the method you are using to get the option value for each item in the list.
 

·
Registered
Joined
·
1,021 Posts
Discussion Starter · #7 ·
I tried hard-coding some values into the dropdown and nothing changed - still no values were changed in the table. I am still unsure of what you mean though. The values in the dropdown list come up fine. The problem is when you choose one from the dropdown, the table value is not being updated with the most recent selection. Are you thinking that the problem is that the recordset is being closed before the table is updated, so there is no value in the dropdown to post? If so, wouldn't that throw some sort of error message? I tried doing a response.write for UCode(1) value and get:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'UCodes'
 

·
Registered
Joined
·
21,334 Posts
Check your datatypes for the fields you are attempting to update. Apparently it is trying to update the table with an incorrect datatype.
 
1 - 8 of 8 Posts
Status
Not open for further replies.
Top