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/
精彩评论