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: 1
Default there is any limitation for text field when using ADO +SQL

my platform is office 2003 (english) Sp1.

Usuallly I use Ado and "select * from [sheet1$]" to deal with some database
in excel spreadsheet. but I found the vba program will be stopped if one cell
of some text field include a lot of characters. I have tested it. I found if
the number of all characters in one cell is less than or equal to 911, it is
okay. But if the number is bigger than 911, then vba will be stoped.
show:

run-time error : -2147467259 (80004005)
Method copyfromrecordset of object range failed

my code is :


Sub inputdata()
Dim x As Object
Dim yy As Object
Dim sql As String
Dim mysheet As Object

Set x = CreateObject("ADODB.Connection")

x.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;Data
Source=" & ThisWorkbook.FullName

Set mysheet = Sheet2

sql = " select * from [sheet1$] "


Set yy = x.Execute(sql)
mysheet.Cells(1, 1).CopyFromRecordset yy
Set x = Nothing
Set yy = Nothing

End Sub


I do not how to upload my excel spreadsheet in this forum. if someone knows,
please help me. You could leave a email, I could send the spreadsheet to you,
you can test.

by the way, to my surprise, my chinese friend, who use officexp, or office
2003 (chinese) can run the program in excel no problem. the result can
correct even the number of characters in one cell increases to 9000.

could you give me some feedback. thank you.

 
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
Text Limitation in an Excel Cell mazzullo Excel Discussion (Misc queries) 1 May 22nd 07 10:58 PM
Text wrap in a cell and character limitation carmie Excel Discussion (Misc queries) 1 November 17th 06 10:35 PM
Limitation of Find and Replace Text in Excel wolfteeth Excel Programming 1 September 17th 04 10:21 PM
HELP!! Populate text in single XL field, or bulk copy text into 1 field filmfatale[_2_] Excel Programming 0 December 9th 03 02:30 PM
Work around Calculated Field limitation Tod[_3_] Excel Programming 1 November 13th 03 04:52 PM


All times are GMT +1. The time now is 03:51 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"