Home All Groups Group Topic Archive Search About

Access connection string

Author
11 Dec 2004 8:43 PM
Mike
I'm developing an ASP.NET application in C#. I am storing my database
connection string in the web.config file. If I set the string to connect to a
SQL Server DB everything works fine, but I need to be able to connect to an
MS Access DB. This is is from my webconfig:

<appSettings>
   <add key="ConnectString" value="FIL=MS Access;DSN=CWAcal;" />
</appSettings>

When I try to run the app with this connection string I get an exception
error at the point where I am executing the transaction:
     " Keyword not supported: 'fil' "

I have fairly extensive experience working with VB and SQL Server. This
however is one of my first C# apps as well as I have limited experience
working with Access, so I assume there is something that I just don't get
yet. Can someone please give me a clue as to what I am doing wrong?

Author
11 Dec 2004 9:28 PM
Miha Markic [MVP C#]
Hi Mike,

See this useful site
http://www.connectionstrings.com/

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

Show quote
"Mike" <M***@discussions.microsoft.com> wrote in message
news:5DA2E1A2-09D8-4699-B0C8-6B7D7900EE7E@microsoft.com...
> I'm developing an ASP.NET application in C#. I am storing my database
> connection string in the web.config file. If I set the string to connect
> to a
> SQL Server DB everything works fine, but I need to be able to connect to
> an
> MS Access DB. This is is from my webconfig:
>
> <appSettings>
>   <add key="ConnectString" value="FIL=MS Access;DSN=CWAcal;" />
> </appSettings>
>
> When I try to run the app with this connection string I get an exception
> error at the point where I am executing the transaction:
>     " Keyword not supported: 'fil' "
>
> I have fairly extensive experience working with VB and SQL Server. This
> however is one of my first C# apps as well as I have limited experience
> working with Access, so I assume there is something that I just don't get
> yet. Can someone please give me a clue as to what I am doing wrong?
Author
12 Dec 2004 9:37 PM
Mary Chipman
I assume you're using the OleDb provider, so you'll need an OleDb
connection string, not an ODBC DSN connection string.

--Mary

On Sat, 11 Dec 2004 12:43:02 -0800, "Mike"
<M***@discussions.microsoft.com> wrote:

Show quote
>I'm developing an ASP.NET application in C#. I am storing my database
>connection string in the web.config file. If I set the string to connect to a
>SQL Server DB everything works fine, but I need to be able to connect to an
>MS Access DB. This is is from my webconfig:
>
><appSettings>
>   <add key="ConnectString" value="FIL=MS Access;DSN=CWAcal;" />
></appSettings>
>
>When I try to run the app with this connection string I get an exception
>error at the point where I am executing the transaction:
>     " Keyword not supported: 'fil' "
>
>I have fairly extensive experience working with VB and SQL Server. This
>however is one of my first C# apps as well as I have limited experience
>working with Access, so I assume there is something that I just don't get
>yet. Can someone please give me a clue as to what I am doing wrong?

AddThis Social Bookmark Button