suhas-mahajan
20th February 2003, 11:33
Dear All,
I am taking output of my query into a text file using seq.open but suddenly my BaaN Client closes and "Error 509 Access Violation" displayed in the Event Log, I am sure nobody is using my tables then also Access Violation... If I show it with layout then it is working. Is there any parameter in seq.open to solve this problem? Is this related to other issue?
Waiting for immediate reply.
-Suhas
morpheus
20th February 2003, 12:47
Seems you do not have enough permissions to write a file on that location. Check what value is being returned by seq.open().
suhas-mahajan
20th February 2003, 13:38
Dear
Actually the file is generating, when it closes BaaN, 90% data inserted but not 100%.
Maybe I am using big tables like tdpur045, but not sure.
-Suhas
tools123
20th February 2003, 14:32
Look for these things.
If you are using a temp.file to collect data b4 writing using seq.write,make sure it is of enough size.
seq.write has options for create,append etc.Check the
correct option in your case.
Most likely,in your case,you have the file open already from aprevious output and you are trying to append/write/remove the file with the same name.Test by hardcoding a new file name and you should be okay.
ahulikavi
21st February 2003, 05:42
Baan error ...
Error 509 EBADCURSOR
Bad memory cursor; bad table pointer specified
sure report prints with baan reports ?.
Also check if u need to use seq.lock / seq.unlock ...
suhas-mahajan
21st February 2003, 06:29
Dear Member
I am clarifying your things. If the issue is related to size of file, my other reports should not work because I applied same logic on big tables and it is working fine. Anyway I will try, please send me how to increase size.
I have selected correct option i.e. w for write.
I tried by giving different-different name but not found solution.
Dear ahulikavi
I think seq.lock / unlock is used for not to allow other user into my object.
Hope this will help you to find better solution for me.
-Suhas
tools123
21st February 2003, 14:58
If you could post your script ,it may be easier.
suhas-mahajan
22nd February 2003, 09:08
if gr = tcyesno.yes then
grn = seq.open("\\pc19\c\bak\grn.txt","w+")
read.grn.table()
endif
function read.grn.table()
{
Select tdpur045.reno, tdpur045.date, tdpur045.suno, tdpur045.dino,
tdpur045.orno, tdpur045.item, tdpur045.diqu, tdpur045.dqua,
tdpur045.quad, tdpur045.quap, tdpur901.svat, tdpur045.pric,
tdpur901.tppu, tdpur901.assv, tdpur901.fasv, tdpur901.eppu,
tdpur901.otca, tdpur045.cdis, tccom000.ncmp, tdpur045._compnr
From tdpur045, tdpur901, tccom000
Where tdpur045._index1 = tdpur901._index1 and
tccom000.ncmp between :grcomp.f and :grcomp.t and
tdpur045.reno <> 0 and
tdpur045.srnb <> 0 and
tdpur045._compnr = tccom000.ncmp and
tdpur901._compnr = tccom000.ncmp
selectdo
{
tabname=str$(tdpur045._compnr)
date1=num.to.date$(tdpur045.date,3)
stream=shiftl$(shiftr$(str$(tdpur045.reno)))&"|"&date1&"|"&shiftl$(shiftr$(tdpur045.suno))&"|"&shiftl$(shiftr$(tdpur045.dino))&"|"&shiftl$(shiftr$(str$(tdpur045.orno)))&"|"&shiftl$(shiftr$(tdpur045.item))&"|"&shiftl$(shiftr$(str$(tdpur045.diqu)))&"|"&shiftl$(shiftr$(str$(tdpur045.dqua)))&"|"&shiftl$(shiftr$(str$(tdpur045.quad)))
&"|"&shiftl$(shiftr$(str$(tdpur045.quap)))&"|"&shiftl$(shiftr$((tdpur901.svat)))&"|"&shiftl$(shiftr$(str$(tdpur045.pric)))&"|"&shiftl$(shiftr$(str$(tdpur901.tppu)))&"|"&shiftl$(shiftr$(str$(tdpur901.assv)))&"|"&shiftl$(shiftr$(str$(tdpur901.fasv)))
&"|"&shiftl$(shiftr$(str$(tdpur901.eppu)))&"|"&shiftl$(shiftr$(str$(tdpur901.otca)))&"|"&shiftl$(shiftr$(str$(tdpur045.cdis)))&"|"&tabname
buf = sprintf$("%s",stream)
seq.puts(buf, grn)
}
endselect
sql.close(grn)
}
NPRao
22nd February 2003, 11:00
Suhas,
looking at your code, I think you are using the C-language style of making the program block statements using { and }, which are used only for function body in BaaN Tools.
function read.grn.table()
{
.....
selectdo
{
}
endselect
sql.close(grn)
}
If you remove the { and } between selectdo and endselect the program should be compile-able.
tools123
22nd February 2003, 18:55
have you tried debugging the script especially here:
---------------------------------------
buf = sprintf$("%s",stream)
--------------------------------------
is the output as expected or is it 90%?if this is 100% then
size may not be an issue.if it is 90%, I would look at increasing the size of the 'buf' from whatever you have now.
ex:buf (100) may not be enough for the stream.try increasing it
to buf(150)
Try by hardcoding another file name / removing current file by seq.unlink before writing/appending.