Write to Cell in Excel from a recordset : limited amount of caracters, WHY?

T

tmarko

I use the following syntax to fill a cell in Excel with data from m
dB:

ex. (rsA my recordset and field HeaderData where I have my data

ActiveSheet.Range("B4").Value = rsA("HeaderData")

My rsA defintion on my VB6 server

With m_rsReturn
.Fields.Append "Mnemonic", adVarChar, 32
.Fields.Append "Short", adVarChar, 80
.Fields.Append "Type", adInteger, 4
*.Fields.Append "HeaderData", adVarChar, 6000*
.Fields.Append "ShortRef", adVarChar, 10
.Fields.Append "DataRef", adVarChar, 10
.Fields.Append "Format", adInteger, 4
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open
End With


The problem is that when using this VBA code

ActiveSheet.Range("B4").Value = rsA("HeaderData")

I cannot write more than like 150 caracters to the Excel cell, if mor
is in rsA("HeaderData") I get #Value in the cell and nothing is show
even when looking in the formula window in Excel.

The limit should be 1024, and when one is manually placing 102
caracters in a Excel cell it works fine but not via a recordset. Wha
is wrong. I'm using Excel97

It's even more confusing in Excel2003 when I get an Error when th
rsA("HeaderData") consist of more than about 150 caracters.

Very strang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top