473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Accessing MS Access problem.

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

%>

Apr 12 '07 #1
2 2025
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

"ge*********@gmail.com" wrote:
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

%>

Apr 18 '07 #2
On Apr 18, 10:38 am, Eric <E...@discussions.microsoft.comwrote:
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

"geoff.ag...@gmail.com" wrote:
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
%>
hi,

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

Apr 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the...
1
by: Z0gS | last post by:
I got this problem for the web application I try to access files on a remote server. string dirs = Directory.GetDirectories(@"E:\vehicles") E drive is a map to a network drive. I get the...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
3
by: kosmodisk | last post by:
Hi, I'm having problem accessing javascript-created elements from opened window. This occurs only when I'm including another files in opened window, javascript or css. When I comment out...
3
by: Nathan Sokalski | last post by:
I have a validator that I wrote by inheriting from BaseValidator. At certain points in the code, I need to access other controls on the page containing the validator. I have the IDs of these...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.