AardvarkBusiness.net - Business Search Engine AardvarkBusiness.net - Business Search Engine



 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

     

How do I go about making an application accessing Excel ...

 
 
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum
View previous topic :: View next topic  
Author Message
foundThroughAdminSig
President
President


Joined: 24 Apr 2004
Posts: 6491

7611 ants

PostPosted: Tue Jun 10, 2008 11:46 am    Post subject: How do I go about making an application accessing Excel ... Reply with quote

My client uses Excel to keep track of variety of tasks and does simple calculations. What I need to do is to access this data and make a couple of rather elementary applications. Am I supposed to use ODBC here? If I want to make this application using Microsoft Access, how do I go about this? If I want to make it using php running on Apache, how do I go about this?
_________________
Online Education :: Training Forum
Chat about health ... Finance Books
Back to top
View user's profile Send private message Visit poster's website
marceldupr
Temp


Joined: 28 Nov 2008
Posts: 2
Location: London
5 ants

PostPosted: Fri Nov 28, 2008 5:25 pm    Post subject: How do I go about making an application accessing Excel ... Reply with quote

I think you could make it very easy for yourself by just exporting the excel file to .csv (comma seperated values, first line is column names)

thus you would be able to import these comma seperated values from any script or programming language.

That would be my first suggestion to try. If you think it is a hassle to export to .csv then maybe you can set up a dts package (data transformation services MS SQL)that would automatically import the excel data to an sql or accent database at a specific time each morning.

please read support.microsoft.com/kb/321686
Back to top
View user's profile Send private message
Alexander123
Secretary
Secretary


Joined: 26 Jan 2009
Posts: 8

9 ants

PostPosted: Fri Feb 20, 2009 12:28 pm    Post subject: Reply with quote

Hi,

You can use ODBC to Read Excel Worksheets.

1 - An excel workbook can be considered to be the "database".
2 - An excel worksheet can be considered to be a "table".

Some php snippets.

DNSless connection - i.e. all connection details are in the PHP function - portable (taken from one of my classes).

odbc_connect('Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=' . realpath($this->s_DB) . ';DefaultDir=' . dirname(realpath($this->s_DB)) . ('' !== $this->s_DBSpecific ? ';' . $this->s_DBSpecific : '') , '', '');


Table names are in the following format (EXACTLY AS BELOW - QUOTE INCLUDED)

'Sheet1$'
'Sheet2$'
etc.

There are other sheets in a workbook. Ranges and print ranges also come back in the list of tables, but only those matching the above format are REAL "tables".

This is the PHP code I use to wrap my table names for Excel ...

return 1 == preg_match("`^'.+\\$'$`", $s_TableName) ? $s_TableName : "'$s_TableName\$'";


REALPATH to the files also.

For Excel to Access migration please visit the link faculty.washington.edu/larsson/conf/aiha98/primer/excel-c.htm
_________________
70-294
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum All times are GMT + 1 Hour
Page 1 of 1

 
Google
 
Business Forum Sport Forum Travel Forum


Powered by php B B © 2001, 2002 php B B Group

AardvarkBusiness.net Business Search Engine & Directory