base de donnée access ! jai vérifier et revérifier, quelques un fonctionne et quelque autre non. Je trouve sa vraiment bizarre...
Mon systeme (intranet) demande un login ce qui est fonctionnel sur ce cote, tous les usagers sont reconnu, mais j'utilise un genre appli gréfé a mon systeme, qui lui à été fait par un consortium. J'ai vérifié leur programmation (code si haut) et tous me semble ok. Je vais vous mettre ce qui a dans ma page, le bout de code !
Dim strLogin
Dim strPassword
Dim strSQL
Dim MyConn
Dim RS
Dim filesys
Dim readfile
Dim strContent
Dim intContent
Dim intPosition
Dim strFile
Dim intSearchVariable
'récupération des données du formulaire
strLogin = cstr(Request.form("lName"))
sLangue = Request.Form("langue")
strPassword = cstr(Request.form("password"))
'Trouver le chemin d'accès au répertoire
Session("GLOBAL_CHEMIN") = server.mappath(".")&"\"
strFile = server.mappath(".")&"\m3cat.ini"
'lecture du fichier d'initialisation
Set filesys = CreateObject("Scripting.FileSystemObject")
Set readfile = filesys.OpenTextFile(strFile, 1, false)
If readfile.AtEndOfStream = True Then
readfile.close
Set readfile = Nothing
Set readfile = filesys.OpenTextFile(strFile, 1, false)
End If
strContent = readfile.ReadLine
strContent = Trim(strContent)
intContent = Len(strContent)
intSearchVariable = Instr(strContent, "[database]")
If intSearchvariable < 1 Then
While intSearchVariable < 1
strContent = readfile.ReadLine
intSearchVariable = Instr(strContent, "[database]")
intContent = Len(strContent)
Wend
End If
Session("GLOBAL_DB") = Right(strContent, intContent-intSearchVariable-9)
If readfile.AtEndOfStream = True Then
readfile.close
Set readfile = Nothing
Set readfile = filesys.OpenTextFile(strFile, 1, false)
End If
strContent = readfile.ReadLine
strContent = Trim(strContent)
intContent = Len(strContent)
intSearchVariable = Instr(strContent, "[connection]")
If intSearchvariable < 1 Then
While intSearchVariable < 1
strContent = readfile.ReadLine
intSearchVariable = Instr(strContent, "[connection]")
intContent = Len(strContent)
Wend
End If
Session("GLOBAL_CONNECTION") = Right(strContent, intContent-intSearchVariable-11)
If readfile.AtEndOfStream = True Then
readfile.close
Set readfile = Nothing
Set readfile = filesys.OpenTextFile(strFile, 1, false)
End If
strContent = readfile.ReadLine
strContent = Trim(strContent)
intContent = Len(strContent)
intSearchVariable = Instr(strContent, "[softmap]")
If intSearchvariable < 1 Then
While intSearchVariable < 1
strContent = readfile.ReadLine
intSearchVariable = Instr(strContent, "[softmap]")
intContent = Len(strContent)
Wend
End If
Session("GLOBAL_SOFTMAP") = Right(strContent, intContent-intSearchVariable-8)
readfile.close
Set readfile = Nothing
Set filesys = Nothing
'création et ouverture d'une connexion
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open Session("GLOBAL_CONNECTION")
Set session("MyConn") = MyConn
'********************************************************
' ICI QUE SA (*%###@@*&?
'********************************************************
strSQL = " SELECT * FROM USER_DESC "
strSQL = strSQL & "WHERE USER_LOGIN_NAME = '" & strLogin & "'"
strSQL = strSQL & " AND USER_PASW = '" & strPassword & "'"
Set RS = MyConn.Execute(strSQL)
If RS.EOF Then
Response.Redirect("login.asp?Incorrect=True")
Else
Session("GLOBAL_user_role_code") = RS("USER_ROLE_CODE")
Session("GLOBAL_cult_prof_id") = RS("CULT_PROF_ID")
Session("GLOBAL_defl_temp_id") = RS("DEFL_TEMP_ID")
Session("GLOBAL_user_login_name") = strLogin
RS.Close
strSQL = " UPDATE USER_DESC "
strSQL = strSQL & " SET USER_SESSION = "&Session.SessionID
strSQL = strSQL & " WHERE USER_LOGIN_NAME = '"&strLogin&"'"
Set RS = MyConn.Execute(strSQL)
Application.Lock
Dim MyArray
Dim i
Dim Found
Found = "N"
MyArray = Application("arrSessionID")
if Application("Nbr_session") > 0 then
for i=0 to Application("Nbr_session")-1
if clng(MyArray(i)) = clng(Session.SessionID) then
Found = "Y"
'Response.Redirect("login.asp?Incorrect=True")
end if
next
if Found = "N" then
Application("Nbr_session") = Application("Nbr_session") + 1
Redim Preserve MyArray(Application("Nbr_session"))
MyArray(Application("Nbr_session")-1) = Session.SessionID
end if
else
Application("Nbr_session") = 1
Redim MyArray(Application("Nbr_session"))
MyArray(Application("Nbr_session")-1) = Session.SessionID
end if
Application("arrSessionID") = MyArray
Application.UnLock
Response.Redirect("GENR_welc.asp?lang=1")
End If%>
<%'RS.Close
'Set RS = Nothing
%>