Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data type mismatch error when adding a new record
Message
From
13/10/2004 05:39:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Data type mismatch error when adding a new record
Miscellaneous
Thread ID:
00950955
Message ID:
00950955
Views:
78
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
Map
View

Click here to load this message in the networking platform