Versions des environnements
Can Anyone Please Help Me!!!
I am currently doing a project whose front end is visual foxpro 9.0 and its backend is oracle server, and during this time I have encountered two very wierd and very frustrating errors which is as follows:
1.) I have created an instance of the combobox and would like to pass the value to a variable, both were initialized as a character but during program execution and after passing the value from the combobox to the variable the datatype of the variable would change to a numric datatype, the code used is as follows:
at the form init method
with this.container1.combobox1
.additem ('01')
.additem ('2A')
.additem ('2B')
.additem ('03')
endwith
at the form save method
local cGroupTag AS Character
cGroupTag = ''
cGroupTag = alltrim( this.container1.combobox1.value )
whats wrong with these lines of codes? why did the datatype change from a character to a numeric?
2.)When I try to Insert/Update the Record to/from the table and error message would pop up preventing me to update my table but I don't encounter any problems when i delete data from the table. the codes are as follows:
local cRegion AS Character, cDivision AS Character, cStation AS Character
local cSQL AS String
cRegion = ''
cDivision = ''
cStation = ''
cSQL=''
cRegion = alltrim(this.container1.combobox1.Value)
cDivision=alltrim(this.container1.Text2.Value)
cstation =allteim(this.container1.Text3.Value)
if this.action='Add' then
cSQL='INSERT INTO Table1 (Region,Division,Station)VALUES '
cSQL=cSQL+'("'+cRegion+'"'
cSQL=cSQL+',"'+cDivision+'"'
cSQL=cSQL+',"'+cStation+'")'
else
cSQL='UPDATE Table1 SET '
cSQL=cSQL+'Region="'+cRegion+'"'
cSQL=cSQL+'Division="'+cDivision+'"'
cSQL=cSQL+'Station="'+cStation+'"'
cSQL=cSQL+' WHERE Region="'+cRegion+'"'
cSQL=cSQL+' AND Division="'+cDivision+'"'
cSQL=cSQL+' AND Station="'+cStation+'"'
endif
execscript(cSQL)
Error Generated:
Microsoft CursorEngine : Multiple-step operation generated errors. check each status value
Whats wrong with this lines of codes? what exactly is the error? what causes the error? and how do i avoid it?
Please help me with this problem for it really is driving me nuts.
Thanks
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement