[VCOM] compile error

Igor Gomon giv at tlc.kherson.ua
Mon Jan 19 09:40:27 CST 2004


> Ruslan,
>
> Another compile problem
>
> When the program runs, I load a grid with the name of the tables in the
> newly created database. Then I detect a click on a row that returns the
> name of the table. In the "click" event, I want to call "SQLLoad Db". The
> error I get is:
>
> COMPILE ERROR: variable not defined
>
> "Db" was defined in the Form_Load event as VDatabase
> Then Set DB = CreateTestDb creates the database and the 2 tables
> Then "LoadTablesToGrid Db" creates a tables list in the grid.
> Then "AddRecords Db" adds records to both tables
> Then a cursor is created through SQL. The code is:
> Set VC = Db.SqlSelect(sql)
> Then, "LoadDataToGrid VC" loads a 2nd grid.
>
> All this works. But after the form is loaded and the grids are filled,
when
> I click on the 1st grid that contains the names of the tables and attempt
> to call SQLLoad Db, I get the above error.
Just define Db variable at the form level insteaf of handler level.
I.e. put
    Dim Db as VDataBase
outside of all form1 methods, for example at the beginning of form code.

--
Best regards,
Igor Gomon
-------------------------------------------------------------
e-mail: giv_ua at inbox.ru
web: http://www.paradigmasoft.com

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









More information about the Valentina mailing list