1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Excel Import in XE6

Discussion in 'Delphi Programming' started by cmehmet, Jul 17, 2014.

  1. cmehmet
    Offline

    cmehmet DF Member

    How to get from Excel Data in datasource or MSQuery for XE6?
     
  2. jlmm
    Offline

    jlmm DF Member

    RE:

    [font=Verdana, sans-serif]You can do this with ADO, TAdoquery orTAdoTable, set the conexion parameter like this:[/font]
     
    For XLSX files do
    ConnectionString:=
      format('Provider=Microsoft.ACE.OLEDB.12.0;DataSource="%s"';Extended Properties="Excel 12.0;HDR=Yes"’,[sfilename]);
     
    FOR XLS files do
       ConnectionString:=
     Format(‘Provider=Microsoft.Jet.OLEDB.4.0;DataSource="%s”;Extended Properties="Excel 8.0;HDR=Yes"’,[sfilename]);
     
    After you canaccess data like
     
    Texcel:
    TAdoquery;
     
        
    Texcel.connection:=ConnectioString;
         Texcel.SQl.Text:=format('SELECT * FROM [%s],[sheet_name]);
         Texcel.Open;
     

    But in myexperience I don’t recommend you this way. Better you can use  XLSREADWRITE component.
     
  3. cmehmet
    Offline

    cmehmet DF Member

    RE:

    thanks... ill use XLSREADWRITE..
     

Share This Page