what is the maximum field VFP9 can handle

Good day to everybody... just a little problem with my update at VFP interface with my back-end database

I dont have this problem updating my employees table in SQL2000 with 35 columns at my VFP interface, but recently I add another 3 columns at my table, that's where I encounter this problem.

Inserting a new recordSleep or deleting there's no problem, but when i edit a particular record then saved the changes,the update is OK.. but after I close the form and open it again, that particular record I edited does not really saving the changes. why is there a limit in field column use by VFP

Just asking.. or there's i miss... but I already make some configuration, sometimes i incounter this problem with other table, all i have to do is delete the cursoradapter then add back again with the same name. no problem, but now no matter I do, it does'nt work. if i divide my employee's table into two.. that's what I do at VFP8 before.

thank you for any help.




Answer this question

what is the maximum field VFP9 can handle

  • Kerem Karatal

    >>Inserting new record it works OK, just in editing where i got this problem.

    What do you want me to tell you

    Either you are right and VFP is broken - in which case there is no solution.

    Or your code is wrong in some way.

    You are correct, this is a very simple operation that is done in VFP millions of times every minute all over the world. No-one but YOU has a problem with it. So which of the two options do YOU think is the most likely

    Unless you post the actual code, there is nothing I, or anyone else, can tell you.



  • tsramkumar

    Yes, I even try to make a class that will pop-ups at my edit button where i enter the a value wherein the computation is at the class and only the result will be at the desired numeric field at my form, but same thing happened when i refresh, it restore the old value. I also try that the replace command will be at save button, but same thing happened,   if i edit the character field it goes alright no problem.

    Does my form is coming to a crush

     Is there any idea out there that can solve this problem I am puzzled by this... I even recreate my CA many times.

    Thanks a lot in advance.



  • Christopher Chan

    >> I already recreate the CA...I also observe that if I edit a character FIELD there is no problem, but when I edit the numeric field and change the value then saved, & then refresh there it goes back to its original value. Why

    Clearly it is NOT being saved to the underlying table. Probably the column is not in the Updatable field list, but unless you post the code for creating the CA there isn't much we can tell you....



  • DhawalMehta

    I am sorry, but I simply do not understand this code. For example you have this:

    SELECT sss_cont
    SET ORDER TO TAG
    rangefrom
    GO TOP
    SCAN
      lcRangeFrom=sss_cont.range_frm
      lcRangeTo =sss_cont.range_to
      IF
    basicsalary >=lcRangeFrom AND basicsalary <=lcRangeTo
        lcsss=sss_cont.employee
      ENDIF
      lcRangeFrom=0
      lcRangeTo=0
    ENDSCAN

    The result of this code will be that lcSSS contains only the value from the last record that meets the conditions, and 0 if no record meets the condition.

    The next part of the code does the same thing for the "lcphilhealth" variable, but again the value is set only from the LAST record that meets the condition (or is 0) - there is no guarantee that I can see that the values are in any way related.

    You then do the same thing again, with the same un-correlated result from a different source. Surely this cannot be correct Or are there only records for one person in these tables

    However, that is not the point at issue here.

    What I do NOT see anywhere in this code is the code to actually update the underlying table. If these tables are created using a cursoradapter then you have to tell it to update the underlying table.

    Of course that also means that the CursorAdapter must have all the correct update criteria specified (table, key field, updatable fields). If you are not sure about this, see the help file topic "Data Access Management Using CursorAdapters"

    But in any case, in order to save the changes your code should be something like:

    REPLACE SSSCO WITH lcsss, ;
            PHLCO WITH lcphilhealth, ;
            PBGCO WITH lcpgbg IN employee

    llOk = TABLEUPDATE( 1, .F., 'employee' )
    IF NOT llOk
      *** Update failed! Do soemthing here
    ENDIF

     

     


     



  • Notre

    I am sorry for I forget to say that the ActualAmount is also a field.

    I mean...I edit the value at numeric field 1, then at the lostfocus has a computation that will give a value to numeric field 2, there is no problem if I edit at character field, but at numeric field that's where the problem occur, when I refresh... the original values comes back.

    I try to put a click button beside the text back at field 1, so that after i put a value at field 1 i just click it... it doesn't work either.

    One thing, it has no problem if i will not put a computation at the text box... but the automation is gone on that way, if I put beside me a calculator just to compute the result manually then enter the result at field 2.

    thanks for your help regarding this matter



  • laq

    >>I am waiting for any answer to my question but it seems it'll never come... so,,, that's VFP's behaviour sometimes DO sometimes DON'T

    No, VFP does not behave like that. It's behavior is consistent and something is wrong with what you are doing but since we cannot see your code it is impossible to guess what it might be. If VFP really behaved so inconsistently it would be useless and since it clearly isn't, the problem has to be on your side of the monitor.

    Something must be wrong with your methodology, your approach or your code but no-one here is clairvoyant and, based on the information you have provided, clearly there is nothing more anyone can suggest.

    Maybe if you posted the actual code that isn't working....

    >> Here's another simple question ,, how could i get a record or records from an access table i want to copy it into my VFP table. my access table is in c:\myaccess' folder, is there a way and can i ask a code regarding this matter

    As for copying an Access table you must first create an ODBC connection to the the access database. I cannot give you code to do that because I don't know how your mdb file is named or what security (if any) you have on your system.

    To create a basic, non-secured connection you can use a string like this (or SQLCONNECT() and a DSN if you prefer):

    lnCon = SQLSTRINGCONNECT( "Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\myaccess\databasename.mdb" )

    Once you have the connection handle, use SQLEXEC() to get the data:

    lnResult = SQLEXEC( lnCon, [SELECT * FROM access_table], "mycursor" )

    and then use the COPY TO command (see help for full details of the possible options) to move the result set from the temporary cursor into a permanent table

    IF lnRes > 0
    SELECT mycursor
    COPY TO myTable
    ENDIF



  • BHDev

    Yes there is a limit. Check "System Capasities in Visual Foxpro" index entry on help.

    Maximum number of fields in a table is 255 (254 if null using column(s) exist).

    However your problem doesn't have anything to do with this limit. Try recreating the CA. Probably your UpdateCmd still has only 35 previous columns.


  • gholmesjr

    Did you change your code to use REPLACE as I suggested earlier

    Tamar

  • gue22

    The problem is the way you're updating the table. You have to use the REPLACE command to change table data, not the equal sign.

    REPLACE ActualAmount WITh CodeA * CodeB IN OrigTable

    Tamar

  • Gediminas Bukauskas

    thank you very much for the code regarding recordSleep at ACCESS.

    Regarding my problem about saving record...it is only a simple coding just to get an amount of tax of a certain range of salary recorded in another CA 'salary', which the computation I put at the lostfocus of the dailyrate FIELD of my form for CA 'employee '

    Inserting new record it works OK, just in editing where i got this problem.

    I already recreate the CA but still d'same.

    thank you for your help.



  • Piet Van de Ven

    helppppppppppp...maybe it's a bug... why it has no problem with all my forms that has fewer field in a table attached unto it..

    thanks for any help.



  • frumbert

    Good day to everybody,

    I am waiting for any answer to my question but it seems it'll never come... so,,, that's VFP's behaviour sometimes DO sometimes DON'T.

    Here's another simple question ,, how could i get a record or records from an access table i want to copy it into my VFP table. my access table is in c:\myaccess' folder, is there a way and can i ask a code regarding this matter

    any help is very much appreciated... thank you very much in advance.



  • Aaron B

    thank you sir for your help...here's my code at the lostfocus of my employee.dailyrate

    LOCAL basicsalary, ;
    lcRangeFrom, ;
    lcRangeTo, ;
    lcsss, ;
    lcphilhealth, ;
    lcpgbg


    STORE 0 TO lcsss, lcphilhealth, lcpgbg, ;
    basicsalary, ;
    lcRangeFrom, ;
    lcRangeTo

    WITH THISFORM.c1.msd_pageframe1.page1
    basicsalary= .msd_text35.
    VALUE*26 && default daily rate X 26days
    SELECT
    sss_cont
    SET ORDER TO TAG rangefrom
    GO TOP
    SCAN
    lcRangeFrom=sss_cont.range_frm
    lcRangeTo =sss_cont.range_to
    IF basicsalary >=lcRangeFrom AND basicsalary <=lcRangeTo
    lcsss=sss_cont.employee
    ENDIF
    lcRangeFrom=0
    lcRangeTo=0
    ENDSCAN
    SELECT
    philhealth
    SET ORDER TO TAG rangefrom
    GO TOP
    SCAN
    lcRangeFrom=philhealth.range_frm
    lcRangeTo =philhealth.range_to
    IF basicsalary >=lcRangeFrom AND basicsalary <=lcRangeTo
    lcphilhealth=philhealth.employee_share
    ENDIF
    lcRangeFrom=0
    lcRangeTo=0
    ENDSCAN
    SELECT
    pagibig
    SET ORDER TO TAG rangefrom
    GO TOP
    SCAN
    lcRangeFrom=pagibig.range_frm
    lcRangeTo =pagibig.range_to
    IF basicsalary >=lcRangeFrom AND basicsalary <=lcRangeTo
    lcpgbg=pagibig.empl_share
    ENDIF
    lcRangeFrom=0
    lcRangeTo=0
    ENDSCAN
    SELECT
    employee
    * REPLACE SSSCO WITH lcsss,;
    * P
    HLCO WITH lcphilhealth, ;
    * PBGCO
    WITH lcpgbg
    .msd_text30.VALUE=lcsss
    .msd_text18.
    VALUE=lcphilhealth
    .msd_text31.VALUE=lcpgbg
    ENDWITH
    RELEASE basicsalary,lcRangeFrom, ;
    lcRangeTo, lcsss, lcphilhealth, lcpgbg

    thanks again for your help



  • blsamp

    I already recreate the CA...I also observe that if I edit a character FIELD there is no problem, but when I edit the numeric field and change the value then saved, & then refresh there it goes back to its original value. Why

    I put a computation at lostfocus event at the textbox where I put an initial value for further computation which involve two tables.

    here's the example at the lostfocus

    lcAmount=this.value

    SELECT table A
       // code here

    SELECT B
      // code here

    SELECT origtable
    origtable.actualamount= code A* code B

    hanks for any help

     

     



  • what is the maximum field VFP9 can handle