Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FYI; Problem with PADL; .NULL. in SELECT SQL
Message
De
23/06/2009 09:41:11
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
23/06/2009 09:03:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01407500
Message ID:
01407770
Vues:
37
>>>Agnes,
>>>IMHO that is a bug.
>>>
>>>I wouldn't use a character translation for a combobox but directly the cursor itself as a rowsource and alias.field as the value. If you use alias.field you don't need a conversion.
>>>Cetin
>>
>>Hi Cetin,
>>
>>I'm not sure if I understand.
>>
>>I have a combo as a pickup for normalized data. For what I know the values of column used in BOUNDCOLUMN need to be character.
>>
>>Is there something changed with VFP 9.0 or do I miss something?
>>
>>Agnes
>
>Nothing has changed, it was always the case. What IU am saying is that you don't need to get the value from bound column but directly from the underlying source itself. Here is a sample:
>
>
Public oForm
>oForm = Createobject('comboOrnek')
>oForm.Show
>
>Define Class ComboOrnek As Form
>  DataSession = 2
>  Add Object cmbOrnek As ComboBox With Top = 10,Left = 10, Width = 200
>  Add Object btnGoster As CommandButton With Top = 10,Left = 210, Autosize = .t., Caption = 'Show selected as xml'
>  Add Object txt1 As TextBox With Top = 50,Left = 10, Width = 200
>  Add Object txt2 As TextBox With Top = 80,Left = 10, Width = 200
>  Add Object txt3 As TextBox With Top = 110,Left = 10, Width = 200
>  Add Object txt4 As TextBox With Top = 140,Left = 10, Width = 200
>  Add Object txt5 As TextBox With Top = 170,Left = 10, Width = 200
>  Add Object txt6 As TextBox With Top = 200,Left = 10, Width = 200
>  Add Object txt7 As TextBox With Top = 200,Left = 210, Width = 20
>  Add Object txt8 As TextBox With Top = 230,Left = 10, Width = 200
>  Add Object txt9 As TextBox With Top = 230,Left = 210, Width = 20
>
>  Procedure cmbOrnek.Init
>    With This
>      .RowSourceType = 3
>      TEXT TO .RowSource NOSHOW PRETEXT 15
>select
>    first_Name-(' '+Last_Name-(":["+order_id+"]")) as empOrder,
>    employee.emp_id as myId,
>    orders.*
> from (_samples+'data\employee') employee
>   INNER JOIN (_samples+'data\orders') orders
>     ON employee.emp_id == orders.emp_id
> ORDER BY 1
> into cursor xx nofilter
>      ENDTEXT
>      .ColumnCount = 1
>      .BoundColumn = 2
>    Endwith
>  Endproc
>
>  Procedure cmbOrnek.InteractiveChange
>    With Thisform
>      .txt1.Value = This.Text
>      .txt2.Value = This.Value
>      .txt3.Value = This.DisplayValue
>      .txt4.Value = This.ListIndex
>      .txt5.Value = xx.myId
>      .txt6.Value = xx.order_date
>      .txt7.Value = Type('xx.order_date') && data tipi date
>      Local Array aFieldList[1]
>      Local lnOrderDateCol,luValue
>      Afields(aFieldList,'xx')
>      lnOrderDateCol = Ascan(aFieldList,'order_date',1,-1,1,1+2+4+8)
>      luValue = This.List(This.ListIndex, m.lnOrderDateCol)
>      .txt8.Value = m.luValue
>      .txt9.Value = Type('m.luValue') && data type char
>    Endwith
>  Endproc
>
>  Procedure btnGoster.Click
>    Cursortoxml('xx','lcXML',1,2,1)
>    Messagebox("Selected:"+Chr(13)+m.lcXML)
>  Endproc
>Enddefine
>
Cetin

Cetin,

beg your pardon, somehow I do not see what you are talking about.

My limited knowledge of comboboxes:

BoundColumn is the PK in the table (curPick) that fills the combobox while controlsource holds a refernce to the FK of an other table (curWork).

If I change Record in curWork the combobox show the value coresponding to the record in curPick with PK=curWork.FK

If I alter comboboxes value the combo will do internal REPLACE curWork.FK with curPick.PK

And both FK and PK have to be character

this is all what I know about it.

Ok one can have one column in the combo (.ColumnCount = 1). Lets hope .BoundColumn = 1 means the first column of my underlying table (the position where my DBCS creates tables PK)

But this is not my problem

I have a key into my database. This is of type integer. I need to translate this into a character first, to use it as BOUNDCOLUMN.
Your example uses samples/data/orders.Emp_id. Emp_id is a character anyway, so it needs no tranlsation.

So what are you trying to express?

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform