0

i want to update the n th row of the ms access table through vb . i request any body to explain the procedure of code giving one example for which i will be thank ful

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by selvaganapathy
0

Hi
> First Connect Vb to your Database
> U Must have primary key in that table to uniquely Choose the nth row.
> Use the primary key to select the row

For Example in ADO
Assume the DataBase is in C:\abc.mdb

''''' ADO Code to Open the Database
Connection

Dim DB as New ADODB.Connection
Dim RS as New ADODB.RecordSet

DB.Open "Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\abc.mdb"
   DB.CursorLocation = adUseClient 
RS.Open "SELECT * FROM Table WHERE PrimaryKey=n",DB, adOpenDynamic, adLockOptimistic

Now Change thru RS object

Rs.Fields("FieldName") = Value

Note:
Table, PrimaryKey, n, FieldName, Value are used for example, replace appropriate words

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.