Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2006, 01:56 PM
Junior Member
 
Join Date: Feb 2006
Posts: 4
Default Read from and Write to Excel

Can you tell me if it is possible to read from and write to an excel spreadsheet using SWFKit, and if so how to do it?

Many thanks,

Dave
Reply With Quote
  #2 (permalink)  
Old 02-24-2006, 03:12 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from and Write to Excel

There are two ways as follows:

The first way is to use the ActiveXObject method. To use this method, you would have to make sure that the end users have the Microsoft Excel installed. The object model of excel can be found at
http://msdn.microsoft.com/library/de...tionobject.asp

The second way is to use ADO, as you handle a .mdb database. A reference can be found at
http://support.microsoft.com/default...b;EN-US;257819

In this way, the end users only need to install the jet driver.

If you have any questions, please feel free to let us know.
Reply With Quote
  #3 (permalink)  
Old 02-24-2006, 09:25 AM
Junior Member
 
Join Date: Feb 2006
Posts: 4
Default Re:Read from and Write to Excel

Thank you very much for your response. Would you be able to give me an example in the form of the code you would use?

Many thanks,

Dave
Reply With Quote
  #4 (permalink)  
Old 02-26-2006, 01:17 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from and Write to Excel

We'd like to. Please allow us to take 2 ~ 3 days to build the sample.
Reply With Quote
  #5 (permalink)  
Old 02-27-2006, 08:11 AM
Junior Member
 
Join Date: Feb 2006
Posts: 4
Default Re:Read from and Write to Excel

I'd be very grateful if you would. Many thanks again.

Dave
Reply With Quote
  #6 (permalink)  
Old 03-01-2006, 09:39 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from and Write to Excel

We recommend the way of accessing excel files through ADO, because this way has two main advantages. The first one is that the end users will run your application without Microsoft Excel. The second one is that it is very easy to change the back end of your application. For instance, you may easily change your data file from access or firebird to excel, and vice versa.

Please try the following sample, which is converted from our access db sample. The only changes are:
1. the connect string
2. the method to update data. The Update command of SQL doesn't work for a .xls file, so we use the Recordset.update method instead.

exe
src
Reply With Quote
  #7 (permalink)  
Old 03-07-2006, 09:57 AM
Member
 
Join Date: Oct 2004
Posts: 53
Default Re:Read from and Write to Excel

i just downloaded the examples but they are not working?
any guess???

Can we also password protect the excel file, is so how will the connection string look like?
Reply With Quote
  #8 (permalink)  
Old 04-02-2006, 05:55 AM
Junior Member
 
Join Date: Feb 2006
Posts: 12
Default Re:Read from and Write to Excel

i dont knw much about the inner working...but the .exe does not work if u run it / the fields are displayed as undefined.

If however u open the excel file. Then run the program, the program will show the fields correctly.
Reply With Quote
  #9 (permalink)  
Old 04-02-2006, 11:41 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re:Read from and Write to Excel

i found the select query doesn't work when i use

Code:
record.Open("select id,name,age,sex,score from [Sheet1$]", conn, 1, 2);
But when i use
Code:
record.Open("select * from [Sheet1$]", conn, 1, 2);
then it works

But I can't figure out how to let the update query work.
Reply With Quote
  #10 (permalink)  
Old 04-03-2006, 01:20 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from and Write to Excel

We will test it and resolve the problem. Thanks.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:15 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.