|
| |
|
|
BeTheBall
Posts: 6335 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: help with a form - 6/28/2004 12:33:09
Post the most current versions of both files and I will team them up with the copy of the db you sent me. That will be later today as the db is on my site at home.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
jaberwocky
Posts: 185 Joined: 8/8/2003 Status: offline
|
RE: help with a form - 6/28/2004 12:38:56
thanks...much appreciated. I am still going to look at it and try to figure out whats wrong. Here is the Form page:
<%@ Language=VBScript %>
<% Response.Buffer=true %>
<%
dim conn
Session.timeout = 2
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "attendance2004","",""
sQl="SELECT * FROM ""servicesStaffQuery"" ORDER BY ""shiftcode"" ASC, ""fullname"" ASC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
<title>Services Scheduled Shifts</title>
</head>
<body bgcolor="" text="navy">
<form METHOD="POST" ACTION="shifts2.asp" style="border: 1px solid #000000; background-color: #EAEAEA; ">
<p align="left"><font color="#00008B">Week Starting: <input type="text" name="weekof" size="20"> mm/dd/yyyy
</font></p>
<table WIDTH="220" BORDER="0" CELLSPACING="0">
<font FACE="Arial" COLOR="#000000">
<tr>
<th BGCOLOR="#ffffcc" WIDTH="140" align="left" ><span style="font-weight: 400"><font FACE="Arial" COLOR="darkblue">Name</font></span></th>
<th BGCOLOR="#ffffcc" WIDTH="100" align="right"><span style="font-weight: 400"><font FACE="Arial" COLOR="darkblue"># Shifts Sched</font></span></th>
</tr>
</table>
<span id="dataPanel"
style="font:10pt;height:420px;width=400px;visibility:visible;overflow:scroll;background:#ffffff;border:0
inset black">
<table WIDTH="324" BORDER="0" CELLSPACING="0">
<font FACE="Arial" COLOR="#000000">
<%
i=0
On Error Resume Next
rs.MoveFirst
Do While Not RS.EOF
i=i+1
%>
<tr>
<td WIDTH="120"><font SIZE="2"><input type="HIDDEN" name="fullname<%=i%>" value="<%Response.Write(rs.Fields("FullName"))%>"><%Response.Write(rs.Fields("FullName"))%></font></td>
<td width="58" align="center"><font color="blue"><input TYPE="text" NAME="shiftsworked<%=i%>" size="5">
</tr>
<%
rs.MoveNext
loop%></span>
<td><input type="submit" value="Submit" name="submit"></left></td>
<input type = "HIDDEN" Name = "recCount" Value = <%=i%>>
</table>
</form>
</font>
</body>
</html> and the update page
<% DIM conntemp, mySQL, myDSN, recCount
recCount=Request.Form("recCount")
myDSN = "DSN=attendance2004"
set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
FOR i = 1 to recCount
IF Request("ShiftsWorked" & i) <> "" THEN
mySQL = "INSERT INTO ShiftsWorkedCOPY (WeekOf, FullName, ShiftsWorked) VALUES"
mySQL = mySQL & " (#" & Request("WeekOf") & "#, '" & Request("Fullname" & i) & "', " & Request("ShiftsWorked" & i) & ")"
conntemp.execute(mySQL)
END IF
NEXT
conntemp.close
set conntemp=nothing
Response.write "Records added."
%>
|
|
|
|
BeTheBall
Posts: 6335 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: help with a form - 6/28/2004 20:52:35
Worked for me. The only issue I had was that in the db you sent me, there was no field titled "shiftcode" in the query named "servicesStaffQuery", however, that immediately threw an error.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
jaberwocky
Posts: 185 Joined: 8/8/2003 Status: offline
|
RE: help with a form - 6/28/2004 21:01:29
hmmm ok then. The 'ShiftCode' was added later, after i sent you the database, and it does exist in my query now. hmm OK, i am going to have to take a second look and see why my data isnt entering the databse when i do it here.. i just tried it again to make sure
|
|
|
|
BeTheBall
Posts: 6335 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: help with a form - 6/28/2004 21:44:53
It does seem a little tempermental. Keep an eye on it. Spooky, if you are following this thread, do you know of any reason why an update statement would be intermitent in that sometimes the update works and others not, but when it doesn't it throws no error message?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|