Re: HELP with DateAdd statement and SQL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bob Barrows (reb01501_at_NOyahoo.SPAMcom)
Date: 03/01/04


Date: Mon, 1 Mar 2004 04:57:10 -0500

robnson wrote:
> I am trying to pull the date from the day before "objDate =
> DateAdd("d", -1, Date)" in standard time format, and I am wanting to
> convert it into UTC time "dtmCurrentDate = "&objDate&" " then pass it
> into a SQL command " "WHERE [Type]='error' AND
> [TimeWritten]>'&dtmTargetDate&' ". The script works however it isn't
> passing the date and coverting into UTC. Can someone please help me
> with this? Below you will find my script.
>

What is the datatype of the TimeWritten column? If it is datetime, you are
making a mistake by passing the the time in UTC format.

> Conn.Open = "provider=sqloledb;data source=SCK-EAV-01;" & _
> "user id=sa;password=justD0!t;" & _

Gasp! You have two major security problems here:
1. Using the sa account for applications is a major gaffe. You should create
a login with the minimum permissions required to perform the tasks required
for your application and use that account.
2. The first gaffe is relatively minor compared to this one: You just
revealed your server's sa password to the internet!!! Protect your server's
sa account as if your job depended on it (it probably does). Go change that
password now!

Bob Barrows

-- 
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Relevant Pages

  • he should lay wildly if Henrys spread isnt deep
    ... Nowadays, valleys happen with legitimate ballets, unless they're efficient. ... To be passing or frightened will start informal memorandums to weakly commence. ... What will you account the rare integral emergencys before Hamid does? ...
    (sci.crypt)
  • Re: Southern Water...grrrr
    ... result I ended up with them passing 'my' account over to a debt ... account to a debt collectors being one of them. ... merging data earlier this year. ...
    (uk.local.kent)
  • Winter Solstice
    ... I haven't noticed any remarks on the passing of the Winter Solstice ... which, if my information is correct, occured yesterday at 09.00 UTC. ...
    (uk.sci.weather)
  • Im not REALLY a newbie, but.......
    ... suffice to say it's just a simple bank account example type thing. ... call the swap method which looks like this: (to avoid pasting html I've had ... But I'm passing pointers, so why is it acting like I'm passing by value? ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Im not REALLY a newbie, but.......
    ... suffice to say it's just a simple bank account example type thing. ... > CBankAccount acc1; ... > But I'm passing pointers, so why is it acting like I'm passing by value? ...
    (alt.comp.lang.learn.c-cpp)