Re: Can't insert data to MS Access 2003

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



thank you for the suggestions. The 1st 2 questions are not the case.

I am using asp.net. this does ring my bell. when i learnt .net, we used sql
DB. I recall we needed to add some writeable options in sql manager.

But I am using MS access now, how do I add writeable options?

-Dale
"Robbe Morris [C# MVP]" wrote:

> Do you have write permissions on the folder? Is the database file read
> only?
>
> These are the two most likely reasons you are getting this error.
> Particularly
> if you are running this via an ASP.NET application because the http
> request is not run under your windows account by default.
>
> --
> Robbe Morris - 2004/2005 Microsoft MVP C#
>
> Earn money answering .NET Framework
> messageboard posts at EggHeadCafe.com.
> http://www.eggheadcafe.com/forums/merit.asp
>
>
>
> "dale zhang" <dalezhang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:362AA030-D46B-4EAD-BC52-CE4B9E51A053@xxxxxxxxxxxxxxxx
> > Hi,
> >
> > I have a C# application with MS access 2003 as DB for password protection.
> > The DB has two tables: one is Logins, the other Visits.
> >
> > When I do the reading as below:
> > SELECT Password FROM Logins WHERE Username ='dale'
> >
> > it is a success.
> > INSERT INTO Visits (Email,LoginDate,ReferPage,LoginOK,LoginPass,IP) VALUES
> > ('dale',#8/13/2005 11:46:41
> > AM#,'/passwordProtectCSharp/privatePage.aspx',1,'dale1','127.0.0.1')
> >
> > it always gives me an exception as below:
> > Operation must use an updatable query.
> >
> > The codes are:
> > try
> > {
> > // write the visit log entry
> > dbConn = new OleDbConnection(sConn);
> > dbConn.Open();
> > dbCmd = new OleDbCommand(sSQL, dbConn);
> > dbCmd.ExecuteNonQuery();
> > }
> > catch (Exception e)
> > {
> > Debug.WriteLine(e.Message);
> > }
> > when I write the DB as below:
> >
> > I want to run the "insert" in MS access separately for testing, can not
> > find
> > a way to do so. Any suggestions are welcome. -Dale
>
>
>
.



Relevant Pages

  • Re: Cant insert data to MS Access 2003
    ... > I have a C# application with MS access 2003 as DB for password protection. ... > The DB has two tables: one is Logins, ... > it always gives me an exception as below: ... > dbConn = new OleDbConnection; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Cant insert data to MS Access 2003
    ... > I have a C# application with MS access 2003 as DB for password protection. ... > The DB has two tables: one is Logins, ... > it always gives me an exception as below: ... > dbConn = new OleDbConnection; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Cant insert data to MS Access 2003
    ... "Octavio Hernandez" wrote: ... >> I have a C# application with MS access 2003 as DB for password protection. ... >> The DB has two tables: one is Logins, ... >> it always gives me an exception as below: ...
    (microsoft.public.dotnet.languages.csharp)
  • Cant insert data to MS Access 2003
    ... I have a C# application with MS access 2003 as DB for password protection. ... one is Logins, ... The codes are: ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)