Re: Can't insert data to MS Access 2003
- From: "dale zhang" <dalezhang@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 14 Aug 2005 14:26:02 -0700
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
>
>
>
.
- Follow-Ups:
- Re: Can't insert data to MS Access 2003
- From: Robbe Morris [C# MVP]
- Re: Can't insert data to MS Access 2003
- References:
- Can't insert data to MS Access 2003
- From: dale zhang
- Re: Can't insert data to MS Access 2003
- From: Robbe Morris [C# MVP]
- Can't insert data to MS Access 2003
- Prev by Date: Re: Should I explicitly initialize all member variables?
- Next by Date: Re: Windows Services
- Previous by thread: Re: Can't insert data to MS Access 2003
- Next by thread: Re: Can't insert data to MS Access 2003
- Index(es):
Relevant Pages
|