ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CopyfromRecordset (https://www.excelbanter.com/excel-programming/356066-copyfromrecordset.html)

MattShoreson[_67_]

CopyfromRecordset
 

I have a workbook containing data. The first column has a reference
number.
The data in this column is of mixed type.

Example entries are B0BJ6Q3 and 4477785. The first 70 odd rows are text
and then they change to numeric. I believe that the ado recordset
assigns a datatype based on the first few rows.

However, why wont it insert the numeric as a text? It's driving me
nuts.
I get a perfect recordset apart from row 70 in the first column.

I've tried formatting in the original file the first column as text,
but to no avail.

Anyone got any good ideas?
Cheers,
Matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=522591


Tom Ogilvy

CopyfromRecordset
 
http://www.dicks-blog.com/archives/2...ed-data-types/

and

http://support.microsoft.com/default...b;en-us;257819
How To Use ADO with Excel Data from Visual Basic or VBA

--
Regards,
Tom Ogilvy


"MattShoreson" wrote:


I have a workbook containing data. The first column has a reference
number.
The data in this column is of mixed type.

Example entries are B0BJ6Q3 and 4477785. The first 70 odd rows are text
and then they change to numeric. I believe that the ado recordset
assigns a datatype based on the first few rows.

However, why wont it insert the numeric as a text? It's driving me
nuts.
I get a perfect recordset apart from row 70 in the first column.

I've tried formatting in the original file the first column as text,
but to no avail.

Anyone got any good ideas?
Cheers,
Matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=522591



MattShoreson[_69_]

CopyfromRecordset
 

cheers tom, much app.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=522591



All times are GMT +1. The time now is 09:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com