Alpha Video Training
Results 1 to 5 of 5

Thread: Importing .csv files into grid

  1. #1
    Member
    Real Name
    Steve Matranga
    Join Date
    Oct 2006
    Posts
    130

    Default Importing .csv files into grid - Added Sample

    I built a grid to import a .csv file. I setup an action button on the grid to import a .csv file that has 289 records. When I click on the button and perform the import, I get a message that tells me that I imported 289 records. When I click out of the message, my grid contains double the amount of records. Can anyone tell me why this occurs? Thanks.

    I have attached a compressed file that has a A5V11 application titled progress estimate. There is one table, titled PEsub and a grid with an action button named PEsub. There is an Excel CSV file named PE1. Open the pesub main in working preview and click on the action button. Navigate to the pe1 excel file and select. A message popups that says it imported 289 records; however, there are 578 records in the table. Thanks.

    ProgressEstimate.zip
    Last edited by spmat; 03-24-2013 at 04:09 PM. Reason: Upload sample

  2. #2
    Member
    Real Name
    Steve Matranga
    Join Date
    Oct 2006
    Posts
    130

    Default Re: Importing .csv files into grid - Added Sample

    I discovered something troubleshooting. The duplicate record import only occurs when the auto-upload feature is checked? Is this normal?

  3. #3
    Member
    Real Name
    John Berry
    Join Date
    Nov 2007
    Location
    Maryland, USA
    Posts
    649

    Default Re: Importing .csv files into grid

    Steve,

    Try making one of your ID fields unique. I made both fields (see pic) unique and it imported just the 289 records.

    -John
    Attached Images Attached Images

  4. #4
    Member
    Real Name
    John Berry
    Join Date
    Nov 2007
    Location
    Maryland, USA
    Posts
    649

    Default Re: Importing .csv files into grid

    Wait, that didn't seem to work either. It imported 289 but the 2nd time I imported it added the 289 again, shouldn't have as far as I know but it did.

  5. #5
    Member
    Real Name
    Kenyon Sprankle
    Join Date
    Jun 2011
    Location
    Marlton, NJ
    Posts
    177

    Default Re: Importing .csv files into grid

    It is my understanding Importing an Acsii or Excel file from an action button appends to existing file. If you do not want it to append, you need to delete the existing
    table in Server-Side Event at OnGridInitialize. If dealing with DBF table you can zap the table or if SQL, TRUNCATE it. I also have a script that loops thru complete table and uses DELETE command for DBF and another for SQL table deleting selected records based on session.variable. If you would like samples, let me know.

    Check videos in V10FP12 Part 1 talks about button to empty data from table before importing. Part 2 talks about creating a validate function at about 1.44 minute mark and shows sample of t.zap.t.) function when crating function.
    Last edited by swksys; 03-31-2013 at 02:23 AM.

Similar Threads

  1. Importing csv file
    By jaryder in forum Alpha Five Version 7
    Replies: 0
    Last Post: 07-20-2006, 05:27 PM
  2. Importing CSV file
    By Colin Bannister in forum Alpha Five Version 6
    Replies: 2
    Last Post: 12-10-2004, 07:54 AM
  3. errors importing PayPal csv files
    By Andrea in forum Alpha Five Version 5
    Replies: 3
    Last Post: 07-20-2004, 04:31 AM
  4. Importing CSV files
    By Dennis Mathias in forum Alpha Five Version 5
    Replies: 9
    Last Post: 06-07-2004, 02:52 PM
  5. Importing CSV or Excel97 files
    By Lesley Campbell in forum Alpha Five Version 4
    Replies: 5
    Last Post: 02-20-2001, 09:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •