|
Home > Archive > Programming with dBASE > November 2005 > BeginAppend error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Charlie Lutz 2005-11-09, 11:23 am |
| Gang,
Clicking on a pushbutton to add a new row generates the error message
"Data Type Mismatch Expecting character" at the BeginAppend() line (see
function below, watch for strange line wrap <g> )
I have no idea what it is telling me. Anyone have any clues???
Thanks,
Charlie
-----------------------------------------------
function PBADD1_onClick
local nans, qD , cIndex
qD = form.main1datamodule1.dcgen1.rowset
if form.main1datamodule1.dcgen1.rowset.state == 2 OR
form.main1datamodule1.dcgen1.rowset.state == 3
PBSave::OnClick()
endif
nans = msgbox("Only projects where some or all of the dredged
material "+;
"was disposed at an ocean disposal site "+chr(13)+;
"should be reported in this database. Is this the
case?",+;
"Was Any Dredged Material Disposed Of In The
Ocean?",36)
if nAns = 6
// need to get new data_set number
cIndex = qD.indexname
qD.indexname = "data_set"
qD.last()
nDataSet = qD.fields["data_set"].value
qD.indexname := cIndex
qD.BeginAppend() // <<--------ERROR HERE
// replace fields with defaults
local fd
fd = form.nbmain.contperson
fd.effirst.value = _app.first
fd.eflast.value = _app.last
fd.efphone.value = _app.telephone
fd.effax.value = _app.fax
fd.cbelement.value = _app.full_name
form.efdataset.value = (nDataSet+1)
form.nbmain.contdates.sbyear.value = (year(date()))-1
form.nbmain.contallmaterial.ckballmaterial.value = true
else
msgbox("Based on your answer, this project does not need to be
"+;
"reported here.","Not A Valid ODD Project")
endif
return
--
____________________
________
Charlie Lutz
#1000441
| |
| *Lysander* 2005-11-09, 1:23 pm |
| In article <MPG. 1ddbe75135e17f2a9896
99@news.dbase.com>, Charlie Lutz=20
<lutzc@(remove)wes.army.mil> says...
> Gang,
> Clicking on a pushbutton to add a new row generates the error message=20
> "Data Type Mismatch Expecting character" at the BeginAppend() line (see=
=20
> function below, watch for strange line wrap <g> )
>=20
> I have no idea what it is telling me. Anyone have any clues???
nothing too obvious to me, but you could try and check the value of=20
cIndex one line above. If this is not a character-string then the error-
message could indeed be pointing to that line.=20
--=20
ciao,
Andr=E9
| |
| Charlie Lutz 2005-11-09, 1:23 pm |
| In article <MPG. 1ddc58b19fd3b30d9899
32@news.dbase.com>,
nobody@nowhere.com says...[color=darkred]
> In article <MPG. 1ddbe75135e17f2a9896
99@news.dbase.com>, Charlie Lutz=20
> <lutzc@(remove)wes.army.mil> says...
Thanks, I did that. The index name is a string and it "seems" not to be
the problem. I have checked my can navigate code as well and made sure
it is not doing anything.
I just don't know what it is looking for.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Todd Kreuter 2005-11-09, 1:23 pm |
| Charlie Lutz wrote:
>
> I just don't know what it is looking for.
Any canAppend or onAppend code out there, or default values setup in the
table itself?
--
Todd Kreuter [dBVIPS]
| |
| Bruce Beacham 2005-11-09, 8:23 pm |
| Charlie Lutz wrote:
> Gang,
> Clicking on a pushbutton to add a new row generates the error message
> "Data Type Mismatch Expecting character" at the BeginAppend() line (see
> function below, watch for strange line wrap <g> )
>
> I have no idea what it is telling me. Anyone have any clues???
Do you have a lookup set on a LONG field? And is rowset
autonullfields set to false (orSET AUTONULLFIELDS = "OFF"), so that new
rows are filled with space, or 0, or false, etc rather than being left null?
If so, that combination is your problem. It's a bug first reported in
2001 and recently re-reported.
Otherwise, I suggest you look at the logic within any codeblocks you
have set, eg cangetrow / beforegetvalue / query_onOpen(), query_canopen().
Bruce Beacham
| |
| Charlie Lutz 2005-11-09, 8:23 pm |
| In article <4372479D.B5C9A078@dbvips.usa>, tkreuter@dbvips.usa says...
> Charlie Lutz wrote:
>
> Any canAppend or onAppend code out there, or default values setup in the
None that I know of. Will double check though.
Thanks,
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Charlie Lutz 2005-11-09, 8:23 pm |
| In article <RPTPNFX5FHA.1240@news-server>, bbeacham@beacham.no-
spam.co.uk says...[color=darkred]
> Charlie Lutz wrote:
Very possibly, I need to check to be sure. I use lookups a lot and I
know nulls are set to false.
Thanks for the lead.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Charlie Lutz 2005-11-10, 9:23 am |
| In article <RPTPNFX5FHA.1240@news-server>, bbeacham@beacham.no-
spam.co.uk says...[color=darkred]
> Charlie Lutz wrote:
Unfortunately, I still can't find out why I get this error. I have no
long fields in this table (it is a carryover over table from 5.7), my
only lookups are on character fields (I killed those for testing, error
still occurs). If I set up the table in the command window and do a
BeginAppend() it works fine (even with autonullfields = false).
Obviously, have done something in my code somewhere to cause the error.
It appears to append a record to the table, so it has to be a specific
field that is throwing the error.
Still searching and confused.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| *Lysander* 2005-11-10, 11:23 am |
| In article <MPG. 1ddbfc6e7bf7eeaf9896
9a@news.dbase.com>, Charlie Lutz=20
<lutzc@(remove)wes.army.mil> says...
> I have checked my can navigate code as well and made sure=20
> it is not doing anything. =20
Did you turn OFF all events that are connected with the rowset, for a=20
try?
--=20
ciao,
Andr=E9
| |
| Bruce Beacham 2005-11-10, 11:23 am |
| Charlie Lutz wrote:
> In article <RPTPNFX5FHA.1240@news-server>, bbeacham@beacham.no-
> spam.co.uk says...
>
>
> Unfortunately, I still can't find out why I get this error. I have no
> long fields in this table (it is a carryover over table from 5.7), my
> only lookups are on character fields (I killed those for testing, error
> still occurs). If I set up the table in the command window and do a
> BeginAppend() it works fine (even with autonullfields = false).
> Obviously, have done something in my code somewhere to cause the error.
>
> It appears to append a record to the table, so it has to be a specific
> field that is throwing the error.
Any rowset.onAppend handler?
You can check your object in realtime by calling this at the
rowset.beginappend line:
set proc to :duflp:kminspector.wfm // be sure it's in a DEO path also.
inspectobject(<rowset> )
Bruce
Bruce
| |
| Charlie Lutz 2005-11-10, 11:23 am |
| In article <MPG. 1ddd84a12badd9c99899
34@news.dbase.com>,
nobody@nowhere.com says...
> In article <MPG. 1ddbfc6e7bf7eeaf9896
9a@news.dbase.com>, Charlie Lutz=20
> <lutzc@(remove)wes.army.mil> says...
>
Been doing that, it is somewhere in my form on open that calls something
else, etc. I am slowly working through it.
Thanks for all suggestions.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Charlie Lutz 2005-11-10, 11:23 am |
| In article <wcOMT9g5FHA.1244@news-server>, bbeacham@beacham.no-
spam.co.uk says...[color=darkred]
> Charlie Lutz wrote:
Been turning everything off and slowly back on <g>, it is somewhere in
my form on open that calls something else, etc. I am slowly working
through it.
Thanks for all suggestions.
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Charlie Lutz 2005-11-16, 9:23 am |
| In article <RPTPNFX5FHA.1240@news-server>, bbeacham@beacham.no-
spam.co.uk says...[color=darkred]
> Charlie Lutz wrote:
Bruce,
After arguing with this problem for several days, it appears to be tied
with autonullfields = false setting. Even though my lookupsql fields go
from character to character (not long), it was still causing this error.
I have not been able to pin it down exactly, but if I set autonullfields
to true, the problem vanishes.
Thanks for pointing me in the correct direction.
Charlie
--
____________________
________
Charlie Lutz
#1000441
|
|
|
|
|