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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't update date in Oracle from Access

Status
Not open for further replies.

iamareplicant

Programmer
Aug 7, 2004
50
US
Experts,

I am trying to update a linked Oracled table in my 2003 Access db. For testing, I created a pass-thru query that runs the SQL statement perfectly.

However, when I run the SQL statment from an ADODB command object, the date field in Oracle stores "1/1/1920 5:00 am".

Here is the SQL statement that I am trying to run via ADODB:
Code:
UPDATE EDGE_MAIN.EDGE_COURSE_SECTION  SET  
COURSE_START_DT = '01-Jan-2005',  
COURSE_END_DT = '01-Jan-2005'
WHERE  (COURSE_ID=22) AND  (SPECIALTY_ID = 5) And   (SKILLTRAC_ID = 2) AND  (MODULE_ID = 115)

Here is the ADODB snippet that runs the above SQL statement. Because I am running multiple SQL statements within a transaction, I stored the SQL statements in the array varSQL():

Code:
            cmd.CommandType = adCmdText
            For x = 0 To UBound(varSQL)
              cmd.CommandText = varSQL(x)
              cmd.Execute lngRecsAffected
            Next

To be clear, the SQL statement in the first part of this post is from a pass-thru query that works.

When it is run with the command object, it fails. Several other SQL statements within varSQL() that run before it run fine. I have tried to rearrange the order of the SQL statements that get run via the command object, I have tried to format the date other than "dd-mmm-yyyy" and I am at a loss as how to get an update (or insert) into my linked Oracle table that contains a date.

Any thoughts would be greatly appreciated. I am open for cheap work arounds at this point :)

JBG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top