Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90

    aiuto !!!!

    non me ne va bene una uffa
    aiutatemi

    dove sbaglio?

    <%
    'Dimension variables
    Dim adoCon 'Database Connection Variable
    Dim strCon 'Holds the Database driver and the path and name of the database
    Dim rsCheckUser 'Database Recordset Variable
    Dim strAccessDB 'Holds the Access Database Name
    Dim strSQL 'Database query sring
    Dim strUserName 'Holds the user name

    'Initalise the strUserName variable
    strname = Request.Form("txtUserName")

    'Check the database to see if user exsits and read in there password
    'Initialise the strAccessDB variable with the name of the Access Database
    strAccessDB = "../_mdb-database/utenti"

    'Create a connection odject
    Set adoCon = Server.CreateObject("ADODB.Connection")

    'Database connection info and driver
    strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=*****; DBQ=" & Server.MapPath(strAccessDB)

    'Set an active connection to the Connection object
    adoCon.Open strCon

    'Create a recordset object
    Set rsCheckUser = Server.CreateObject("ADODB.Recordset")

    'Initalise the strSQL variable with an SQL statement to query the database
    strSQL = "SELECT tbl_authors.pass FROM tbl_authors WHERE tbl_authors.id ='" & strUserName & "'"

    'Query the database
    rsCheckUser.Open strSQL, strCon

    'If the recordset finds a record for the username entered then read in the password for the user
    If NOT rsCheckUser.EOF Then

    'Read in the password for the user from the database
    If (Request.Form("txtUserPass")) = rsCheckUser("pass") Then

    'If the password is correct then set the session variable to True
    Session("blnIsUserGood") = True

    'Close Objects before redirecting
    Set adoCon = Nothing
    Set strCon = Nothing
    Set rsCheckUser = Nothing

    'Redirect to the authorised user page and send the users name
    Response.Redirect"authorised_user_page.asp?name=" & strUserName
    End If
    End If

    'Close Objects
    Set adoCon = Nothing
    Set strCon = Nothing
    Set rsCheckUser = Nothing

    'If the script is still running then the user must not be authorised
    Session("blnIsUserGood") = False

    'Redirect to the unautorised user page
    Response.Redirect"unauthorised_user_page.htm"
    %>

  2. #2
    Dicci che errore ti da!

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90
    nessun errore solo http 500

  4. #4
    Prova a disattivare l'opzione "Mostra messaggi di errore HTTP brevi" dal menu "Strumenti" "Opzioni Internet..." "Avanzate" di Internet Explorer poi togli la spunta se c'è dalla voce "Mostra messaggi di errore HTTP brevi" poi vedi che messaggio di errore ti da.
    Potrebbe essere sbagliato il percorso del database.

  5. #5
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90
    fantastico adesso si vede l'errore è

    Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

    [Microsoft][Driver ODBC Microsoft Access] Tipi di dati non corrispondenti nell'espressione criterio.

    /login/check_user.asp, line 33

    dove sbaglio?

  6. #6
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90
    gia che ci sei mi dici come faccio a togliere anche la password dal codice?

    grazie tante

  7. #7
    Spiegati meglio! Da che codice? :master:

  8. #8
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90
    'Database connection info and driver
    strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=*****; DBQ=" & Server.MapPath(strAccessDB)

    intendo da qusto codice ma è un problema successivo prima vorrei capire come mai mi da l'errore che ti ho descritto poco fa
    grazie

  9. #9
    Scusa, ma sto cercando di finire un lavoro urgente e ogni tanto mi assento.
    Comunque devi togliere dall'istruzione: uid=;pwd=*****;
    in questo modo:
    codice:
    strCon = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(strAccessDB)
    Attento però perché così facendo non hai più accesso al database che è protetto da password, quindi devi togliere la password anche dal database.

  10. #10
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    90
    si certo ok
    e per il resto del codice che non funziona?

    quello che ti ho scritto prima con relativo errore

    grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.