Accessing MS Access problem.

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

%>
 
E

Eric

Hi Geoff,

From the error code that you are getting, I would suggest that you check
that your hosting company permits you to use MSAccess databases - they may
have prevented "access" (excuse the pun).

Rgds,

Eric
 
J

joeyjoejnr

Hi Geoff,

From the error code that you are getting, I would suggest that you check
that your hosting company permits you to use MSAccess databases - they may
have prevented "access" (excuse the pun).

Rgds,

Eric

hi,

managed to get it sorted in the end. something stupid on my part.
cheers for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top