Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Insert 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I am trying to insert records using the code below.. I get an error message saying "must use an updatable query" can someone tell me whats wrong with the code?

Dim DBCommand As OleDb.OleDbDataAdapter
Dim DBInsert As New OleDb.OleDbCommand()

Dim dbconn As New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Server.MapPath("Database.mdb;"))
DBInsert.CommandText = "INSERT INTO table(Field) VALUES ('" & txt.Text & "')"

DBInsert.Connection = dbconn
DBInsert.Connection.Open()
DBInsert.ExecuteNonQuery()
DBInsert.Connection.Close()

Thanks


 
Probably don't have write permissions on the directory where the database is.

Ensure that the ASPNET user on the local machine where the app is running has "Modify" permissions (NTFS) on the folder, and see if that clears it up.
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top