Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot access the selected table Error message ?
Message
From
12/02/2004 09:20:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/02/2004 08:13:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00876612
Message ID:
00876644
Views:
15
>I have two Combo boxes on my form (.VCX class) that both use the same database table (contained in .DBC).
>
>Combobox cboactive comes up enabled when form is loaded. It has RowSourceType 3 - SQL Statement. It has RowSource as follows:
>
>SELECT DISTINCT pj_pcode,pj_title,pj_state,pj_id FROM DD_Proj WHERE pj_state="A" ORDER BY pj_pcode INTO CURSOR ProjList
>
>
>I have another Combobox cboWc, that when Valid fires (item selected) executes the following SQL stmt:
>
>SELECT DISTINCT P.pj_pcode,P.pj_title,P.pj_state,P.pj_id ;
> FROM DD_Proj P, DD_Tasklist T, DD_Tskdwgs D ;
> WHERE P.pj_state='A' ;
> AND P.pj_id = T.tl_projid ;
> AND T.tl_id = D.td_tlid ;
> AND D.td_code = ALLTRIM(STR(INT(VAL(Thisform.cboWc.Value)))) ;
> ORDER BY P.pj_pcode ;
> INTO CURSOR ProjList
>
> SELECT DISTINCT P.pj_pcode,P.pj_title,P.pj_state,P.pj_id ;
> FROM DD_Proj P, DD_Tasklist T, DD_Tskdwgs D ;
> WHERE P.pj_state='A' ;
> AND P.pj_id = T.tl_projid ;
> AND T.tl_id = D.td_tlid ;
> AND D.td_code = ALLTRIM(STR(INT(VAL(Thisform.cboWc.Value)))) ;
> ORDER BY P.pj_pcode ;
> INTO CURSOR ProjList
> Thisform.cboActiveWc.RowSource="Projlist.pj_pcode,pj_title,pj_state,pj_id"
> Thisform.cboActiveWc.Left=183
> Thisform.cboactiveWc.Top=125
> Thisform.cboActiveWc.Visible=.T.
> Thisform.cboactiveWc.REFRESH()
> Thisform.cboactive.Enabled = .F.
> Thisform.cboactive.Visible = .F.
>
>When this code fires (any stmt. after SQL query), I get the VFP error messagebox:
>
> Cannot access the selected table.
>
>This is ERROR #: 1152.
>
>It does re-populate cboActiveWc correctly, but with the annoying Error message displaying first. Why is this?
>
>Is there a Share issue with table dd_proj, since it is used as RowSource for different ComboBox in the same form?
>
>Any help appreciated.
>
>DBK

For 'into cursor ...' parts define different cursor names.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform