使用 Microsoft 登入
登入或建立帳戶。
您好:
選取其他帳戶。
您有多個帳戶
選擇您要用來登入的帳戶。

Excel 試算表可匯入 Excel ODBC 介面透過使用 rxImport 的 XDF 檔案。指定已安裝的 Excel ODBC 驅動程式,並設定在 Windows 上,用來匯入工作表是"Sheet1","C:/Data/ODBCTest.xlsx"的活頁簿的程式碼範例︰

#Define ODBC connection string.connectionStr <- "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DriverId=790;Dbq=C:/Data/ODBCTest.xlsx;DefaultDir=c:/Data;"

#Define ODBC query into workbook. The worksheet name must be followed by '$' and enclosed in [].
testExcel = "SELECT * FROM [Sheet1$]"

#Define ODBC data source for the import using the query and connection string.
excelDS<- RxOdbcData(sqlQuery = testExcel, connectionString=connectionStr)

#Define input workbook and output xdf file.
excelDS_XDF<- RxXdfData("testFromExcel.xdf")

#Import the workbook into the XDF
rxImport(excelDS, excelDS_XDF, overwrite=TRUE)

需要更多協助嗎?

想要其他選項嗎?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

這項資訊有幫助嗎?

您對語言品質的滿意度如何?
以下何者是您會在意的事項?
按下 [提交] 後,您的意見反應將用來改善 Microsoft 產品與服務。 您的 IT 管理員將能夠收集這些資料。 隱私權聲明。

感謝您的意見反應!

×