
Problem with Memo field in Jet 2.5 Parameter Query
YOU! Yes, you the expert. Please explain this, if you can:
I am using Visual Basic 4.0 16-bit (Enterprise) to access (through Jet
2.5) an MS Access 2.0 database. In the database, I have an update query
that accepts parameters. In general, the query's SQL looks like this
(please excuse slight syntax errors, I don't have it right in front of
me):
PARAMETERS [qpID] Long, [qpFoo] Long, [qpMemo] LongText
UPDATE tblBogus SET Foo=[qpFoo], MemoField=[qpMemo] WHERE ID=[qpID]
In the code, I set a QueryDef variable to this query and set all the
parameters and execute it. The code bombs with an "Invalid Property
Value" error if the value of [qpMemo] is > 255 characters. Just so
we're on the same page, here's a code snippet:
dim qdTemp as QueryDef
.
.
(Fill local variables with values from form, including
long text value)
.
.
set qdTemp = MyDB.QueryDefs("qruMyUpdateQuery")
With qdTemp
!qpID = lLongIDNumber
!qpFoo = lSomeLongInteger
!qpMemo = sLargeTextValue '<-- Bombs here if Len(sLargeTextValue) >
255
.execute
End With
According to VB4 documentation AND Microsoft's TechNet, the LongText
parameter type (in the SQL for the query) should be able to handle 1.2
GB of text. If I use the Jet "generic" parameter type of "Value"
(PARAMETERS ...,[qpMemo] Value), it still bombs. If I remove the
PARAMETERS clause (which is optional anyway), it still bombs.
The help for the "Invalid Property Value" error says that a possible
cause is that the Value property of a Parameter object is too long.
Well duh. But the Value should be able to handle 1.2 GB! And I'm only
trying, oh, 1000 characters or less.
Now, Mr. or Mrs. Expert, do you know what I've missed? The
documentation and the execution of this logic seems pretty
straightforward to me. Where have I goofed? Please don't suggest other
ways of updating records (i.e. using a RecordSet and .Edit, etc.) I
need to use a parameter query here and I need to send large text values
through the parameters. Any solutions?
Thanks in advance for any help!
Michael deFreitas
Whistler Computing, LLC