|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Access 97 Provider for ADO.NET 2.0I'm building a .NET 2.0 app (C#) that needs to connect to an Access 97
database. I'm planning to use the Enterprise Library 2.0 Data classes to make things easier. I can't figure out the correct configuration to use to allow ADO.NET to connect to an Access database. This is my connection string from App.config. It doesn't like my providerName value. Can someone help me out with the correct value? <add name="Connection String" connectionString="Data Source=C:\SaddleUp\Horseshow.mdb;" providerName="Microsoft.Jet.OLEDB.4.0" /> Thanks, Ian
http://www.connectionstrings.com/ is your friend.
-- Show quoteMiha Markic [MVP C#] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "R. Ian Lee" <RIan***@discussions.microsoft.com> wrote in message news:D94B8390-9DD5-402F-B0CB-FDD841BA3A81@microsoft.com... > I'm building a .NET 2.0 app (C#) that needs to connect to an Access 97 > database. I'm planning to use the Enterprise Library 2.0 Data classes to > make things easier. I can't figure out the correct configuration to use > to > allow ADO.NET to connect to an Access database. This is my connection > string > from App.config. It doesn't like my providerName value. Can someone help > me > out with the correct value? > > <add name="Connection String" > connectionString="Data Source=C:\SaddleUp\Horseshow.mdb;" > providerName="Microsoft.Jet.OLEDB.4.0" /> > > Thanks, > > Ian Nice site. Unfortunately, it tells me to use the same thing that I have been
trying. I think the ProviderName must have to be different. Thanks. Show quote "Miha Markic [MVP C#]" wrote: > http://www.connectionstrings.com/ is your friend. > > -- > Miha Markic [MVP C#] > RightHand .NET consulting & development www.rthand.com > Blog: http://cs.rthand.com/blogs/blog_with_righthand/ > > "R. Ian Lee" <RIan***@discussions.microsoft.com> wrote in message > news:D94B8390-9DD5-402F-B0CB-FDD841BA3A81@microsoft.com... > > I'm building a .NET 2.0 app (C#) that needs to connect to an Access 97 > > database. I'm planning to use the Enterprise Library 2.0 Data classes to > > make things easier. I can't figure out the correct configuration to use > > to > > allow ADO.NET to connect to an Access database. This is my connection > > string > > from App.config. It doesn't like my providerName value. Can someone help > > me > > out with the correct value? > > > > <add name="Connection String" > > connectionString="Data Source=C:\SaddleUp\Horseshow.mdb;" > > providerName="Microsoft.Jet.OLEDB.4.0" /> > > > > Thanks, > > > > Ian > > > Try using just Provider instead of providerName. In my code I use
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SaddleUp\Horseshow.mdb" and it works. My mdb file is version 2000 but I doubt that matters. Show quote "R. Ian Lee" wrote: > Nice site. Unfortunately, it tells me to use the same thing that I have been > trying. I think the ProviderName must have to be different. > > Thanks. > > "Miha Markic [MVP C#]" wrote: > > > http://www.connectionstrings.com/ is your friend. > > > > -- > > Miha Markic [MVP C#] > > RightHand .NET consulting & development www.rthand.com > > Blog: http://cs.rthand.com/blogs/blog_with_righthand/ > > > > "R. Ian Lee" <RIan***@discussions.microsoft.com> wrote in message > > news:D94B8390-9DD5-402F-B0CB-FDD841BA3A81@microsoft.com... > > > I'm building a .NET 2.0 app (C#) that needs to connect to an Access 97 > > > database. I'm planning to use the Enterprise Library 2.0 Data classes to > > > make things easier. I can't figure out the correct configuration to use > > > to > > > allow ADO.NET to connect to an Access database. This is my connection > > > string > > > from App.config. It doesn't like my providerName value. Can someone help > > > me > > > out with the correct value? > > > > > > <add name="Connection String" > > > connectionString="Data Source=C:\SaddleUp\Horseshow.mdb;" > > > providerName="Microsoft.Jet.OLEDB.4.0" /> > > > > > > Thanks, > > > > > > Ian > > > > > > Thanks for your reply. I had already figured out the solution, however. The
biggest part of what I was doing wrong was using the wrong providerName. The code that works for me is as below: <add name="Connection String" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\My Data\Ian's Data\JS Data\SaddleUp\Horseshow.mdb;" providerName="System.Data.OleDb" /> Thanks again, Ian Show quote "dhussong" wrote: > Try using just Provider instead of providerName. In my code I use > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SaddleUp\Horseshow.mdb" and > it works. My mdb file is version 2000 but I doubt that matters. > > "R. Ian Lee" wrote: > > > Nice site. Unfortunately, it tells me to use the same thing that I have been > > trying. I think the ProviderName must have to be different. > > > > Thanks. > > > > "Miha Markic [MVP C#]" wrote: > > > > > http://www.connectionstrings.com/ is your friend. > > > > > > -- > > > Miha Markic [MVP C#] > > > RightHand .NET consulting & development www.rthand.com > > > Blog: http://cs.rthand.com/blogs/blog_with_righthand/ > > > > > > "R. Ian Lee" <RIan***@discussions.microsoft.com> wrote in message > > > news:D94B8390-9DD5-402F-B0CB-FDD841BA3A81@microsoft.com... > > > > I'm building a .NET 2.0 app (C#) that needs to connect to an Access 97 > > > > database. I'm planning to use the Enterprise Library 2.0 Data classes to > > > > make things easier. I can't figure out the correct configuration to use > > > > to > > > > allow ADO.NET to connect to an Access database. This is my connection > > > > string > > > > from App.config. It doesn't like my providerName value. Can someone help > > > > me > > > > out with the correct value? > > > > > > > > <add name="Connection String" > > > > connectionString="Data Source=C:\SaddleUp\Horseshow.mdb;" > > > > providerName="Microsoft.Jet.OLEDB.4.0" /> > > > > > > > > Thanks, > > > > > > > > Ian > > > > > > > > > |
|||||||||||||||||||||||