å³1
ãããã£ãŠã ããã¥ã¡ã³ãã§èª¬æãããŠããããã«ã Excelã§ãªã³ã¯ãµãŒããŒã䜿çšããããšãããšããšã©ãŒã¡ãã»ãŒãžMsg 7302ãã¬ãã«16ãç¶æ 1ãè¡1ãçºçããŸãã
ãªã³ã¯ãµãŒããŒã®OLE DBãããã€ããŒãMicrosoft.ACE.OLEDB.12.0ãã®ã€ã³ã¹ã¿ã³ã¹ãäœæã§ããŸãã...
ãäœããã¹ããããšããæ°žé ã®çåãçããŸããïŒ
ããŠãäœããã¹ããã ãã¡ããã64ããããããã€ããŒãé 眮ããŸãã ããïŒ Microsoft Access Database Engine 2010 Redistributable ïŒã¯ãAccessDatabaseEngine.exeãšAccessDatabaseEngine_x64.exeã®2ã€ã®éšåã§é åžãããŠããŸãã 64ãããçãããŠã³ããŒãããã€ã³ã¹ããŒã«ãå®è¡ããŠãããããšãååŸããŸãã
å³2
ã€ãŸãã64ãããã®SQL Serverã®è¿ãã«32ãããã®Officeããªãã£ãå ŽåãGdã®ããã«ãé«åºŠãªæè¡ãéçºãããŠãäœããã¹ãããæ確ã§ã¯ãããŸããã SQL ServerãExcelã¿ãã¬ããã«å ¥ããããã ãã«ã32ãããçã®Officeãç Žå£ãã代ããã«64ãããçãè¿œå ããã«ã¯ïŒ 64ãããã®SQL Serverãç Žå£ããåã32ãããã®ã¿ã眮ãæããã«ã¯ïŒ ç§ã¯ãããæè»ãªè§£æ±ºçã§ãããšã¯æããããã®ãããªæ©äŒãæã€ããšã¯åžžã«å¯èœã§ã¯ãããŸããã ããšãã°ã ç·æ§ãæžããŠããããã« ã MS AccessããŒã¿ããŒã¹ã¯é¡§å®¢ãµã€ãã®å®çšŒåç°å¢ã§ããããããåé€ããŠ64ãããããŒãžã§ã³ãã€ã³ã¹ããŒã«ããããšã¯ã§ããŸããã ãã¡ãããæ¢åã®SQL Server 64ããããåé€ããŠã32ãããããŒãžã§ã³ãã€ã³ã¹ããŒã«ããããšãã§ããŸããã ãã®å ŽåãMS Accessãžã®ãªã³ã¯ã®ã¿ãæäŸããSQL Server 32ãããã®è¿œå ã€ã³ã¹ããŒã«ãå¯äžã®ãªãã·ã§ã³ã«ãªããŸãã ããã¯éåžžã«æãããããšã§ãã 誀解ãå§ãŸããŸãã 64ãããã®Jetã¯ååšããªãããã64ãããããŒãžã§ã³ã®ãMicrosoft Access Database Engine 2010 RedistributableããããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããå¿ èŠããããŸãã - ãåçããã ãããããšãããããŸãããAccessDatabaseEngine_X64.exeãã€ã³ã¹ããŒã«ãããšã次ã®ãšã©ãŒã衚瀺ãããŸã ïŒå³1ãåç § ïŒ - ãã®KBèšäºãåç §ããŠãã ããïŒ support.microsoft.com/kb/2269468- ãªã³ã¯ã®èšäºæåŸã®ã¡ãã»ãŒãžã§ããã¹ãŠã®Office 32ããã補åãã¢ã³ã€ã³ã¹ããŒã«ããããã«æ瀺ãããŠããŸãã ç®æšã¯32ãããMS AccessããŒã¿ããŒã¹ã«æ¥ç¶ããããšã§ãããããããã¯æå³ããããŸãã ...-Accessãã¡ã€ã«ïŒ32ãããã«æ¥ç¶ããã«ã¯ããMicrosoft ACE OLEDB Providerãã®64ãããããŒãžã§ã³ãã€ã³ã¹ããŒã«ããå¿ èŠããã ãŸãã ãŸãã¯64ãããïŒSQL Serverããã - ãããã64ããããã©ã€ããŒãã€ã³ã¹ããŒã«ããããšããŸããããã€ã³ã¹ããŒã«ãšã©ãŒãçºçããŠããŸã...- åã®KBèšäºã§åå ã説æãã解決çãæäŸããŠããŸããåç §ã§ããŸãã - ããªãã¯ç§ãåã§æ¡å ããŠããŸãã
å®éãåé¡ã¯64ãããããŒãžã§ã³ã®Microsoft ACE OLEDBãããã€ããŒã32ããããªãã£ã¹ã®é£ã«åŒ·å¶çã«ã€ã³ã¹ããŒã«ããããšã§ãã ãªãé¡ã§ãããè¡ãããšãã§ããªãã®ãã¯å²åŠçãªåé¡ã§ããããã®äž»é¡ã«é¢ããŠå€ãã®ã³ããŒãå£ããŠããŸãã ããããã¢ããªã±ãŒã·ã§ã³ã®2ã€ã®ç°ãªãããŒãžã§ã³ãã³ã³ãã€ã«ããããšã匷å¶ã§ããªããšããäºå®ã 1ã€ã¯x86ãã©ãããã©ãŒã çšããã1ã€ã¯x64ãã©ãããã©ãŒã çšã§ãã 次ã«ãã€ã³ã¹ããŒã«ããã¢ããªã±ãŒã·ã§ã³ã®ããŒãžã§ã³ïŒ32ããããŸãã¯64ãããïŒããããããã«ãACEãã©ã€ããŒã®ã©ã®ããŒãžã§ã³ãã€ã³ã¹ããŒã«ãããŠããããäœããã®æ¹æ³ã§å€æããå¿ èŠããããŸãã ããã©ã«ãã®AnyCPUåãã«ã¢ããªãã³ã³ãã€ã«ãã32ãš64ã®äž¡æ¹ã®ããŒã¿ãããã€ããŒãã€ã³ã¹ããŒã«ã§ããããã«ããã°ã人çã¯ãã£ãšåçŽã«ãªããŸãã32ããããš64ãããã®ACEãå ±åã§ããªãã®ã¯ãªãã§ããïŒ - ããã¯ãMicrosoftã32ãããããã³64ãããã®Microsoft Office 2010ãŸãã¯ãããã®äŸåã³ã³ããŒãã³ãã®ãµã€ããã€ãµã€ãã€ã³ã¹ããŒã«ããµããŒãããŠããªããšããäºå®ã«åºã¥ããŠããŸã ...-ç³ãèš³ãããŸããããããã¯è³ªåã«å¯ŸããããŸãæçšãªçãã§ã¯ãããŸããã QïŒ32ãããçãš64ãããçã®Microsoft Access Database Engine 2010åé åžå¯èœããã±ãŒãžïŒAccessDatabaseEngine.exeããã³AccessDatabaseEngine_X64.exeïŒãåããã·ã³ã«ã€ã³ã¹ããŒã«ã§ããªãã®ã¯ãªãã§ããïŒ AïŒãã€ã¯ããœããã¯ã32ãããããã³64ãããã®Microsoft Office 2010ã®ãµã€ããã€ãµã€ãã€ã³ã¹ããŒã«ããµããŒãããŠããŸãããããã¯çãã§ã¯ãªããèšãæããã°è³ªåãç¹°ãè¿ããŠããã ãã§ãã QïŒãªããããã§ããªãã®ã§ããïŒ AïŒãµããŒãããŠããªãããã§ãã QïŒãªããµããŒãã§ããªãã®ã§ããïŒ AïŒãµããŒãããŠããªãããã§ãã
ç§ã®åé¿çãšããŠãAccessDatabaseEngine_X64.exeã®ã€ã³ã¹ããŒã«ã«/ããã·ãã¹ã€ããã䜿çšããŸãããããã«ããã64ãããããŒãžã§ã³ã®ãããã€ããŒã32ãããããŒãžã§ã³ã®OfficeãšäžŠã¹ãŠäœ¿çšã§ããŸãã ãã®æ¹æ³ã¯Microsoftã«ãã£ãŠå ¬åŒã«ãµããŒããããŠããªãããšã匷調ããå¿ èŠããããŸãããŸããéäºææ§ã«é¢ããåé¡ã®å¯èœæ§ã«é¢ããèŠåããããŸãã ãã©ã€ããŒAccessDatabaseEngine_x64.exeãã€ã³ã¹ããŒã«ãããšã MS Office Pro Plusã¯MSæ§æããã»ã¹ãéå§ããŸã ãããã¯ãããã¥ã¡ã³ããŸãã¯Officeããã°ã©ã ãéããŸã§ã«1ã2åãããããšããããŸã ã Office 2010 32ããããã€ã³ã¹ããŒã«ããã64ãããaceã/ passiveã§ã€ã³ã¹ããŒã«ãããŠããå ŽåãAccess 2010ãå®è¡ãããã³ã«**æ¯åãofficeã®32ããããã©ã€ããŒã«ãªã»ããããèªåã€ã³ã¹ããŒã«ã«ãŒãã³ãååŸãããŸã ã ç§ã®å ŽåïŒOffice 2013 Pro PlusãSQL Server 2012 Developer EdããWindows 8.1ïŒç®ã«èŠããåé¡ã¯ãŸã ãããŸããïŒpah-pah-pahïŒãããããåŒã³åºãããŠããã®ã¯ããã ãã§ãããããããªããã°çŸ©åã
AccessDatabaseEngine_x64.exe ãããŠã³ããŒããããã¹ãŠã®æ¶é²å£«ã«ã·ã¹ãã 埩å ãã€ã³ããäœæããŸãïŒãã ããç§ã®æèŠã§ã¯ãOfficeã³ã³ããŒãã³ããæŽæ°ãããšããšã«ããèªåçã«äœæãããŸãïŒãã³ãã³ãã©ã€ã³ããé 眮ããŸãã å¯èœãªããŒã¯æ¬¡ã®ãšããã§ãã
å³3
å³4
å³2ãšã¯ç°ãªããã€ã³ã¹ããŒã«ãéå§ãããŸã
å³5
ã©ããã§30åã§ä¹Ÿãããããžãã¹ã®ããã«ããã¡ã³ãã¡ãŒã¬ããOKãæ声ããèµ·ãããªã©ããããŸããã ã¹ãããšã¯äœããèŠãŠã¿ãŸãããã å³1ã§ã¯ããããã€ããŒã®ã³ã³ããã¹ãã¡ãã¥ãŒãããæŽæ°ããšèšãã圌ããèšãããã«ãéããæããŠããŸãã
å³6
ããã¯ã€ã³ã¹ãã¬ãŒã·ã§ã³ãäžããŸãã ç°¡åãªxslxãããã«ä¹±ããŸããïŒ
å³7
SQL Serverã§ããã®Excelãžã®ãªã³ã¯ãµãŒããŒãäœæããŸãã
if exists (select 1 from sys.servers where name = 'XlsLnkSrv') exec sp_dropserver @server = 'XlsLnkSrv', @droplogins = 'droplogins' exec sp_addlinkedserver @server = 'XlsLnkSrv', @srvproduct = 'ACE 12.0', @provider = 'Microsoft.ACE.OLEDB.12.0', @datasrc = 'C:\Temp\Sample.xlsx', @provstr = 'Excel 12.0; HDR=Yes'
ã¹ã¯ãªãã1
ãããŠãç§ãã¡ã¯æ¬¡ã®ããã«èªã¿ãŸãïŒ
select * from openquery (XlsLnkSrv, 'Select * from [Sheet1$]')
ã¹ã¯ãªãã2
ãŽãŒã«ïŒ ããããã€ããžã¯ïŒ
ã¡ãã»ãŒãž7399ãã¬ãã«16ãç¶æ 1ãè¡1
ãªã³ã¯ãµãŒã㌠"XlsLnkSrv"ã®OLE DBãããã€ã㌠"Microsoft.ACE.OLEDB.12.0"ããšã©ãŒãå ±åããŸããã ãããã€ããŒã¯ãšã©ãŒã«é¢ããæ å ±ãæäŸããŸããã§ããã
ã¡ãã»ãŒãž7303ãã¬ãã«16ãç¶æ 1ãè¡1
ãªã³ã¯ãµãŒã㌠"XlsLnkSrv"ã®OLE DBãããã€ã㌠"Microsoft.ACE.OLEDB.12.0"ã®ããŒã¿ãœãŒã¹ãªããžã§ã¯ããåæåã§ããŸããã
ããããïŒExcelãéããã®ãå¿ããŠããŸããïŒãŸã ç®æšã§ãïŒ
å³8
åæ§ã«
select * from openrowset('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=C:\Temp\Sample.xlsx;HDR=Yes', 'Select * from [Sheet1$]')
ãããã圌女ã®ããã«ïŒå¿µã®ããã«ãç§ã¯ããªãã«æãåºãããïŒããªãã¯æåã«ããªããã°ãªããŸãã
exec sp_configure 'show advanced options', 1; reconfigure; exec sp_configure 'Ad Hoc Distributed Queries', 1; reconfigure
ã¹ã¯ãªãã3
çµè«ãšããŠã64ããããããã€ããŒã¯32ããããããã€ããŒãšäžŠãã§ããªãã£ããããããããèªäœã«çœ®ãæããããšã«æ³šæããå¿ èŠããããããããšãã°ãBIãããžã§ã¯ãã®SQL ServerããŒã¿ããŒã«ïŒä»¥åã®BIDSïŒã§Integration Servicesãªãã£ã¹ãšã®é£æºãæåŠããŸãïŒ åãSample.xslsxã®DTSããã±ãŒãžã®ããŒã¿ãããŒã§æ¥ç¶ãäœæãããšãMicrosoft Office 12.0 AccessããŒã¿ããŒã¹ãšã³ãžã³OLE DBãããã€ããŒã®åæåã§ãšã©ãŒãçºçããŸããããã¯ãdevenv.exeã32ãããã§ãããã€ããŒã64ãããã§ããããè«ççã§ãã åäœãè¿ãã«ã¯ã32ããããªãã£ã¹ãããã€ããŒã埩å ããå¿ èŠããããŸãïŒ ãããã ïŒãããªã³ã¯ãµãŒããŒã¯å¥ããŸãã ãªã³ã¯ãµãŒããŒãæ©èœãããã«ã¯ãèšäºã®åé ãã芧ãã ããã ãã®ãããªãã®ã çŸåšãæ§ãããªããŒãºã¯Excelãžã®ã¢ã¯ã»ã¹ã«éå®ãããŠããŸããã ããšãã°ãAccessããŒã¿ããŒã¹ã§ã®åäœããã¹ãããŠããŸããã ç¬ç«ããæŒç¿ãšããŠèªè ã«æäŸãããŸãã æ¥ç¶ã«é¢ããæ å ±ããå€æãããšãç¹æã®å ŽããããŸãã