SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    datagrip director

    Hello.
    This is the first time I am working with DataGrip. I am using Director 8.

    My doubt is concerned with a Recordset Function: DGRSFillString.

    My DB is called "Bd" and has several tables, but what we want to display is all names of the field "contexto" of the table "contexto".

    I've readed on Datagrip tutorial that :

    "For instance if you wanted to display all of the names in your database in a field you would use this function. DGRSFillString "

    This is the code I have on the movie, but nothing appears on the cast display on stage. The cast is a text window called "campo".



    on startMovie
    InitGlobals
    end

    on InitDB
    global dbHandle
    global rsHandle
    global qdHandle


    set dbHandle = DGOpenDatabase (the moviePath & "Bd.mdb")

    if dbHandle = "#ERRO#" then

    alert "Erro" & GetLastDGError()

    alert "EXIT"

    ClearDGError()

    quit

    end if


    -- "contexto" is the name of the field of the table "contexto"

    set sqlString ="SELECT contexto FROM contexto"


    set rsHandle = DGCreateRecordset(sqlString, dbHandle)


    if rsHandle = "#ERRO#" then

    alert "Erro" & GetLastDGError()

    alert "EXIT

    quit

    end if


    -- THE ABOVE CODE IN RED WORKS BUT IT ONLY DISPLAY THE FIRST RECORD AND I WANT ALL.

    --member("campo").text = DGRSGetFieldValue("contexto",rsHandle)

    --rsHandle =0

    -- I've define the handle because it always appears an error message saying that the handle is not define #DGRSFillFieldThen it delivers another message "variable defined before value", so I have define the global rsHandle again:

    on FillField

    global rsHandle

    set str=DGRSFillField("contexto", rsHandle)

    set the text of member "campo"=str

    end

    end


    Well, I hope you could understand this.

    Thank you.
    Last edited by magi; May 8, 2003 at 01:48.

  2. #2
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OH!!!

    Of course it is wrong.
    It should me like this:
    Code:
    set str=DGRSFillString("contexto", rsHandle)
    set the text of member "campo"=str


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •