Updating access fields asp

Open() Dim cmd As New Ole Db Command(sql, odbcon Banking) cmd.

Map Path("Banking.mdb") Dim odbcon Banking As New Ole Db Connection _ ("Provider=Microsoft. OLEDB.4.0;" & _ "Data Source=" path String) Dim sql As String sql = "UPDATE tbl Accounts balance = " & CDbl(balance value) & " WHERE(account ID = " & account ID & ")" odbcon Banking.

If you omit the WHERE clause, all records in the table will be updated!

Execute Non Query() You are missing SET as part of UPDATE. I will suggest reading some docs on and how to design applications in a layered manner.

On a side note, you are using classic asp style code inside

Recall that to support inserting, updating, and deleting, with the Object Data Source we needed to specify the object layer methods to invoke to perform the insert, update, or delete action.

With the Sql Data Source, we need to provide SQL statements (or stored procedures) to execute.

An Overview of Inserting, Updating, and Deleting examined using the Object Data Source to facilitate inserting, updating, and deleting with the Grid View, Details View, and Form View controls.

Alternatively, the Sql Data Source can be used in place of the Object Data Source.

As discussed in An Overview of Inserting, Updating, and Deleting, the Grid View control provides built-in updating and deleting capabilities, while the Details View and Form View controls include inserting support along with editing and deleting functionality.

These data modification capabilities can be plugged directly into a data source control without a line of code needing to be written.

Microsoft Access offers a variety of options for making updates to records.

Updating the data from a query in MS Access (MDB) may not always be possible.

If I change Append Only to No then the field gets updated. Thanks for your help int num Rows Affected = 0; string update Query = @"UPDATE Peoples Table SET [former Name] = ? ;"; using (Ole Db Command cmd = new Ole Db Command(update Query, conn)) if (num Rows Affected !

Tags: , ,