Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default date problem using .xls in Access2003 via OLE DB connection

I have a form that asked for the location of an excel workbook, then imports
the
information from three worksheets in the file into three existing tables.
For each worksheet, I make an OLE DB connection to the spreadsheet file and
select preset named ranges in each worksheet, loop through the records and
import only the rows I want using docmd.runsql to do an insert statement.

Each sheet contains dates. I've dim-ed a variable of type date for each
date to be imported. My syntax for assigning the values in each case is:
If Not IsNull(rsXL.Fields(7).Value) Then FollowupDate =
CDate(rsXL.Fields(7).Value)

From one sheet, the dates are imported as date serials (eg: FollowupDate is
38414). From the other two sheets the dates are imported as regular dates
(eg: FollowupDate is 2/2/2005). In the excel spreadsheet, the columns
containing dates are all formatted to be date columns.

How can I force Access/Excel view all dates in a consistent manner? The way
the date is formatted affects the insert sql statement.

I'm using Access 2003 and Excel 2003, tho potentially will also use this to
import Excel2000 and 97 workbooks.

Thanks for your help.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How will I get report in Excel(2003) when my data base is in Access2003 NM2005 Excel Worksheet Functions 2 December 19th 07 09:25 PM
ADODB Connection Problem alpder Excel Programming 3 November 4th 05 09:28 PM
ADO connection problem when using server Bkraska Excel Programming 7 March 18th 05 02:15 PM
Problem with ADO connection fm VB6 to Excel K.K.[_2_] Excel Programming 3 July 20th 04 04:24 AM
Problem with Ado connection fm vb6 to xls K.K.[_2_] Excel Programming 1 July 19th 04 04:29 AM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"