Access 97 Provider for ADO.NET 2.0

G

Guest

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
 
G

Guest

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 said:
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 said:
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
 
G

Guest

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 said:
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 said:
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 said:
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
 
G

Guest

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

dhussong said:
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 said:
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 said:
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/

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top