Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does this look infected to you? 1

Status
Not open for further replies.

iamareplicant

Programmer
Aug 7, 2004
50
US
Experts,

I am using ADO (2.6) to insert into an Oracle backend from an Access 2000 module using VBA.

However, I cannot get a date to insert properly, and I have tried formating the date with every combo i can think of.

The date field inside of the oracle table reads '1/1/1920' or some such garbage no matter what I try.

Here is my code snippet with junk values to get an idea of the code I am using:
Code:
...
dim strSQL as string
....

...strSQL = "INSERT INTO tblX(val1, val2) VALUES(1,'1-Dec-2007')

.....

...cmd.execute(strSQL)

I then execute the statement without error (all fields except the date get correctly inserted) but the date in the Oracle table reads goofy.

If I use a pass-thru query to run the identical SQL statement, it works as it should.

In my VBA code, I have tried '1/1/2007', '#1/1/2007#' and every combo of ticks, #'s and different formatted dates, and cannot get the date into the Oracle table...

Help would be appreciated....

TIA,

JBG
 
The ISO 8601 format is supposed to be safe for all db's, but I've never tried Oracle, so I don't know ...

[tt]strSQL = "INSERT INTO tblX(val1, val2) VALUES(1,'2007-01-01')[/tt]

Roy-Vidar
 
Sir, you saved me today. I am under a ton of pressure and this issues is critical and i could not figure it out.

THANK YOU.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top