Witam.
Proszę o pomoc bo już wyczerpały mi się pomysły.
Oto mój kod:
PLIK prof.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit %>
<% Response.Buffer = True %>
<!--#include file="adovbs.inc"-->
<!--#include file="Config.asp"-->
<%
If Session("Prof") <> 1 Then Response.End
Dim objConn, objRS, objRS2
Dim strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
'objConn.open("STUDENCI")
strDBConn = "Provider=MSDASQL.1;Data Source = STUDENCI;"&_
"""DSN = STUDENCI; DBQ = D:\Serwer\STUDENCI.DB;"";"
objConn.Open strDBConn
'Set Recordset
Set objRS = Server.CreateObject("ADODB.Recordset")
If Request.QueryString("Delete") <> "" Then
subDeleteRecord
ElseIf Request.QueryString("Add") <> "" Then
subAdd
Else
subListUserInfo
subListProject
End If
objRs.Close
Set objRs = Nothing
objConn.Close
Set objConn = Nothing
Sub subListUserInfo
Dim i, intFieldCount
strSQL = "SELECT wykladowcy.pass as ID, wykladowcy.pass, oceny.Id_oceny as LP, studenci.Imie_stud as Imie_studenta, studenci.Nazwisko_stud as Nazwisko_studenta, studenci.Kierunek, studenci.Nr_indeksu, studenci.Rok, oceny.Ocena, oceny.data_wyst as Data_wystawienia, przedmioty.nazwa_przed as Przedmiot FROM oceny, wykladowcy, studenci, przedmioty where oceny.id_wyk = wykladowcy.Id_wyk and oceny.Id_stud = studenci.Id_Stud and oceny.Id_przedmiotu = przedmioty.Id_przedmiotu ORDER BY oceny.Id_oceny" & Request.Querystring("Haslo")
objRS.open strSQL, objConn, adOpenDynamic, adLockOptimistic, adCmdText
objRS.Filter = "Pass = "+request.Form("Haslo")
intFieldCount = objRS.Fields.Count
%>
<p align="center"><a href="prof.asp?Add=1">Dodaj ocene z przedmiotu.</a></p>
<table align="center" cellspacing="1" cellpadding="2" border="1" bordercolor="#999900" bgcolor="#E8F4EB">
<tr>
<% For i = 2 To intFieldCount -1 %>
<th><%= objRS(i).Name %></th>
<% Next %>
<th> </th>
</tr>
<% Do Until objRS.EOF %>
<tr>
<% For i = 2 To intFieldCount -1 %>
<td><%= objRS(i)%></td>
<% Next %>
<td>
<a href="prof.asp?Edit=<%= objRS("LP") %>">Edytuj</a> |
<a href="prof.asp?Delete=<%= objRS("LP") %>">Usuń</a>
</td>
</tr>
<% objRS.Movenext %>
<% Loop %>
</table>
<%
End Sub
plik CONFIG.asp
<%
Dim strDBConn, intLog, strLogURL, strAdminName, strAdminPass
'objConn.open("STUDENCI")
strDBConn = "Provider=MSDASQL.1;Data Source = STUDENCI;"&_
"""DSN = STUDENCI; DBQ = D:\Serwer\STUDENCI.DB;"";"
intLog = 1
Sub subCustomCode
Response.Write "<p><b>" & Request("Login") & "</b>, please enjoy your stay!<p>"
Session("Prof") = 1
Server.Transfer("prof.asp")
End Sub
%>
Plik confirm.asp
<% Option Explicit %>
<% Response.Buffer = True %>
<!--#include file="Config.asp"-->
<%
Dim strSQL
Dim objConn, objRS, strConnection
If Request.Form("Login") = "" Then Response.End
Set objConn = Server.CreateObject("ADODB.Connection")
'objConn.open("STUDENCI")
strConnection = "Provider=MSDASQL.1;Data Source = STUDENCI;"&_
"""DSN = STUDENCI; DBQ = D:\Serwer\STUDENCI.DB;"";"
objConn.Open strConnection
strSQL = "SELECT Pass FROM WYKLADOWCY WHERE Nick='" & Request.form("Login") & "'"
'Set Recordset
Set objRS = objConn.Execute(strSQL)
If objRS.EOF Then
Response.Write "User <b>" & Request.form("Login") & "</b> does not exist."
ElseIf objRS("Pass") = Request.form("Haslo") Then
subCustomCode
subWriteCookie
Else
Response.Write "Incorrect password."
End If
objRs.Close
Set objRs = Nothing
objConn.Close
Set objConn = Nothing
Else
Response.Write "Incorrect password."
Response.End
End If
End Sub
'==================================================================================================
'Cookie
'==================================================================================================
Sub subWriteCookie
If Request.Form("SaveCookie") = 1 Then
Response.Cookies("Preferences")("Login") = Request.form("Login")
Response.Cookies("Preferences")("Haslo") = Request.form("Haslo")
Response.Cookies("Preferences").Expires = DateAdd("m", 1, Now())
Response.Write("Cookie saved.<p>")
Else
Response.Cookies("Preferences")("Login") = ""
Response.Cookies("Preferences")("Haslo") = ""
End If
End Sub
%>
Bład jaki otrzymuje:
ADODB.Recordset (0x800A0BB9)
Argumenty są niewłaściwego typu, wykraczają poza dopuszczalny zakres lub są ze sobą w konflikcie.
/studs/prof.asp, line 466
Linijka 466: objRS.Filter = "Pass = "+request.Form("Haslo")