473,508 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't create ADODB connection on one web page but works on the next web page

I get the following error: Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/myweb4/authorised_user_page.asp, line 70
and line 70 of my code is: <% rsCheckUser1.Open strSQL1,
strcon1 %>

Here is the full code:
%
dim adocon1
dim strcon1
Dim rsCheckUser1 'Database Recordset variable
Dim strAccessDB1 'Holds the Access Database Name
dim strSQL1 'Database query String
Dim strUserName 'Holds the name of the user

'Check the database to see if user exsits and read in
there password
'Initialise the strAccessDB variable with the name of the
Access Database
strAccessDB1 = "users"

'Create a connection odject

set adocon1 = Server.CreateObject("ADODB.Connection")

'Database connection info and driver
strcon1 = "DRIVER={Microsoft Access Driver
(*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath
(strAccessDB1)

'Set an active connection to the Connection object
adocon1.open strcon1

'Create a recordset object
set rsCheckUser1 = Server.CreateObject("ADODB.Recordset")

'If the session variable is False or does not exsist then
redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session
("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>

<html>
<head>
<title>Authorised User</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

'Get the users name passed from the previous page
<% strUserName = Request.QueryString("name") %>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<!--
<table width="518" border="0" cellspacing="0"
cellpadding="0" align="center">
<tr>
<td align="center">
<h1>Authorised Access</h1>
</td>
</tr>
</table>
<div align="center">
<p><br>
Welcome <b>
<% =strUserName %>
</b> to the password proteceted area of the web site.
</p>
<p>&nbsp;</p>
-->

<%

strSQL1 = "select tblresults.userid,
tblresults.date, tblresults.bf, tblresults.proteins,
tblresults.othersolids from tblresults where
tblresults.userid='" & strusername & "'" %>

'Query the database
<% rsCheckUser1.Open strSQL1, strcon1 %>
<p>&nbsp;
<table>
<%do while not rscheckuser1.eof%>
<tr><td><%response.write rscheckuser1
("UserID") %></td></tr>
<tr><td><%response.write rscheckuser1
("Date") %></td></tr>
<tr><td><%response.write rscheckuser1
("BF") %></td></tr>
<tr><td><%response.write rscheckuser1
("Proteins") %></td></tr>
<tr><td><%response.write rscheckuser1
("OtherSolids") %></td></tr>
<tr><td><hr></td></tr>
<%
rscheckuser1.movenext
loop
%>
</table>
</p>
</div>

</body>
</html>
The only thing I am doing is bringing in the username
value from the previous page and using that value to find
all the records and display them on the current web
page. I do not see what is wrong with my code. If
anyone could please help.
Jul 19 '05 #1
1 2436
We got your first post.

Ray at work

<trimmed all>
Jul 19 '05 #2

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

Similar topics

3
2058
by: Ryan Ritten | last post by:
Hey, I just started working at this new company and they gave me a simple database project to start with. yet I am starting to look like an idiot cause I can't even seem to connect to the MS...
4
2720
by: Kathy | last post by:
Hi All, I am using Access 2000. I would like to streamline this code by using a variable for the column name. I have three tables with 255 columns each that I would like to populate with the...
6
4126
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
3
2652
by: Andy G | last post by:
I have some code that hits a DB2 database from my ASP.NET application. I haven't been able to exactly nail it down but my connections are not getting closed for some reason. I look at the...
28
2097
by: Gaby | last post by:
Hi guys, I have this ASP code that is a little long to post so but you can download it off of http://whatthedeuce.net/Form.asp I cant find out what my error is. I know it is not in my Access...
12
10554
by: Matt.W.Stephens | last post by:
Here is the scenario. We have a database with patient case information. This database was previously solely used in Access. The problem is our users connect to this database (located in California)...
4
11322
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
4
4560
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
7
10650
Walt in Decatur
by: Walt in Decatur | last post by:
I'm trying to use this method to copy an range in Excel workbook that is closed to the one that's open. I'm using the following code, which gets the "Can't find installable ISAM" error when I get to...
0
7229
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
7333
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
7398
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...
1
7061
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...
0
7502
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
5637
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,...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
428
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...

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.