valentina sql ?

Robert Mann robmann at gp-racing.com
Thu Dec 28 11:01:14 CST 2006


The opencard script works fine but then when I run the on mouseUp I get
nothing unless I have the same sql statement as in the databaseopen "SELECT
* FROM wt_brands "

ON openCard

  get valentina_Init( 100 * 1024 * 1024 )

  Databaseopen

END openCard



ON closeCard

  DatabaseClose

  get valentina_ShutDown

END closeCard



ON Databaseopen_

    put VDatabase_Constructor() into mDatabase

    get the effective filename of this stack

    set the itemdel to slash

    put the (item 1 to -2 of it) & slash & "snspringcalc" into dbPath



    get VDatabase_Open( mDatabase, dbPAth )

    put VDataBase_SqlSelect(mDatabase, "SELECT * FROM wt_brands ") into
curID

    put VCursor_RecordCount(curID) into recNum

    put VCursor_FieldCount(curID) into colnum

    put empty into fld "Select"



    IF recNum > 0 THEN

        REPEAT recNum times

            put empty into tRec

            REPEAT with c = 1 to colNum

                put VCursor_Field(curID, c) into fldRef

                put VField_String(fldRef) & tab after tRec



            END REPEAT

            put tRec & cr after fld "Select"

            get VCursor_Nextrecord(curID)

            IF the result = false THEN exit REPEAT

        END REPEAT

    END IF

    delete last char of fld "Select"







END Databaseopen



ON SelectYearmodel



    put VDataBase_SqlSelect(mDatabase,"SELECT * FROM stockvalving ") into
curID

    put VCursor_RecordCount(curID) into recNum

    put VCursor_FieldCount(curID) into colnum

    put recnum into fld "fieldrecnum"

    put colnum into fld "fieldcolnum"

    put empty into fld "Select Yearmodel"



    IF recNum > 0 THEN

        REPEAT recNum times

            put empty into tRec

            REPEAT with c = 1 to colNum

                put VCursor_Field(curID, c) into fldRef

                put VField_String(fldRef) & tab after tRec



            END REPEAT

            put tRec & cr after fld "Select yearmodel"

            get VCursor_Nextrecord(curID)

            IF the result = false THEN exit REPEAT

        END REPEAT

    END IF

    delete last char of fld "Select yearmodel"

 END SelectYearmodel









ON mouseUp

  global mDatabase, gbrand, gyearmodel, gbrandid

  put the selectedtext of me into theRec

  replace tab with cr in theRec

   put word 1 of theRec into gbrandid

   put word 2 of theRec into gbrand

   put gbrand into fld "gbrand"




 SelectYearmodel



END mouseUp



Thanks

Rob


More information about the Valentina mailing list