Ciao a tutti ,
ho il seguente problema :
Tipo di errore:
ADODB.Recordset (0x800A0BB9)
Gli argomenti non sono di tipo valido, non sono compresi nell'intervallo consentito o sono in conflitto.
/Pages/Includes/Database.asp, line 44
La riga 44 è la seguente :
oRS.Open strSQL, CStr(GetConnectionString) ,3,3
Tutto il file è il seguente :
<%
function killChars(strWords)
dim badChars
dim newChars ,i
badChars = array("select", "drop", ";", "--", "insert", "delete", "xp_")
newChars = strWords
for i = 0 to uBound(badChars)
newChars = replace(newChars, badChars(i), "")
next
killChars = newChars
end function
function SQLSafeString(pstrString)
SQLSafeString=replace(pstrString,"'","''")
end function
function QuerySafeString(pstrString)
QuerySafeString=replace(pstrString,"'","''")
QuerySafeString=killChars(QuerySafeString)
end function
Class clsDatabase
Public GetConnectionString
'Private Sub Class_Initialize
' End Sub
' Private Sub Class_Terminate
' End Sub
Public Function Execute(strSQL,strErrorMessages)
Dim oRS
'on error resume next
strErrorMessages=""
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.CursorLocation = 3
'Response.Write strSQL
oRS.Open strSQL, CStr(GetConnectionString) ,3,3
if err.number <> 0 then
strErrorMessages = strErrorMessages & " Error occured. " & err.description & ""
err.clear
end if
oRS.ActiveConnection = Nothing
Set Execute = oRS
Set oRS = Nothing
End Function
Public sub ExecuteDML(strSQL,strErrorMessages)
Dim con
'on error resume next
Set con = Server.CreateObject("ADODB.Connection")
Con.Mode = 3
con.Open CStr(GetConnectionString) ,"Admin",""
if err.number <> 0 then
strErrorMessages=strErrorMessages & " Error occured. " & err.description & ""
err.clear
end if
con.Execute (strSQL)
if err.number <> 0 then
strErrorMessages = strErrorMessages & " Error occured. " & err.description & ""
err.clear
end if
End sub
End Class
function TableBodyList(byval pstrSQL,pstrHeaderRowParameters, _
pstrHeaderColumnParameters,pstrDataRowParameters, _
pstrDataColumnParameters,byref pconClass)
dim strTemp,rst,i,intFieldCount',conClass
'set conClass =new ClsDataBase
'conClass.getconnectionstring = PortalConnectString
'set rst= conClass.Execute (pstrSQL)
'esponse.Write pstrSQL
'esponse.End
set rst= pconClass.Execute(pstrSQL,strTemp)
if strTemp<>"" then
strTemp="<TR " & pstrDataRowParameters & "><TD " & pstrDataColumnParameters & ">" & strTemp & "</TD></TR>"
TableBodyList = strTemp
exit function
else
strTemp="<TR " & pstrHeaderRowParameters & ">"
intFieldCount=rst.fields.count-1
for i = 0 to intFieldCount
strTemp= strTemp & "<TH " & pstrHeaderColumnParameters & ">" & Replace(rst.fields(i).name,"'","") & "</TH>"
next
strTemp= strTemp & "<TH " & pstrHeaderColumnParameters & ">Delete</TH>"
strTemp= strTemp & "</TR>"
while NOT rst.eof
strTemp= strTemp & "<TR " & pstrDataRowParameters & ">"
strTemp= strTemp & "<TD " & pstrDataColumnParameters & "><A HREF =""javaScript:ModifyData('" & rst(0).value & "')"" >" & _
rst(0).value & "</A></TD>"
for i = 1 to intFieldCount
strTemp= strTemp & "<TD " & pstrDataColumnParameters & ">" & rst(i).value & "</TD>"
NEXT
strTemp= strTemp & "<TD " & pstrDataColumnParameters & "><A HREF =""javaScripteleteData('" & rst(0).value & "')"">Delete</TD>"
strTemp= strTemp & "</TR>"
rst.movenext
wend
end if
TableBodyList = strTemp
set rst = nothing
exit function
end function
function ComboBoxOptionList(byval pstrSQL,pstrSelectedValue, _
byref pconClass)
dim strTemp,rst,strTempResults
set rst= pconclass.Execute (strsql,strTempResults)
strTemp = ""
if strTempResults ="" then
while not rst.eof
strTemp=rst(0).value
IF pstrSelectedValue=strTemp then
strTempResults = strTempResults & "<OPTION SELECTED VALUE='" & strTemp & "'>" & rst(1).value & "</OPTION>"
else
strTempResults = strTempResults & "<OPTION VALUE='" & strTemp & "'>" & rst(1).value & "</OPTION>"
end if
rst.movenext
wend
else
strTempResults = "<OPTION VALUE=''>" & strTempResults & "</OPTION>"
end if
ComboBoxOptionList = strTempResults
set rst = nothing
exit function
end function
function TableMenuList(byval pstrSQL,pstrHeaderRowParameters, _
pstrHeaderColumnParameters,pstrDataRowParameters, _
pstrDataColumnParameters,byref pconClass)
dim strTemp,rst
set rst= pconClass.Execute(pstrSQL,strTemp)
if strTemp<>"" then
strTemp="<TR " & pstrDataRowParameters & "><TD " & pstrDataColumnParameters & ">" & strTemp & "</TD></TR>"
TableMenuList = strTemp
exit function
else
while NOT rst.eof
strTemp= strTemp & "<TR " & pstrDataRowParameters & ">"
strTemp= strTemp & "<TD " & pstrDataColumnParameters & "><A target =""Pages"" HREF =""" & rst(1).value & """ >" & _
rst(0).value & "</A></TD>"
strTemp= strTemp & "</TR>"
rst.movenext
wend
end if
TableMenuList = strTemp
set rst = nothing
exit function
end function
%>

eleteData('" & rst(0).value & "')"">Delete</TD>"
Rispondi quotando