[AccessD] ADO Problem

Beach Access Software bchacc at san.rr.com
Wed Nov 29 00:32:28 CST 2006


A.D.:

It seems that the apostrophe solved the problem and that the # didn't work.
Do you think it will work in conjunction with Format?

Regards,

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.TEJPAL
Sent: Tuesday, November 28, 2006 9:29 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] ADO Problem


Rocky,

    You might recall the thread "Date Comparison Problem" initiated by you
in march-2006. It elicited the overall consensus that in order to avoid any
possible pitfalls on account of various regional settings (that might differ
from US date format), any date variable to be concatenated into a VBA string
should first be preformatted to "mm/dd/yyyy" format.

    Accordingly, the following syntax should ideally be adopted:

    "INSERT INTO tWeeklyUpdateSent " & _
    "(DateSent) VALUES (#" & _
    Format(dtToday, "mm/dd/yyyy") & "#);"

Best wishes,
A.D.Tejpal
---------------

  ----- Original Message ----- 
  From: Beach Access Software 
  To: 'Access Developers discussion and problem solving' 
  Sent: Tuesday, November 28, 2006 23:45
  Subject: [AccessD] ADO Problem


  Dear List:

  A colleague (who thinks I know ADO) writes in to ask why the following:

  Conn.Execute "INSERT INTO tWeeklyUpdateSent ( DateSent ) " & _
  "SELECT " & dtToday & ""

  Inserts a record into tWeeklyUpdateSent so the conection is OK.  But but
the date is 1/1/1900 instead of today's date.

  I had him check the contents of dtToday and it does indeed have 11/28/2006
in it.

  Does anyone see what he's doing wrong here?

  MTIA

  Rocky
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.19/556 - Release Date: 11/28/2006
3:22 PM
 




More information about the AccessD mailing list