473,796 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.in c" -->
<%

'---------------------------------------------------------------------------
' Global Variables
'---------------------------------------------------------------------------

Dim cnnProject, cnnProjectUpdat e

'---------------------------------------------------------------------------
' Open Database
'---------------------------------------------------------------------------

Function OpenDatabase()
Set cnnProject = Server.CreateOb ject("ADODB.Con nection")
cnnProject.Conn ectionTimeout = 5
cnnProject.Comm andTimeout = 30
cnnProject.Open DB_PROJECTS_CON N_STRING
'Server.CreateO bject("ADODB.Co nnection").Open
"DBQ="&Server.M apPath("databas e/ets.mdb")&"; Driver={Microso ft Access
Driver (*.mdb)};"
End Function

'---------------------------------------------------------------------------
' Close Database
'---------------------------------------------------------------------------

Function CloseDatabase()
cnnProject.Clos e
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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject

If Not rsUsers.EOF Then
strPassword = rsUsers("Passwo rd")
End if

rsUsers.Close
Set rsUsers = Nothing

GetUserPassword = strPassword
End function

'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------

Function GetUserEmailAdd ress(strUserID)
Dim cnnLogin, rsUsers
Dim strEmailAddress

strEmailAddress = ""

' Create RS and query DB for quiz info
Set rsUsers = Server.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject

If Not rsUsers.EOF Then
strEmailAddress = rsUsers("Email_ Address")
End if

rsUsers.Close
Set rsUsers = Nothing

GetUserEmailAdd ress = 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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&login& ";",
cnnProject

If rsUsers("LogTyp e")="Admin" Then
Response.Redire ct("Logout.asp" )
End if

rsUsers.Close
Set rsUsers = Nothing
End function

%>

Apr 12 '07 #1
2 2039
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*********@gm ail.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.in c" -->
<%

'---------------------------------------------------------------------------
' Global Variables
'---------------------------------------------------------------------------

Dim cnnProject, cnnProjectUpdat e

'---------------------------------------------------------------------------
' Open Database
'---------------------------------------------------------------------------

Function OpenDatabase()
Set cnnProject = Server.CreateOb ject("ADODB.Con nection")
cnnProject.Conn ectionTimeout = 5
cnnProject.Comm andTimeout = 30
cnnProject.Open DB_PROJECTS_CON N_STRING
'Server.CreateO bject("ADODB.Co nnection").Open
"DBQ="&Server.M apPath("databas e/ets.mdb")&"; Driver={Microso ft Access
Driver (*.mdb)};"
End Function

'---------------------------------------------------------------------------
' Close Database
'---------------------------------------------------------------------------

Function CloseDatabase()
cnnProject.Clos e
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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject

If Not rsUsers.EOF Then
strPassword = rsUsers("Passwo rd")
End if

rsUsers.Close
Set rsUsers = Nothing

GetUserPassword = strPassword
End function

'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------

Function GetUserEmailAdd ress(strUserID)
Dim cnnLogin, rsUsers
Dim strEmailAddress

strEmailAddress = ""

' Create RS and query DB for quiz info
Set rsUsers = Server.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject

If Not rsUsers.EOF Then
strEmailAddress = rsUsers("Email_ Address")
End if

rsUsers.Close
Set rsUsers = Nothing

GetUserEmailAdd ress = 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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&login& ";",
cnnProject

If rsUsers("LogTyp e")="Admin" Then
Response.Redire ct("Logout.asp" )
End if

rsUsers.Close
Set rsUsers = Nothing
End function

%>

Apr 18 '07 #2
On Apr 18, 10:38 am, Eric <E...@discussio ns.microsoft.co mwrote:
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...@gm ail.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.in c" -->
<%
'---------------------------------------------------------------------------
' Global Variables
'---------------------------------------------------------------------------
Dim cnnProject, cnnProjectUpdat e
'---------------------------------------------------------------------------
' Open Database
'---------------------------------------------------------------------------
Function OpenDatabase()
Set cnnProject = Server.CreateOb ject("ADODB.Con nection")
cnnProject.Conn ectionTimeout = 5
cnnProject.Comm andTimeout = 30
cnnProject.Open DB_PROJECTS_CON N_STRING
'Server.CreateO bject("ADODB.Co nnection").Open
"DBQ="&Server.M apPath("databas e/ets.mdb")&"; Driver={Microso ft Access
Driver (*.mdb)};"
End Function
'---------------------------------------------------------------------------
' Close Database
'---------------------------------------------------------------------------
Function CloseDatabase()
cnnProject.Clos e
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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject
If Not rsUsers.EOF Then
strPassword = rsUsers("Passwo rd")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserPassword = strPassword
End function
'---------------------------------------------------------------------------
' Get User Password
'---------------------------------------------------------------------------
Function GetUserEmailAdd ress(strUserID)
Dim cnnLogin, rsUsers
Dim strEmailAddress
strEmailAddress = ""
' Create RS and query DB for quiz info
Set rsUsers = Server.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&strUse rID&";",
cnnProject
If Not rsUsers.EOF Then
strEmailAddress = rsUsers("Email_ Address")
End if
rsUsers.Close
Set rsUsers = Nothing
GetUserEmailAdd ress = 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.CreateOb ject("ADODB.Rec ordset")
rsUsers.Open "SELECT * FROM Login WHERE TeamId="&login& ";",
cnnProject
If rsUsers("LogTyp e")="Admin" Then
Response.Redire ct("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
2911
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 same NT domain, each one has its own web server. The web server is always IIS 5.0.
1
4625
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 DirectoryNotFoundException. How do I solve the problem or the is another way to write the code Thank yo
1
3142
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 elements and would like to seek a solution for this. I had looked through several articles for accessing programatically-created dynamic elements such as: 1)
4
3783
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 testing purposes, the secure place is setup on the client machine. The client (window app) calls the web service (on a different machine) and connects successfully to the web service. However, when client calls a method that copies the file from...
3
5006
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 : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
4
3641
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 possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
3
2119
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 "<link>" and "<script>" (point (0)), the script works fine. The opening window itself (point (1)) can access the object. When page has been loaded, then I can access the object also (point (3)). The script does find included files (debug_test2.css and...
3
1574
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 controls, so I use the following statement to access them: Me.Page.FindControl(ControlID) However, this is returning Nothing, even though the control can be accessed in the Load event of the Page containing the control and the validator. I also...
8
10844
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 steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
4
4470
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 this exception: System.Net.WebException: The request failed with HTTP status 407: Proxy Authentication Required. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream...
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.