Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2005, 07:34 AM
Authorized User
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Type Conversion Failure" when using TransferSprea

Hi! I'm trying to import an Excel sheet file into an Access table using Docmd.TransferSpreadsheet method. The big issue is that I always receive an error when importing and a "TableName$_ImportErrors" table is created. This table contains 3 fields (Error, Field, Row). In error field I have a "Type Conversion Failure". It seems that Access reads the content of the first cell from a column of the Excel table and if a numeric value is found , then he can't handle any value, on that column below, which is not a number.
In the example below,importing process will work for column 1&3, but will fail on column2, at X67. Thanks for any solution/workaround.


220 63 ZT
x209 67 ZF
134 X67 ZM



 
Old November 4th, 2005, 04:47 PM
Authorized User
 
Join Date: Sep 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you tried creating a Link to the Excel File, and then looking to see what Access does to field definition types, and then dumping into another 'internal' Access Table?



Database Agreements
 
Old November 4th, 2005, 07:03 PM
Authorized User
 
Join Date: Sep 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm.
Now that I look at this again, I think that Access is putting a field in the Excel File, which is expected to be a number for the first column, and trying to put it into a Number column.]
However, when there's an alpha char, it dies, rightly so, since it wants you to be specific about what you want to do with the data.
Hence, define the column as a text field in the Access table you are dumping data too.



Database Agreements





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from type 'DBNull' to type 'String' is GailCG ASP.NET 2.0 Basics 5 February 22nd, 2007 03:12 PM
Conversion from type 'DBNull' to type 'Boolean' is steve35719 VB Databases Basics 4 June 29th, 2006 06:13 PM
Re: type conversion fail, need help!! flyfish Access 4 December 21st, 2004 10:31 AM
Help with data type conversion please androoo Pro VB.NET 2002/2003 0 November 29th, 2004 09:06 AM
Data Type Conversion owain SQL Language 5 October 31st, 2003 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.