473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Import from excell

65
Hi,

I've got these files in excell that need to be imported to access. Now I've got one file, and when I try to import it, it acts weird. There are two fields in the excell fiile (Start, Stop) that are dates. When I have done my import the dates change to some number for some reason. 19/02/2007 changes into 39132. I've got an idea why it is done (dates are stored as long in access) but I got no idea how to get around this. This only happens to that format of date that needs to be imported. When I got a full date with time and all it acts normal.

Could anybody help me with this??

Greetz
Twanne

The trees don't fall far from the apple.
Sep 13 '07 #1
2 1616
Twanne
65
Owkay, never mind this. Apparently when you have something in a field you want to import from excell you cant let other (like plain text or in my case " - - ") values than the standard in the field. Access wil try to interpret this it's own way and screw up your data.

Greetz
Twanne

Throw the apple far enough.
Sep 13 '07 #2
If you import from Acccess with the option in the Access menu, my answer will not help you.
I import using programs (VB 2005 specifically). The basic idea is:

Dim AppExcel As Excel.Application
AppExcel = New Excel.Application
AppExcel.Visible = False

Try
AppExcel.Workbooks.Open(Filename:=sFileName)
Catch ex As Exception
MessageBox.Show("Unable to open file: " + sFileName, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
End Try

Dim sCell, sTitle As String
Dim objTitle As Object
Dim iRow As Integer
iRow = 2
Do
sCell = "B" + CStr(iRow)
AppExcel.Range(sCell).Select()
objTitle = AppExcel.Selection.Value

On the object, or variant, you can do the validations that you want

If objTitle Is Nothing Then Exit Do
sTitle = Trim(CStr(objTitle))
If sTitle = "" Then Exit Do
sCell = "A" + CStr(iRow)
AppExcel.Range(sCell).Select()

Here prepare and execute an INSERT command

iRow = iRow + 1
Loop
AppExcel.Workbooks.Close()

AppExcel.Quit()
Sep 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: daniroy | last post by:
Hello everybody, your help will be very very welcome on a very classic question... I have some Excell Macro background, a little bit of VBA knowledge. I import daily from Internet series of...
8
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a...
2
by: Robert Halstead | last post by:
Hi guys, I have a asp.net web app and it's connecting to an excell 2003 document (in another folder) via OleDataAdapter. Everything works and all, it's just that when I shutdown IE and try to...
0
by: Delforce | last post by:
Hi all, My application allows you to create a new excel file and then double click it in the list view to start it in excell. If the excell file is an existing one then I can start it now...
2
by: glibo | last post by:
I am trying to change the tab name when i open a excell spread sheet on the run time in c#. I changed it in the code: Response.AddHeader("content-disposition","filename=" + sFileName + ".xls");...
7
nehashri
by: nehashri | last post by:
hello i have my data stored in different Ms Excell sheets. now I am planning to make a database of the data i have. but i m confused whether to use Postgresql or mySQL for the same. i had plans to...
2
by: TMINGO | last post by:
Can you give me steps on how to import a table from excell to acess
1
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m creating a database. The data for database will fetched from an excell sheet. Now how can i read an excell sheet and update my database with that excell sheet. Or I want to show...
2
by: kkshansid | last post by:
cannot import table in mysql 1i saved my excell file in csv formate 2i made a data base in mysql 3i made a table with 5 fields 4i run this file error Parse error: syntax error, unexpected...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.