LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default How to read from a SQL Server table into Excel and use the Excel cell format as in the database

Hello All

I am reading data from a SQL Server table using ADO and as I read the
recordset I place each recordset field into a Excel cell. But
sometimes when I read a field in the SQL Server which is of type
nvarchar the data in the SQL table is
as follows:

000003710
000003720

but in Excel this is displayed by my ADO read program with the leading
zeros chopped as follows:

3710
3720

how can I set the Excel cell format programmatically based on the data
type of the SQL table field please advise.

Thanks
Belinda
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file change to 'read-only' when copied to another server lcw11130 Excel Discussion (Misc queries) 1 April 16th 06 06:26 AM
Retrieving data from database (MS Sql Server) to Excel nwhan Excel Discussion (Misc queries) 0 July 22nd 05 09:35 AM
SQL Server UPDATE Database from Excel Table Fawwah Links and Linking in Excel 2 June 13th 05 08:54 AM
Excel Connecting to SQL Server Database - Need your Help Rajesh G Excel Programming 2 February 27th 04 08:01 PM
Read Image From SQL Server n Export to Excel Budiono Excel Programming 0 September 5th 03 10:02 AM


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"