Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 11th, 2004, 08:29 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to jmurrayhead
Default Problem with my database query

I receive this message when my page loads:

Code:
Microsoft VBScript runtime error '800a01a8' 

Object required: '' 

/testdata.asp, line 18
This is the script:
Code:
<% 
dim objRS 
dim strSQL 
Set oConn=Server.CreateObject("ADODB.Connection") 
filePath = Server.MapPath("mydatabase.mdb") 
oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\myroot\fpdb\mydatabase.mdb") 

set objRS = oConn.execute(strSQL) 
%> 
<% 
strSQL = strSQL & " WHERE UserName = '" & Session(appName & "UserName")& "'" 
%>
Any ideas as to what may be wrong..please let me know!! Thanks!!!!
  #2 (permalink)  
Old March 12th, 2004, 01:39 AM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please try:

<%
dim objRS
dim strSQL
Set oConn=Server.CreateObject("ADODB.Connection")
Set objRS=Server.CreateObject("ADODB.Recordset")

oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mydatabase.mdb"))

'...
%>

  #3 (permalink)  
Old March 12th, 2004, 03:48 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What is line 18?

Do you have Option Explicit at the top of your page?
If so, you should declare the variable oConn with a Dim oConn statement. In fact, it's pretty good practice to do that anyway.....

Otherwise, post some more information and/or code.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
database query problem naveed77 Beginning VB 6 2 February 12th, 2008 06:47 AM
database related query dkvaseeta Pro VB Databases 2 February 22nd, 2007 10:59 AM
Database Query Question kbuska BOOK: Beginning ASP 3.0 4 September 23rd, 2004 11:04 PM
Database access from java, INSERT query problem nitusincog BOOK: Beginning Java 2 1 July 21st, 2003 10:26 AM
database query Darren JSP Basics 0 July 12th, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.