G
geoff.agnew
Hi,
I'm doing a web based tracking system for exam questions. Using ASP
with VBScript to link the database. I have the main log in screen
working but when i enter the log in details i get this error:
- Error Type
Provider (0x80004005)
Unspecified error
/ets/functions.asp, line 20
my functions.asp file looks like below. I am a total beginner with ASP
and VBScript by the way, any help would be awesome. cheers
<!-- #INCLUDE FILE="adovbs.inc" -->
<%
'---------------------------------------------------------------------------
' Global Variables
'---------------------------------------------------------------------------
Dim cnnProject, cnnProjectUpdate
'---------------------------------------------------------------------------
' Open Database
'---------------------------------------------------------------------------
Function OpenDatabase()
Set cnnProject = Server.CreateObject("ADODB.Connection")
cnnProject.ConnectionTimeout = 5
cnnProject.CommandTimeout = 30
cnnProject.Open DB_PROJECTS_CONN_STRING
'Server.CreateObject("ADODB.Connection").Open
"DBQ="&Server.MapPath("database/ets.mdb")&"; Driver={Microsoft Access
Driver (*.mdb)};"
End Function
'---------------------------------------------------------------------------
' Close Database
'---------------------------------------------------------------------------
Function CloseDatabase()
cnnProject.Close
Set cnnProject = Nothing
End Function
'---------------------------------------------------------------------------
' Get User ID
'---------------------------------------------------------------------------
Function GetUserID()
GetUserID = Session("UserID")
End function
'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------
Function GetUserPassword(strUserID)
Dim cnnLogin, rsUsers
Dim strPassword
strPassword = ""
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUserID&";",
cnnProject
If Not rsUsers.EOF Then
strPassword = rsUsers("Password")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserPassword = strPassword
End function
'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------
Function GetUserEmailAddress(strUserID)
Dim cnnLogin, rsUsers
Dim strEmailAddress
strEmailAddress = ""
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUserID&";",
cnnProject
If Not rsUsers.EOF Then
strEmailAddress = rsUsers("Email_Address")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserEmailAddress = strEmailAddress
End function
'---------------------------------------------------------------------------
' If the user is admin - logout
'---------------------------------------------------------------------------
Function isAdmin(login)
Dim rsUsers
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&login&";",
cnnProject
If rsUsers("LogType")="Admin" Then
Response.Redirect("Logout.asp")
End if
rsUsers.Close
Set rsUsers = Nothing
End function
%>
I'm doing a web based tracking system for exam questions. Using ASP
with VBScript to link the database. I have the main log in screen
working but when i enter the log in details i get this error:
- Error Type
Provider (0x80004005)
Unspecified error
/ets/functions.asp, line 20
my functions.asp file looks like below. I am a total beginner with ASP
and VBScript by the way, any help would be awesome. cheers
<!-- #INCLUDE FILE="adovbs.inc" -->
<%
'---------------------------------------------------------------------------
' Global Variables
'---------------------------------------------------------------------------
Dim cnnProject, cnnProjectUpdate
'---------------------------------------------------------------------------
' Open Database
'---------------------------------------------------------------------------
Function OpenDatabase()
Set cnnProject = Server.CreateObject("ADODB.Connection")
cnnProject.ConnectionTimeout = 5
cnnProject.CommandTimeout = 30
cnnProject.Open DB_PROJECTS_CONN_STRING
'Server.CreateObject("ADODB.Connection").Open
"DBQ="&Server.MapPath("database/ets.mdb")&"; Driver={Microsoft Access
Driver (*.mdb)};"
End Function
'---------------------------------------------------------------------------
' Close Database
'---------------------------------------------------------------------------
Function CloseDatabase()
cnnProject.Close
Set cnnProject = Nothing
End Function
'---------------------------------------------------------------------------
' Get User ID
'---------------------------------------------------------------------------
Function GetUserID()
GetUserID = Session("UserID")
End function
'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------
Function GetUserPassword(strUserID)
Dim cnnLogin, rsUsers
Dim strPassword
strPassword = ""
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUserID&";",
cnnProject
If Not rsUsers.EOF Then
strPassword = rsUsers("Password")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserPassword = strPassword
End function
'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------
Function GetUserEmailAddress(strUserID)
Dim cnnLogin, rsUsers
Dim strEmailAddress
strEmailAddress = ""
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUserID&";",
cnnProject
If Not rsUsers.EOF Then
strEmailAddress = rsUsers("Email_Address")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserEmailAddress = strEmailAddress
End function
'---------------------------------------------------------------------------
' If the user is admin - logout
'---------------------------------------------------------------------------
Function isAdmin(login)
Dim rsUsers
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&login&";",
cnnProject
If rsUsers("LogType")="Admin" Then
Response.Redirect("Logout.asp")
End if
rsUsers.Close
Set rsUsers = Nothing
End function
%>