开发者

Connecting to MySQL through Excel by running a Macro

strSQL = "INSERT INTO [ODBC;DSN=DSNName;].NameOfMySQLTable (IndexCode,LastTradePrice) VALUES"

strSQL = strSQL & "Select F1,G1 As NameOfMySQLField FROM [Excel 8.0;DATABASE=" & strFile & ";HDR开发者_C百科=NO;IMEX=1].[Sheet1$];"

This is the query I write in MS Excel's macro. I have a database on server where I want this values to get inserted.

What is to be written in place of [ODBC;DSN=DSNName;].NameOfMySQLTable and in place of NameOfMySQLField?


You can find something here useful:

http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜