il_betto
05-08-2009, 04:16 AM
Hi to All !!!
I have a big problem :mad:
I use Access 2000 and i have created a table with 140 fields
I use a page called index.asp in which a person can choose different values in different menus and when all are selected the employ can submit the Form and these values are put in the DB.
This is OK for fields in the DB less than 100, when I had to increase the number of the fields in the DB compared the message:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Driver ODBC Microsoft Access] Query much complex.
aggiorna.asp, line 120
I read in the Microsoft page that it' s a limit of ADODB.Recordset: is there some way to solve it maintaing the code ??
- I would like to maintain, if it' s possible, the code that i have created in these monthsbecause it cost very much effort, but if there isn' t a way to solve this problem I have to create an UPDATE classic ??
- I used response.buffer = true but with no result
Thanks a lot for All Help in advance !!!!
This is index.asp:
<%@ Language=VBScript %>
<% Option Explicit
Dim check, nr, objConn, objRS, objRS2, rec, strSQL
'
check = 0
nr = 0
rec = 1
'
if trim(request("rec"))<>"" then rec = Request("rec")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SSD</title>
<Script Language="JavaScript">
function notify(n) {
if (n==0) {
var answer = confirm("Salvare le modifiche?")
if (answer) {
document.FrontPage_Form.action = "aggiorna.asp"
document.FrontPage_Form.submit();
return true; } }
}
</script>
</head>
<body>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=ssd09.dsn"
objConn.Open
'
Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open "t_check", objConn, , 3, 2
Do While Not objRS2.EOF
If (objRS2("Numero") = Cint(rec)) Then
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
check = check + 1
End If
objRS2.MoveNext
nr = nr + 1
Loop
If (check = 0) Then
rec = 1
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
End If
'
%>
<form method="POST" webbot-onSubmit language="JavaScript" name="FrontPage_Form">
<table>
<td width="104" align="center" height="24">
<p style="margin-top: 10px">
<select size="1" name="arrivo_camp" id="arrivo_camp" style="font-family: Arial; font-size: 10 pt; width: 80">
<option selected><%=objRS("Arrivo_Camp")%></option>
<option>184</option>
<option>190</option>
<option>P291</option>
<option>P294</option>
</select></td>
....................
<input type="submit" name="salva" value="Salva" onClick="notify(0)">
.......................
</table></form>
<%
objRS.Close
objRS2.Close
objConn.Close
Set objConn = Nothing
%>
And this is the code of aggiorna.asp:
<%@ Language=VBScript %>
<%
Option Explicit
Dim objConn, objRS, rec
'
rec = Cint(Request.Form("rec_mod"))
'
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=ssd09.dsn"
objConn.Open
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "t_check", objConn, , 3, 2
'
Do While Not objRS.EOF
If (objRS("Numero")=rec) Then
objRS("Arrivo_Camp") = Request.Form("arrivo_camp")
objRS("Arrivo_Proc") = Request.Form("arrivo_proc")
...... I have more than 100 of these fields !!! <----
'
objRS.Update
'
End If
objRS.MoveNext
Loop
'
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<HTML>
<BODY> ...... ... </BODY>
</HTML>
I have a big problem :mad:
I use Access 2000 and i have created a table with 140 fields
I use a page called index.asp in which a person can choose different values in different menus and when all are selected the employ can submit the Form and these values are put in the DB.
This is OK for fields in the DB less than 100, when I had to increase the number of the fields in the DB compared the message:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][Driver ODBC Microsoft Access] Query much complex.
aggiorna.asp, line 120
I read in the Microsoft page that it' s a limit of ADODB.Recordset: is there some way to solve it maintaing the code ??
- I would like to maintain, if it' s possible, the code that i have created in these monthsbecause it cost very much effort, but if there isn' t a way to solve this problem I have to create an UPDATE classic ??
- I used response.buffer = true but with no result
Thanks a lot for All Help in advance !!!!
This is index.asp:
<%@ Language=VBScript %>
<% Option Explicit
Dim check, nr, objConn, objRS, objRS2, rec, strSQL
'
check = 0
nr = 0
rec = 1
'
if trim(request("rec"))<>"" then rec = Request("rec")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SSD</title>
<Script Language="JavaScript">
function notify(n) {
if (n==0) {
var answer = confirm("Salvare le modifiche?")
if (answer) {
document.FrontPage_Form.action = "aggiorna.asp"
document.FrontPage_Form.submit();
return true; } }
}
</script>
</head>
<body>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=ssd09.dsn"
objConn.Open
'
Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open "t_check", objConn, , 3, 2
Do While Not objRS2.EOF
If (objRS2("Numero") = Cint(rec)) Then
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
check = check + 1
End If
objRS2.MoveNext
nr = nr + 1
Loop
If (check = 0) Then
rec = 1
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
End If
'
%>
<form method="POST" webbot-onSubmit language="JavaScript" name="FrontPage_Form">
<table>
<td width="104" align="center" height="24">
<p style="margin-top: 10px">
<select size="1" name="arrivo_camp" id="arrivo_camp" style="font-family: Arial; font-size: 10 pt; width: 80">
<option selected><%=objRS("Arrivo_Camp")%></option>
<option>184</option>
<option>190</option>
<option>P291</option>
<option>P294</option>
</select></td>
....................
<input type="submit" name="salva" value="Salva" onClick="notify(0)">
.......................
</table></form>
<%
objRS.Close
objRS2.Close
objConn.Close
Set objConn = Nothing
%>
And this is the code of aggiorna.asp:
<%@ Language=VBScript %>
<%
Option Explicit
Dim objConn, objRS, rec
'
rec = Cint(Request.Form("rec_mod"))
'
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=ssd09.dsn"
objConn.Open
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "t_check", objConn, , 3, 2
'
Do While Not objRS.EOF
If (objRS("Numero")=rec) Then
objRS("Arrivo_Camp") = Request.Form("arrivo_camp")
objRS("Arrivo_Proc") = Request.Form("arrivo_proc")
...... I have more than 100 of these fields !!! <----
'
objRS.Update
'
End If
objRS.MoveNext
Loop
'
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<HTML>
<BODY> ...... ... </BODY>
</HTML>