Forums

This topic is locked

? delete upload multiple files tutorial

Posted 27 Oct 2002 06:58:37
1
has voted
27 Oct 2002 06:58:37 John Gough posted:
I'm trying to get my brain around the tutorial re deleting or updating multiple files from the same page - I've modified the "text" form elelment to be a checkbox yes/no and ge the error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

Basically what I want to do is delete multiple files (which works fine) or archive (by checking) multiple files - this however is NOT working.

Code:

Default.asp
<head>
<SCRIPT LANGUAGE="JavaScript">
function DeleteRecord()
{
if (confirm("This will delete the record(s)! Are you sure you want to do this!?")
{
document.forms[0].action = "delete_SubmitRes.asp";
document.forms[0].submit();
}
}
function ArchiveRecord()
{
if (confirm("This will archive the record(s)! Are you sure you want to do this!?")
{
document.forms[0].action = "update_SubmitRes.asp";
document.forms[0].submit();
}
}
</SCRIPT>
</head>
<body>
<%
Dim iCount
iCount = 0
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsHwkSubmit.EOF))
%>

<input type="checkbox" name="<%= (iCount & ".archive" %>" value="True">
<input type="hidden" name="<%= (iCount & ".ID" %>" value="<%=(rsHwkSubmit.Fields.Item("ID".Value)%>">

<input name="Delete" type="checkbox" id="Delete" value="<%=(rsHwkSubmit.Fields.Item("ID".Value)%>">
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsHwkSubmit.MoveNext()
iCount = iCount + 1

<input type="submit" value="Archive Selected Items" onClick="ArchiveRecord();">

<input type="submit" value="Delete Selected Items" onClick="DeleteRecord();">

<input type="hidden" name="Count" value="<%=iCount - 1 %>">

Edit.asp

<%
Response.Buffer = True
Dim iCount
iCount = Request.Form("Count"
Dim strarchive, strID

Dim strSQL
Dim Command1
set Command1 = Server.CreateObject("ADODB.Connection"
Command1.ConnectionString = MM_dbEden_STRING
Command1.Open
Dim iLoop
For iLoop = 0 to iCount
strarchive = Request(iLoop & ".archive"
strID = Request(iLoop & ".ID"
'To update
strSQL = "UPDATE rsHwkSubmit SET archive = '" & "True" & "'" &_
" WHERE ID = " & strID
Command1.Execute strSQL
Next
Command1.Close
Set Command1 = Nothing
Response.Write "Records were updated ! One moment..."
%>


Thanks!
John

Replies

Replied 28 Oct 2002 09:07:14
28 Oct 2002 09:07:14 Vince Baker replied:
You were probably expecting me to give the solution....I just wanted to note that I had simular issues when following the tutorial.

I never managed to get it to work...I did however get the multiple delete to work.

It seems to fail once you move to the second part of the tutorial....

If you do find the result I would be really grateful if you could let me know what it is.....



Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic