PC Review


Reply
Thread Tools Rate Thread

Extracting Excel Data into New Access Tables

 
 
jeff
Guest
Posts: n/a
 
      14th Jun 2006
Hi gurus (sorry for the cross post...wanting to hit the best advice),

I am using some sql statements to pull data from Excel into new Access
tables as per the following example:-

mQry = "SELECT * INTO TempImportDataCL FROM [Excel
8.0;HDR=Yes;DATABASE=C:\Project\CableListData.xls].[CableList$];"
mDb.Execute mQry, dbFailOnError

Which works fine BUT columns which have only numbers in them are being
created as DataType NUMBER whereas in Excel the column is defined as TEXT. I
actually want the Access table Fields to be all TEXT datatype. Can this be
done using the above?

I am planning on changing the resultant NUMBER fields to TEXT fields after
creating the table/data but dont want to hit any snags.

Any help will be appreciated

cheers
Jeff


 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      14th Jun 2006
Hi,
try to create TempImportDataCL with required field types and then use Insert
Into query

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"jeff" <jeff@work> wrote in message
news:(E-Mail Removed)...
> Hi gurus (sorry for the cross post...wanting to hit the best advice),
>
> I am using some sql statements to pull data from Excel into new Access
> tables as per the following example:-
>
> mQry = "SELECT * INTO TempImportDataCL FROM [Excel
> 8.0;HDR=Yes;DATABASE=C:\Project\CableListData.xls].[CableList$];"
> mDb.Execute mQry, dbFailOnError
>
> Which works fine BUT columns which have only numbers in them are being
> created as DataType NUMBER whereas in Excel the column is defined as TEXT.
> I actually want the Access table Fields to be all TEXT datatype. Can this
> be done using the above?
>
> I am planning on changing the resultant NUMBER fields to TEXT fields after
> creating the table/data but dont want to hit any snags.
>
> Any help will be appreciated
>
> cheers
> Jeff
>


 
Reply With Quote
 
 
 
 
jeff
Guest
Posts: n/a
 
      23rd Jun 2006
Alex

Thanks for the reply, unfortunately I got re-assigned temporarily to another
job and only now got back to this one and read your comment.

I dont know the columns at the time the data is imported from Excel, so if I
have to create the table manually instead of the leaving it to the Make
table query, then I guess i would have to retrieve a NULL recordset and run
thru the excel recordset field definitions creating the internal table/field
definitions? I presume this will work...I will give it a go!

cheers
Jeff


"Alex Dybenko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
> try to create TempImportDataCL with required field types and then use
> Insert Into query
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://alexdyb.blogspot.com
> http://www.PointLtd.com
>
> "jeff" <jeff@work> wrote in message
> news:(E-Mail Removed)...
>> Hi gurus (sorry for the cross post...wanting to hit the best advice),
>>
>> I am using some sql statements to pull data from Excel into new Access
>> tables as per the following example:-
>>
>> mQry = "SELECT * INTO TempImportDataCL FROM [Excel
>> 8.0;HDR=Yes;DATABASE=C:\Project\CableListData.xls].[CableList$];"
>> mDb.Execute mQry, dbFailOnError
>>
>> Which works fine BUT columns which have only numbers in them are being
>> created as DataType NUMBER whereas in Excel the column is defined as
>> TEXT. I actually want the Access table Fields to be all TEXT datatype.
>> Can this be done using the above?
>>
>> I am planning on changing the resultant NUMBER fields to TEXT fields
>> after creating the table/data but dont want to hit any snags.
>>
>> Any help will be appreciated
>>
>> cheers
>> Jeff
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting specific Excel data into word =?Utf-8?B?Tmljb2xlIEtuYXBw?= Microsoft Word Document Management 3 12th Jul 2007 10:18 PM
Extracting/Exporting HTML Tables or PDF Tables into Excel master.investor.2005@gmail.com Microsoft Excel Programming 3 25th Jul 2006 09:57 AM
Exporting/Extracting HTML or PDF Tables into Excel master.investor.2005@gmail.com Microsoft Excel Discussion 1 11th Jul 2006 01:44 AM
Extracting Excel Data into New Access Tables jeff Microsoft Access Form Coding 3 27th Jun 2006 02:51 PM
Access 2000 extracting data from tables Ernie Microsoft Access External Data 3 26th Jul 2004 05:47 AM


Features
 

Advertising
 

Newsgroups
 


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