PDA

View Full Version : Export Excel Data into MySQL



debauch
06-11-2006, 02:33 PM
Hello all.

I have seen many applications that are able to export excel data into MySQL databases, and would like to construct one that will do the same.

Currently, I have a main database in MySQL, which is also linked to Access.
Do you think it would be easier to export to Access? If so, I may be in the wrong forum category.

I have attempted to search for some code samples to get me started, but am unable to find any. Can anyone help get me started? Any help is appreciated, thanks.

SparceMatrix
07-02-2006, 12:46 PM
Once you have the drivers for ODBC for MySQL, exporting from Excel is as easy as using the export feature of Excel itself. It uses the same drivers. That's the best way to judge if it is any easier than Access. Exporting into Excel can only be done from tables, of course. Any of the features of a relational database will not be preserved.

debauch
07-02-2006, 06:17 PM
hmm .. I am able to easily import SQL info, but I cannot find where in Excel to choose to export data? Is there somewhere in the menu to do this? I do have the driver set up.

Ken Puls
07-02-2006, 09:40 PM
Hi there,

I use ADO to send Export A Range Of Excel Data To A Database (http://excelguru.ca/node/18). The article in the link was built for Access, but there is a link to a full page of connection strings in the last line, so you should be able to easily change it to MySQL.


Don't know if it's exactly what you're after, but thought I'd throw it out there anyway. :)

debauch
07-03-2006, 09:51 AM
Definately a good start. Thank-you. I will review this material and let you know my outcome.

SparceMatrix
07-03-2006, 09:51 AM
hmm .. I am able to easily import SQL info, but I cannot find where in Excel to choose to export data? Is there somewhere in the menu to do this? I do have the driver set up.

Actually, I was thinking of importing rather than exporting. But, try the "Save As" function and there are delimited files as an optional file type and you may be able import the delimited file into MySQL where this is a pretty typical procedure, "LOAD DATA INFILE ... FIELDS TERMINATED BY ..."

Sorry 'bout that.