Problem with cursor

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Sep 26 10:23:30 CDT 2004


On 9/26/04 1:27 AM, "Michael Bierly" <mbierly at earthlink.net> wrote:

> I'm having a problem here that I hope someone has an answer for what
> I'm doing wrong. If you look at the REALbasic code snippet below; my
> problem is that when the SqlSelect executes to populate the curData
> cursor, the cursor remains Nil. I've verified that the statement being
> generated is correct. Is it not possible to have nested cursors?
> 
> Any help with this would be greatly appreciated.
> 
> Regards,
> Mike Bierly
> 
> 
> 
>  ' Declare the local variables
>  Dim Sucessful As Boolean
>  Dim curAsp As VCursor
>  Dim curData As VCursor
>  Dim LibrarySize As Double
>  Dim intCount As Integer
>  Dim intMultiplier As Integer
>  Dim intRank As Integer
>  dim az As String
> 
>  ' Reset the library status bar
>  prgbarObjects.Value = 0
>  prgbarObjects.Refresh
>  lblLibraryStatus.Caption = "Step " + strStep + " of " + NumberOfSteps
> + " : Ranking libraries by ASP"
>  lblLibraryStatus.Refresh
> 
>  ' Perform all of the setups and initializations
>  intMultiplier = intLibraryCount / 100
>  intCount = 0
> 
>  curAsp = mDb.SqlSelect("Select Distinct Asp From LibrariesBuild")
>  Sucessful = curAsp.FirstRecord
>  Do
>    intRank = 0
>    curData = mDb.SqlSelect("Select LibraryName, LibrarySize, RankInAsp
> From LibrariesBuild Where Asp = " + Trim(curAsp.Field(1).GetString) + "
> Order By LibrarySize Desc" , kV_Client,kV_ReadWrite, kV_Indexed)

Hi Michael,

I think all is simple

Your first cursor is READ ONLY.
Your second cursor want to be READ WRITE.
    I assume it try lock THE SAME record.

You do not have error check.
You should have it after EACH query.
Then you will know what is wrong.
I think after second you get 363 error.

You MUST kill the first cursor before you start second query.
Or you must specify for the first cursor NO LOCK parameter


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list