473,809 Members | 2,908 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.Op en 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.CreateOb ject("ADODB.Con nection")

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

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

'Create a recordset object
set rsCheckUser1 = Server.CreateOb ject("ADODB.Rec ordset")

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

<html>
<head>
<title>Authoris ed 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.QuerySt ring("name") %>
</head>

<body bgcolor="#FFFFF F" text="#000000">
<!--
<table width="518" border="0" cellspacing="0"
cellpadding="0" align="center">
<tr>
<td align="center">
<h1>Authorise d 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.user id,
tblresults.date , tblresults.bf, tblresults.prot eins,
tblresults.othe rsolids from tblresults where
tblresults.user id='" & strusername & "'" %>

'Query the database
<% rsCheckUser1.Op en strSQL1, strcon1 %>
<p>&nbsp;
<table>
<%do while not rscheckuser1.eo f%>
<tr><td><%respo nse.write rscheckuser1
("UserID") %></td></tr>
<tr><td><%respo nse.write rscheckuser1
("Date") %></td></tr>
<tr><td><%respo nse.write rscheckuser1
("BF") %></td></tr>
<tr><td><%respo nse.write rscheckuser1
("Proteins") %></td></tr>
<tr><td><%respo nse.write rscheckuser1
("OtherSolid s") %></td></tr>
<tr><td><hr></td></tr>
<%
rscheckuser1.mo venext
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 2446
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
2069
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 Access DB with ASP. I already went into Data Sources (ODBC) with windows Control panel and set up a DSN. I don't think that is the problem. I am no expert at all at asp...
4
2736
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 data from one table that has 1 column. Each of the three tables will each up with 1 record with 255 columns. This is the code I wrote (in brief) to demonstare whate I want to do. Is there an easier way? I don't really want to type 500 lines of code...
6
4143
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 had to manually install all of the ODBC drivers and the rest of the DLL's, and now I am getting "Access is Denied" errors on any page that uses ADODB. How do I fix it? I already gave the ODBC drivers in the folders in "c:\program files\common...
3
2674
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 database and it's like everytime I click a button in the ASP.NET applicaiton and it runs a database command it leaves the connection open. The DBA's are not happy with me right now. Luckily I'm still in test. Does anyone have any idea why the below...
28
2127
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 because I have tested my query and it works fine. but whenever i try to submit from the page the imformation doesnt go thorugh. on a side note, if i hit refresh it tells me it cannot refresh without sending the information. i dont know if this...
12
10621
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) from locations across a large network. California to Virginia. Naturally the east coast locations were running very slow. We decided to migrate to an Access front end with an SQL backend. The database contains several forms with multiple...
4
11339
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. Thanks in advance.
4
4593
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 reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
7
10672
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 the line "cnt.Open". My Windows files (various .dll) are up to date, so there is some other hitch in there. Sub Get_Data_Closed_Workbooks() Dim cnt As ADODB.Connection Dim cmd As ADODB.Command Dim stCon As String, stSQL As String...
0
9721
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
10376
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
10375
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
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4331
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
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.