Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO from .xls to .xlsm file - "Unrecognized database format" e
Thanks Bob, I'm still not really sure where I was going wrong - it may have
been in the format of the connection string, but when I copied yours it worked ok and got me past this blockage. Thanks for the help! "Bob Phillips" wrote: This works okay for me cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ "Extended Properties=Excel 8.0;" -- __________________________________ HTH Bob "Tara H" wrote in message ... I'm trying to use ADO to pull data from a .xls file into a .xlsm file in Excel 2007. Whatever I do gives me the error: Run-time error '-2147467259 (80004005)': Unrecognized database format I've searched for this and found some results relating to corrupted files, but I doubt this can be the case - I've tried it with a number of different input files and even created one by hand from scratch to test with. I've tried many different samples of code that I've found on this forum, and each of them gives the same error at the 'cn.open' point. The connection string I'm currently using is: cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\temp\testbook.xls;" I'm not entirely sure if I'm using the right driver and references, since I haven't been able to find an example of my exact situation. Any guidance would be very gratefully received - I've been tearing my hair out over this and making no progress! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO from .xls to .xlsm file - "Unrecognized database format" e
You were trying to use the Microsoft.ACE.OLEDB.12.0 OLE DB provider, I must
admit I haven't come across that one before. -- __________________________________ HTH Bob "Tara H" wrote in message ... Thanks Bob, I'm still not really sure where I was going wrong - it may have been in the format of the connection string, but when I copied yours it worked ok and got me past this blockage. Thanks for the help! "Bob Phillips" wrote: This works okay for me cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ "Extended Properties=Excel 8.0;" -- __________________________________ HTH Bob "Tara H" wrote in message ... I'm trying to use ADO to pull data from a .xls file into a .xlsm file in Excel 2007. Whatever I do gives me the error: Run-time error '-2147467259 (80004005)': Unrecognized database format I've searched for this and found some results relating to corrupted files, but I doubt this can be the case - I've tried it with a number of different input files and even created one by hand from scratch to test with. I've tried many different samples of code that I've found on this forum, and each of them gives the same error at the 'cn.open' point. The connection string I'm currently using is: cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\temp\testbook.xls;" I'm not entirely sure if I'm using the right driver and references, since I haven't been able to find an example of my exact situation. Any guidance would be very gratefully received - I've been tearing my hair out over this and making no progress! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ADO from .xls to .xlsm file - "Unrecognized database format" e
It seems to be the one to use for opening the 2007 files - after getting your
example to work I tweaked it for a while and it's now working correctly with: "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=" & SourceFile & ";" & _ "Extended Properties=Excel 12.0 Xml;" for .xlsx files and "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & SourceFile & ";" & _ "Extended Properties=""Excel 8.0;HDR=Yes"";" for .xls files. The sample I had at the beginning seemed to imply that which one to use depended on which version of Excel you were pulling the data _into_, but my experimenting revealed that it was the _source_ that was important. This may be obvious to people familiar with ADO, but maybe this will be useful to someone like me who's just starting with it :) Thanks again for getting me on the right track. _________________ "Bob Phillips" wrote: You were trying to use the Microsoft.ACE.OLEDB.12.0 OLE DB provider, I must admit I haven't come across that one before. -- __________________________________ HTH Bob "Tara H" wrote in message ... Thanks Bob, I'm still not really sure where I was going wrong - it may have been in the format of the connection string, but when I copied yours it worked ok and got me past this blockage. Thanks for the help! "Bob Phillips" wrote: This works okay for me cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ "Extended Properties=Excel 8.0;" -- __________________________________ HTH Bob "Tara H" wrote in message ... I'm trying to use ADO to pull data from a .xls file into a .xlsm file in Excel 2007. Whatever I do gives me the error: Run-time error '-2147467259 (80004005)': Unrecognized database format I've searched for this and found some results relating to corrupted files, but I doubt this can be the case - I've tried it with a number of different input files and even created one by hand from scratch to test with. I've tried many different samples of code that I've found on this forum, and each of them gives the same error at the 'cn.open' point. The connection string I'm currently using is: cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\temp\testbook.xls;" I'm not entirely sure if I'm using the right driver and references, since I haven't been able to find an example of my exact situation. Any guidance would be very gratefully received - I've been tearing my hair out over this and making no progress! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Excel Discussion (Misc queries) | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Setting up and Configuration of Excel | |||
Run Time Error 3343 - Unrecognized database format: | Excel Programming | |||
Self-Contained "Database" file? | Excel Programming | |||
How Can I Update the database file from "Excel" and Built the ent. | Excel Programming |