If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Excel to MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-06, 14:42
Daniel_Cooper Daniel_Cooper is offline
Registered User
 
Join Date: Oct 2005
Posts: 15
Excel to MySQL

Hi Guys,

I want to transfer data from excel and dump it in MySql using VB.

(1) Is this possible (2) Is this a difficult process (3) Any one may have sample code they can share

Please help me out here.

Thanks,

Daniel
Reply With Quote
  #2 (permalink)  
Old 02-06-06, 21:31
jfulton jfulton is offline
Registered User
 
Join Date: Apr 2005
Location: Baltimore, MD
Posts: 297
Without VB, you would just export the excel file to a csv file and read it into MySQL.

It's been a while since I've used VB, but if you can open a datasource via ODBC (which I think you can), this can probably be done pretty easily.
Reply With Quote
  #3 (permalink)  
Old 02-07-06, 02:52
sandhya_pn sandhya_pn is offline
Registered User
 
Join Date: Feb 2006
Posts: 5
Use OLEDB to connect to the excel.
Connection string:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

"HDR=Yes;" indicates that the first row contains columnnames, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text

E.g
"SELECT * FROM [sheet1$]"
The worksheet name should be followed by a $
You can then read from the excel (as from a table ) using a recordset
and push the data into the required destination.
I hope this might help you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On