+ Reply to Thread
Results 1 to 4 of 4

How does Access via ADODB treat different Excel formats?

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    How does Access via ADODB treat different Excel formats?

    If I open up a connection to Access with ADODB from an Excel file, the formats seem to become somewhat inconsistent.

    For example, I have a column in Excel that contains integers, with some formatted as text and others formatted as numbers. However, if I do a simple "Select *" query using Access and then copy the recordset back into Excel, the ENTIRE column will have been changed to either text OR numbers. The strangest part is that I can't find any reason why it goes to one or the other. If the first 4 out of 15 values are formatted as text and the rest are numbers, it would convert all values to text. However, if the first 3 are formatted as text, the 4th is a number, the 5th is text, and the rest are numbers, it will convert all 15 values to numbers. This seems really incosistent to me and I have no idea what its basing the conversion off of.

    I can fix this by using an IIF and CStr function but I would really like to know if anyone has a clue about this first.

    Thanks!
    Last edited by dmasters4919; 01-29-2015 at 11:02 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How does Access via ADODB treat different Excel formats?

    Excel is "Free for all" package which means you can do dump up any form of data to anywhere. Databases, however, have some constraints and restriction on the type of data you can include as value. If a column type is an integer, all values on that column should be integers.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: How does Access via ADODB treat different Excel formats?

    Have a read here:
    http://www.connectionstrings.com/excel-2007/

  4. #4
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: How does Access via ADODB treat different Excel formats?

    Thank you this does make it clearer

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA/ADODB How to change/update value in access database
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 05:23 AM
  2. Access Query via Excel (ADODB) - no error, but no output!
    By cml111 in forum Access Tables & Databases
    Replies: 3
    Last Post: 04-23-2013, 05:33 AM
  3. Updating a record that exists in access database using ADODB
    By ixgunxi in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 10-11-2012, 03:33 PM
  4. Cannot Use ADODB.Connection to connect to an access database
    By Cardinalbags in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2012, 07:09 PM
  5. [SOLVED] access database (adodb)from excel vba
    By AskExcel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-16-2006, 09:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1