Salve a tutti,
ho acquistato un dominio che però ha come unica cartella database abilitata in scrittura all'esterno della root del sito.
Vorrei perciò sapere dove è il problema: di seguito scriverò il codice (che per altro ho scaricato da questo sito)che mi da problemi dio connessioni al database! magari dateci un'ochiata e fatemi sapere dove è l'errore:
:::::::CODICE:::::::
<%
If isCommonCreated <> True Then
'Determino il timeout dello script
Server.ScriptTimeout = 90
'Determino le dimensioni delle variabili
Dim StrConnect 'Variabile
Dim cString 'Variabile
Dim adoCon 'Variabile
Dim strSQL 'Variabile
'Setto la variabile per una connessione ADO
Set adoCon = Server.CreateObject("ADODB.Connection")
'------------------------------------------------------------------------------------
'Cambiare il path del database
StrConnect = "Provider = Microsoft.Jet.OLEDB.4.0;
Data Source = c:\domains\MIO_DOMINIO.XX\db\MIO_DATABASE.mdb;
Persist Security Info = False"
'------------------------------------------------------------------------------------
'Stringa per la connessione
'Se la seguente linea non funziona, commentare con ' e scegliere un altra stringa
'cString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strDataBasePath)
'Usa questa stringa se usi Access Database 2000 o 2002
cString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\domains\MIO_DOMINIO.XX\db\MIO_DATABASE.mdb
'Usa questa stringa se usi DSN
'cString = "DSN=NAME_OF_DSN"
'Sostituisci il NAME_OF_DSN con il DSN
adoCon.Open cString
'Richiesta dei valori utente
'Setta the variable to the value in the users cookie
str_userscode = Request.Cookies("Login")("userCode")
'Se l'user code non è vuota allora
IF str_userscode <> "" THEN
'Creo un nuovo record set
Set rsUserLog = Server.CreateObject("ADODB.RecordSet")
'Setta una nuova stringa sql
StrSql="SELECT * FROM tbl_authors WHERE code='" & str_userscode & "';"
'Apro il recordset e eseguo il codice sql
rsUserLog.open StrSql,cString
'Se non ci sono record che accertano l'identita dei dati dai cookies dell'utente
'setta la variabile vuota
If rsUserLog.EOF Then
Response.cookies("Login")("userCode") = ""
'Se non c'è nessun record allora
Else
' Setta i valori del database con le variabili
str_users_name = rsUserLog("name")
str_users_password = rsUserLog("pass")
str_users_nome = rsUserLog("nome")
str_users_cognome = rsUserLog("cognome")
str_users_email = rsUserLog("email")
str_users_citta = rsUserLog("citta")
str_users_provincia = rsUserLog("provincia")
str_users_cap = rsUserLog("cap")
str_users_authority = rsUserLog("authority")
str_users_date = rsUserLog("dataregistrazione")
str_users_code = rsUserLog("code")
str_users_stato = rsUserLog("stato")
str_users_pagina_web = rsUserLog("pagina_web")
str_users_utentesospeso = rsUserLog("utentesospeso")
End If
'Chiudo
rsUserLog.Close
set rsUserLog = Nothing
'Se l'user code è vuoto allora l'utente è guest
Else
Response.cookies("Login")("userCode") = ""
End If
'--------------------------------------------------------------------------------------------
'Creo un nuovo record set
set rsPageAttributes = Server.CreateObject("ADODB.RecordSet")
'Query sql
pageSql = "SELECT * FROM tbl_admin"
'Apro il recordset e eseguo sql
rsPageAttributes.open pageSql,cString
adminEmail = rsPageAttributes("adminEmail")
pageTitle = rsPageAttributes("TitoloSito")
homePage = rsPageAttributes("homePage")
mailServer = rsPageAttributes("mailHost")
tipoMail = rsPageAttributes("tipoMail")
conf_email = rsPageAttributes("conf_email")
'Chiusura
rsPageAttributes.Close
set rsPageAttributes = Nothing
'--------------------------------------------------------------------------------------------
Else
Dim isCommonCreated
isCommonCreated = True
End If
'--------------------------------------------------------------------------------------------
Function GetState(intState)
Select Case intState
Case 0
GetState = "adStateClosed"
Case 1
GetState = "adStateOpen"
End Select
'Sintassi: GetState(adoCon.state)
End Function
'--------------------------------------------------------------------------------------------
%>

Rispondi quotando