Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Re: Active Server Pages, ASP 0113 (0x80004005)


Message #1 by "John Kelly" <_jjy_@y...> on Thu, 7 Mar 2002 09:16:32
I am using a simple SQL statement, but it's giving me the error also.



SELECT col1, col2, col3, col4, col5, col6, col7 FROM mytable where DATEDIFF

(day, today, getdate()) = 0



What am I missing here ?

Thanks.



> Here's a hint before I look at your code...

> 

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> : CONST SELECT_NEWS= "SELECT NEWS.NEWS_EMAIL, NEWS.NEWS_TYPE,

> : NEWS.NEWS_LANGUAGE FROM NEWS;"

> :

> : objCommand.CommandText= SELECT_NEWS

> : Set objRS= objCommand.Execute

> :

> : Dim emailExists

> : emailExists= False

> :

> : While Not objRS.EOF AND Not emailExists

> : If objRS("NEWS_EMAIL") = strEmail Then

> : emailExists= True

> : End If

> : Wend

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> 

> is pretty painful. Try to keep in mind that databases work in sets, not 

in

> cursors.

> How about attempting to return a set of data that matches your criteria, 

and

> seeing if that set exists?

> 

> <%

> strSQL = _

>     "SELECT a.News_Email, a.News_Type, a.News_Languages " & _

>     "FROM News a" & _

>     "WHERE a.News_Email = '" & strEmail & "'"

> 

> objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText

> 

> If objRS.EOF then

>     ' There is no match

> Else

>     ' There is a match

> End If

> 

> objRS.Close

> Set objRS = Nothing

> 

> objConn.Close

> Set objConn = Nothing

> %>

> 

> Cheers

> Ken

> 

> 

Message #2 by "Ken Schaefer" <ken@a...> on Fri, 8 Mar 2002 12:07:05 +1100
Firstly, what's you error?!?



Secondly, did you look up the parameters for DateDiff() in your VBScript

docs? Day is not a valid parameter (though it is in SQL Server). GetDate()

isn't a built in Access function either (but it is in SQL Server).



If you're using SQL Server, then this the wrong list to be asking. If you're

using Access, check your documentation please. If you want more help, please

post your error message.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "John Kelly" <_jjy_@y...>

Subject: [access_asp] Re: Active Server Pages, ASP 0113 (0x80004005)





: I am using a simple SQL statement, but it's giving me the error also.

:

: SELECT col1, col2, col3, col4, col5, col6, col7 FROM mytable where

DATEDIFF

: (day, today, getdate()) = 0

:

: What am I missing here ?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index