General information
Title:
Data type mismatch error when adding a new record
Dear all,
I am getting a "Data type mismatch" (VFP error 9) on the following repro code, which is quite simple and self-describing (I hope). Can any one be so kind to point out the problem and/or a solution? This code runs in VFP8 SP1.
Thanks in advance.
Cheers
* =================
* repro code, VFP error 9 - what's wrong here?
LOCAL lcTable
LOCAL loEx
SET AUTOINCERROR OFF
CLOSE TABLES ALL
* create a temporary table, with only 2 fields (one of them is autoinc!)
lcTable = 'temp_oct13'
CREATE TABLE (lcTable) (c1 c(10), c2 i AUTOINC)
* and a candidate index, with an "for !deleted()" filter
INDEX ON c1 TAG c1 CANDIDATE FOR !DELETED()
USE (lcTable) SHARED && must be "shared" to see the error
CURSORSETPROP('buffering', 5) && optimistic table buffering
SCATTER MEMVAR && on an empty record (doesn't matter in this case)
APPEND BLANK && so far so good
TRY
** RELEASE m.c2 && you guessed it: if you uncomment this line it then works
&& unfortunately that's not exactly what I want
* otherwise you get the "data type mismatch" error here, why???
GATHER MEMVAR
MESSAGEBOX('It worked', 0, 'Cool', 2000)
CATCH TO loEx
MESSAGEBOX('SORRY, cannot "GATHER MEMVAR" here', 48, loEx.message)
FINALLY
DROP TABLE (lcTable)
ENDTRY
RETURN
* end of repro code
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only