开发者

import data from a word file to populate tables in a mysql database

开发者 https://www.devze.com 2023-03-16 00:48 出处:网络
Can i import data from a MS w开发者_StackOverflow社区ord document to populate tables in a mysql database.if yes can anybody provide any links to achieve thisYes you can.There are a lot of different wa

Can i import data from a MS w开发者_StackOverflow社区ord document to populate tables in a mysql database.if yes can anybody provide any links to achieve this


Yes you can. There are a lot of different ways you might go about doing that, though, depending on what operating system you're using and what languages you're comfortable with.

If you're on Windows the simplest thing might be to use VBA (Visual Basic for Applications). You can write a little program in VBA which will: 1. open the Word document (perhaps first prompt the user to enter the name of the document) 2. Open a connection to the MySQL database using the Visual Basic ADO library 3. Read through the Word doc and, for each chunk of data you want to put in the database, execute an ADO command to do that.

Here's a link on the MySQL forums which might help you. It refers to an Excel file instead of a Word doc but it's very similar: http://forums.mysql.com/read.php?10,100302

You could also do this with Perl (using a CPAN OLE library) or just about any other language.

0

精彩评论

暂无评论...
验证码 换一张
取 消