Xs2Ado and bBrowser problem

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
jacekm23
Posts: 21
Joined: Tue Sep 29, 2015 8:45 am
Location: Poland

Xs2Ado and bBrowser problem

Post by jacekm23 »

Hi,
i have problem to port my VO app to XS. I have code like this:

Method Init()

bB := bBrowser{...}

bB:ServerType := #SQL
bB:Use(SELF:Server, ...)

bCD := bDataColumn{bB, SELF:Server, {|Server| myFunction(Server)}, #Expression}
...

bB:AddColumn(bCD)
bB:OpenColumn(bCD, 1)
...

return


function myFunction(Server) as string
local sRet as string
local oCmd as AdoCommand
local oRS as AdoRecordSet

sRet := null_string

oCmd := AdoCommand{}
oCmd:ActiveConnection := oConn
oCmd:CommandText := "select * from table1 where id = " + NTrim(Server:FieldGet(#ID))
oCmd:CommandType := AdCmdText

oRS := oCmd:Execute(REF NIL, NIL,NIL)

IF oRS:RecordCount > 0
oRS:MoveFirst()
WHILE !oRS:EOF
IF !Empty(sRet)
sRet += CRLF
ENDIF

sRet += oRS:FieldGet(#Info)

oRS:MoveNext()
ENDDO
ENDIF

return sRet

If there are few lines in Server, the application sometimes works. When there are more rows, the application always crashes on the line oCmd := AdoCommand{} with error "Bound Error". Does this look like a memory allocation problem?
The code is generally more complicated, but the idea is the same as above.

Regards,
Jacek
User avatar
robert
Posts: 5038
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Xs2Ado and bBrowser problem

Post by robert »

Jacek,
Try adding an oRs:Close() to your function.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
jacekm23
Posts: 21
Joined: Tue Sep 29, 2015 8:45 am
Location: Poland

Re: Xs2Ado and bBrowser problem

Post by jacekm23 »

Robert,
thank you for your answer, but unfortunately it doesn't help.
User avatar
robert
Posts: 5038
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Xs2Ado and bBrowser problem

Post by robert »

Jacek,

Can you create a small example that demonstrates the problem?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
jacekm23
Posts: 21
Joined: Tue Sep 29, 2015 8:45 am
Location: Poland

Re: Xs2Ado and bBrowser problem

Post by jacekm23 »

Robert,
I will try, but it will be a bit difficult because I am using a storage procedure to display the value in a cell. This procedure has 10 output parameters. In fact, I think these parameters may cause a memory leak or something like that.

Jacek
User avatar
robert
Posts: 5038
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Xs2Ado and bBrowser problem

Post by robert »

Jacek,
Please try to create an example.
Often creating a small example helps you to find why the code fails.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply