store procedure not run in vb 6 code
Hi ,I have problem in vb 6.0 code.Actually one store procedure not execute in elseif condition in vb when i am trying to execute but no error.but it manually run in sql analyzer but through vb code it is running. i am writing this code following :
private sub cmdprocess_click()
Try :
Code:
On error goto catch
dim result as integer
cnn.commandtimeout=300
result=msgbox("do you wisht o process results" & vbcrlf &" modifications in the marks and cutoff will be locked",vbinformation+vbyesno)
if result=vbyes then
cmdprocess.enabled=false
frame2.visible=true
label13.caption="please wait while the results are being processed"
label3.refresh
progressbar1.value=progressbar1.value+10
if(cmbexamname.text="partB") THEN
StrSql="sp_insertresultPartB
elseif(cmbexamname.text="PartD") then
strsql="sp_insertresultPartD"
elseif(cmbexamname.text="DSSC/TSOC") then
strsql="sp_Entercimarks"
cnn.execute strsql
strsql="sp_scanningdssc"
end if
progressbar1.value=progressbar1.value+30
cnn.execute strsql
end if
in the above only sp_scanningdssc is not execute.control not reach at sp_scanningdssc.i think i am missing something.please help.its urgent
Re: store procedure not run in vb 6 code
Thread moved from the FAQ forum, which is not the place to post your questions.
Re: store procedure not run in vb 6 code
You should check if your conditions are met so they are executed or reached.
Re: store procedure not run in vb 6 code
Can we see the rest of your code ?
Where you make your db connection for instance ?
Although you can just execute your code straight off the Connection object you would be better of using a command object, where you can set the type of SQL Command you are executing.