I am trying to update the values in an ASP page read from a database. The values are stored in a table with the columns labeled from a-c (d is a hidden column containing the promary key) and the rows are from 1 to countsys which is a variable storing the number of systems. The error that I get is:
"Data type mismatch in criteria expression"
The code for populating the table from the database is as follows:
dim count
count = 1
While Not RS1.EOF%>
<tr>
<td width="30%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "a"&count%>" size="25%" value = "<%=rs1 ("System"
%>" onFocus="select(this)"></font></td>
<td width="45%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "b"&count%>" size="25%" value = "<%=rs1 ("Description"
%>" onFocus="select(this)"></font></td>
<td width="25%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "c"&count%>" size="25%" value = "<%=rs1 ("Responsible"
%>" onFocus="select(this)"></font></td>
<input type="hidden" name="<%response.write "d"&count%>" size="25%" value = "<%=rs1 ("SNo"
%>">
</tr>
<%count = count+1
The update query is as follows:
'update row by row, columns a,b,c
for i = 1 to countsys
'update systems table
tSQL = "UPDATE [Systems] SET"
tSQL = tSQL & " Systems.[System] = '"&replace(request.querystring("a"&i),"'","''"
&"', "
tSQL = tSQL & " Systems.[Description] = '"&replace(request.querystring("b"&i),"'","''"
&"', "
tSQL = tSQL & " Systems.[Responsible] = '"&replace(request.querystring("c"&i),"'","''"
&"'"
tSQL = tSQL & " WHERE (Systems.[SNo]) = "&request.querystring("d"&i)&" AND (Systems.[System])=" &pareaup
DB.execute (tSQL)
next
SNo is the primary key and is an integer value and pareaup is also a integer value.
Any help would be much appreciated!!
Bree
"Data type mismatch in criteria expression"
The code for populating the table from the database is as follows:
dim count
count = 1
While Not RS1.EOF%>
<tr>
<td width="30%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "a"&count%>" size="25%" value = "<%=rs1 ("System"
<td width="45%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "b"&count%>" size="25%" value = "<%=rs1 ("Description"
<td width="25%" height="1"><font face="Arial" size="2"><input type="text" name="<%response.write "c"&count%>" size="25%" value = "<%=rs1 ("Responsible"
<input type="hidden" name="<%response.write "d"&count%>" size="25%" value = "<%=rs1 ("SNo"
</tr>
<%count = count+1
The update query is as follows:
'update row by row, columns a,b,c
for i = 1 to countsys
'update systems table
tSQL = "UPDATE [Systems] SET"
tSQL = tSQL & " Systems.[System] = '"&replace(request.querystring("a"&i),"'","''"
tSQL = tSQL & " Systems.[Description] = '"&replace(request.querystring("b"&i),"'","''"
tSQL = tSQL & " Systems.[Responsible] = '"&replace(request.querystring("c"&i),"'","''"
tSQL = tSQL & " WHERE (Systems.[SNo]) = "&request.querystring("d"&i)&" AND (Systems.[System])=" &pareaup
DB.execute (tSQL)
next
SNo is the primary key and is an integer value and pareaup is also a integer value.
Any help would be much appreciated!!
Bree