473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MS Access trouble

Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb Jet
4 provider.
However, whenever I issue and INSERT INTO statement I get the exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to
Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...
Nov 19 '05 #1
6 1181
Give the ASP.NET account read/write/change permissions
over the c:\inetpub\wwwroot\mysite\db\ directory.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in message
news:uQ**************@TK2MSFTNGP15.phx.gbl...
Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb Jet 4 provider.
However, whenever I issue and INSERT INTO statement I get the exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...

Nov 19 '05 #2
Wessam Bahnassi wrote:
Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb Jet
4 provider.
However, whenever I issue and INSERT INTO statement I get the exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to
Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...

Wessam,

I think you need tick marks around your string literals:
(win32,sci,mr) should be ('win32','sci','mr')

--
Rob Schieber
Nov 19 '05 #3
Sorry if it is too obvious, but how do you grant the ASP.NET account these
permissions?

Thanks a lot!

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Give the ASP.NET account read/write/change permissions
over the c:\inetpub\wwwroot\mysite\db\ directory.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in
message news:uQ**************@TK2MSFTNGP15.phx.gbl...
Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb
Jet 4 provider.
However, whenever I issue and INSERT INTO statement I get the exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to
Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...


Nov 19 '05 #4
Right-click on the folder containing the database and change the
security settings to read, write, modify, or whatever combination you
need to complete the task.

---
"Our enemies are innovative and resourceful, and so are we. They never
stop thinking of ways to harm our country and our people, and neither do
we." President George W. Bush

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #5
From within Windows Explorer, right-click the directory
and select the "Properties" link; then select the "Security" tab.

If you don't see a "Security" tab, you might be running FAT32
( hopefully not... ) and you might need to convert your file system
to NTFS.

FAT32 file systems don't allow setting ACLs.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in message
news:OX*************@tk2msftngp13.phx.gbl...
Sorry if it is too obvious, but how do you grant the ASP.NET account these permissions?

Thanks a lot! "Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Give the ASP.NET account read/write/change permissions
over the c:\inetpub\wwwroot\mysite\db\ directory.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in message
news:uQ**************@TK2MSFTNGP15.phx.gbl...
Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb Jet 4
provider.
However, whenever I issue and INSERT INTO statement I get the exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...

Nov 19 '05 #6
Thanks to all of ya guys. No I'm running NTFS, and I setup the permissions
and everything is now running file...

Thanks again :)

--
Wessam Bahnassi
Microsoft DirectX MVP,
Lead Programmer
In|Framez
--
In|Structurez Arabic Gamedev Community
wwww.instructurez.com
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:O%****************@TK2MSFTNGP09.phx.gbl...
From within Windows Explorer, right-click the directory
and select the "Properties" link; then select the "Security" tab.

If you don't see a "Security" tab, you might be running FAT32
( hopefully not... ) and you might need to convert your file system
to NTFS.

FAT32 file systems don't allow setting ACLs.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in
message news:OX*************@tk2msftngp13.phx.gbl...
Sorry if it is too obvious, but how do you grant the ASP.NET account
these permissions?

Thanks a lot!

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Give the ASP.NET account read/write/change permissions
over the c:\inetpub\wwwroot\mysite\db\ directory.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Wessam Bahnassi" <wb*******@inframez.org.use_dot_com_instead> wrote in
message news:uQ**************@TK2MSFTNGP15.phx.gbl...
Greetings,

I'm trying to insert values into an MDB with ASP.NET 1.1, and the OleDb
Jet 4 provider.
However, whenever I issue and INSERT INTO statement I get the
exception:
"Operation must use an updateable query."

This is my code:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";
connString += Server.MapPath("db\\records.mdb");
connString += ";"
OleDbConnection connection = new OleDbConnection(connString);
connection.Open();

OleDbCommand dbCmd = new OleDbCommand("INSERT INTO DSKSB_Demos ",conn);
dbCmd.CommandText += "(Platform,Company,Title) VALUES (win32,sci,mr)";
dbCmd.ExecuteNonQuery(); // Exception...
conn.Close();

If I only read data then no errors occur. The MDB file is not set to
Read-only.
It's a normal file put in c:\inetpub\wwwroot\mysite\db

How can I overcome this exception?
Thanks for any help...


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
7
by: John Thomas Smith | last post by:
I have Access 97 on a computer with Windows XP at SP1 level The policy where I work is to have Windows AutoUpdate ON, but I have mine set to OFF until I find out if there are problems with...
10
by: nick_faye | last post by:
Hi guys, i'm still a newbie in using MS Access and in VB programming. I am using DAO connection from my VB to access the entries on my MS Access table. I am having trouble in editting and...
55
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike...
49
by: Mell via AccessMonster.com | last post by:
I created databases on Access 2003 and I want to deploy them to users. My code was also done using 2003. If they have Ms Access 2000 or higher, will they be able to use these dbs with all code,...
10
by: NEWSGROUPS | last post by:
I work for an organization that is migrating from Access 2000 to Access 2003. About 5 or 6 years ago we migrated from Access 97 to Access 2000 with no problem. Will I have trouble converting these...
4
by: seryozha | last post by:
Hello, I'm wonder if a relational database is what i need based on the data i will be entering. Our company will have the following data entered: Customer Part Press Date Operation
2
by: gellis72 | last post by:
I'm working on a program that imports a bunch of data from a folder full of Excel files and compiles it into an Access DB. The Excel files have a varying number of rows and columns that need to be...
17
by: ARC | last post by:
I've dealt with blue screens that frequently occur while developing in MS Access (really bad in Access 97, not quite as bad in later versions of Access). Finally, I had a blue screen that mentioned...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.