开发者

Connecting to MySQL through Excel by running a Macro

开发者 https://www.devze.com 2023-02-17 19:54 出处:网络
strSQL = \"INSERT INTO [ODBC;DSN=DSNName;].NameOfMySQLTable (IndexCode,LastTradePrice) VALUES\" strSQL = strSQL & \"Select F1,G1 As NameOfMySQLField FROM [Excel 8.0;DATABASE=\" & strFile &
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

精彩评论

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