Access Update

Results 1 to 2 of 2

Thread: Access Update

  1. #1
    Join Date
    Dec 1969

    Default Access Update

    I&#039;m trying to build a simple SQL_Helper class that i can send basic update, insert and delete SQL commands to but am having a bit of a problem,<BR><BR>This is my helper class.<BR><BR>Public Sub ExecuteNonQuery(ByVal strSQL As String)<BR> Dim cmd As New OleDbCommand()<BR> Dim DBHelper As New CdbAccessBL()<BR> cmd.Connection = DBHelper.GetOleDbConnection() &#039;gets the dbconnection<BR> cmd.CommandText = strSQL.ToString<BR> cmd.CommandType = CommandType.Text<BR> cmd.ExecuteNonQuery()<BR> cmd.Connection.Close()<BR>End Sub<BR><BR><BR>And this is how i call it.<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR><BR> Dim strSQL As String<BR> Dim helper As New SQL_Helper()<BR> strSQL = "UPDATE admin set username = &#039; garry &#039; WHERE adminID = 1"<BR> helper.ExecuteNonQuery(strSQL)<BR> End Sub<BR><BR>i get the following error<BR><BR>Operation must use an updateable query.<BR><BR><BR>I have constructed a similar class that returns an OleDbDataReader and that works fine.

  2. #2
    Join Date
    Dec 1969

    Default RE: Access Update

    You have to set file permissions to update Access, among other things:<BR><BR><BR><BR>The moral of the story is to not use Access if at all possible.<BR><BR>Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts