Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP 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
 
Old June 21st, 2004, 10:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

strQuery2="SELECT ArticleID FROM Articles WHERE ArtLastModifDate='" & f_str_modifdate2 & "'"

'Executing the query
set rsDB2=conDB2.Execute(strQuery2)

As suggested my previous post, you don't seem to use # around the f_str_modifdate2 in your select statement.

Also I would suggest you to do a response.write of your strQuery2 and execute it in MSACCESS directly to see if that is successful, before doing a conDB2.Execute...

And when you want to select records from DB into recordset, always try to use recordsetobject.open method with proper parameters, rather than using connectionobject.execute, which is recommended to use when you insert/update/delete that doesn't rows of data.

strQuery2="SELECT ArticleID FROM Articles WHERE ArtLastModifDate='" &
f_str_modifdate2 & "'"
Response.write strQuery2
Response.End

'Executing the query
rsDB2.open strQuery2

As you are selecting only the ArticleID, which IMO would be an integer or something not of lengthy text, I wonder what you are doing with the code below?

    'Replacing ' with \'
    strResult2=Replace(strResult2,"'","\'")
    if err.number<>0 then
       ErrorHandler (Err.number)
    end if

    'Replacing \n with blank space
    strResult2=Replace(strResult2,chr(10)," ")
    strResult2=Replace(strResult2,chr(13)," ")
    if err.number<>0 then
       ErrorHandler (Err.number)
    end if

Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 21st, 2004, 10:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hold on, I got you the cultprit.

string strQuery2,strResult2

This is what gives you OBJECT REQUIRED error.

That is hard to find you know when you have a general view on the code. Luckily you posted the range of code that had the error in it out of 424 lines.

It should read as

Dim strQuery2,strResult2

as all variables in ASP are variant, so you cannot specifically say it as string, integer, double, etc...

This should take you out of trouble. You can also make the changes that I suggested in previous post.
Cheers!

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Required Error JeffGirard Access 5 October 2nd, 2009 08:09 AM
Object Required error voyeur Javascript 9 January 25th, 2008 11:50 AM
Compile Error: Object required DeannaF829 Beginning VB 6 1 April 24th, 2007 07:12 AM
MSXML Object Required Error??? kevorkian Classic ASP Basics 1 January 5th, 2007 12:43 PM
error....Object required: '' sassenach Classic ASP Databases 2 August 4th, 2003 03:27 PM





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