inserting data into a database

D

dana livni

i'm trying to insert data into a database.

this is what i wrote:

<%@ import namespace="system.data" %>
<%@ import namespace="system.data.oledb" %>
dim objconn as new oledbconnection("provider=microsoft.jet.oledb.4.0;"
& "data source=C:\Inetpub\wwwroot\asp.net\1.mdb")

objconn.open
dim myinsert as new oledbcommand ("INSERT INTO table(company)
VALUES('dana')", objconn)

myinsert.executenonquery
objconn.close

and i get this error - "Operation must use an updateable query."

what am i doing wrong.
 
C

Chris Jackson

Typically, this is a file permissions problem. Ensure that the
machine\aspnet account has write permissions on this Access database.
 
K

Kevin Spencer

No question is stupid if you don't know the answer to it! ASP.Net poerates
under a user account on the system on which it runs. In Windows Server 2003
this is the W3WP account. On earlier operating systems. it is the ASPNET
account. In your file system, you have to find the folder in which your .mdb
file resides, right-click that folder, go to the Security tab, and grant
"Modify" permission to that account.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
D

dana livni

thank you very much, now it works.

Kevin Spencer said:
No question is stupid if you don't know the answer to it! ASP.Net poerates
under a user account on the system on which it runs. In Windows Server 2003
this is the W3WP account. On earlier operating systems. it is the ASPNET
account. In your file system, you have to find the folder in which your .mdb
file resides, right-click that folder, go to the Security tab, and grant
"Modify" permission to that account.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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