Query in vb.net not returning all characters in access memo field

J

John

Hi

I am using below code in vb.net to query an access table. The code is in
vb.net but as I did not get any answer in ado.net group I am posting the
question here. Problem is that I am only getting the first 255 characters
form the access memo fields when query resultset is returned. What is the
problem and how can I fix it?

Thanks

Regards

St3 = "SELECT DISTINCTROW ID, Field1, IIf(Field1 = -1,[Memo Field 1], [Memo
Field 1] AS MyMemoField, ... " & _
"FROM MyTable " & _
"WHERE ...
"ORDER BY ..."

Dim Reader1 As OleDb.OleDbDataReader
Comm = New OleDbCommand(St3, dbCon)
Reader1 = Comm.ExecuteReader
Dim DT As DataTable = New DataTable
DT.Load(Reader1)

MsgBox(DT.Rows.Item(0).Item(2).ToString) 'Memo field only shows first 255
characters
 
A

Albert D. Kallal

I believe it is the use of a function that truncates the field...

Test/try the query without the iif() function....
 

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