inserting data into a database

  • Thread starter Thread starter dana livni
  • Start date Start date
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.
 
Typically, this is a file permissions problem. Ensure that the
machine\aspnet account has write permissions on this Access database.
 
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.
 
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.
 
Back
Top