drainville
New member
- Joined
- May 17, 2007
- Messages
- 4
- Programming Experience
- 3-5
Hi Guys,
Context :
It has been now at least 5 days that i've been searching to find a solution for my problem. Just to let you know, i'mn not a newbie in programming and have been working for a while in vb.net and .net environmnent.
Problem:
For some reason, while developing a vb.net 2005 application, when I try to update, delete or insert data into a table in an ms access database (2000 or 2002), all the execution is done successfully (without errors or exceptions) but the data is still unmodified. How do I modifiy the data? I tried with a dataset and calling update after modifying the dataset (and yes the rowstate was set to modified before calling the update) and I received a result of 1 row changed but nothign has changed on the access db. I tried with a Execute non query with a simple update query and again, the query returns 1 row affected (at least) but on ms access db side, nothing has changed. Weird enought, when I update the data with the visual studio 2005 network tab, the data remains updated which makes this really weird.
BTW: i tried the same code with an SQL Server connection and the update is permanent on the db side..
I would really appreciate any help or any tips that could come up ..
Here's the code I use for a simple update:
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Todo.mdb"
Dim con1 As OleDb.OleDbConnection = New OleDb.OleDbConnection(conn)
Try
con1.Open()
Dim cmdtest As OleDb.OleDbCommand = New OleDbCommand("update Exer1Arbitres set arbNom = 'test11'", con1)
msgbox(cmdtest.ExecuteNonQuery()) ' this returns 1
Catch ex As Exception ' no errors returned
MsgBox("Oops " + ex.Message.ToString)
End Try
End Sub
End Class
thanks for your time
Context :
It has been now at least 5 days that i've been searching to find a solution for my problem. Just to let you know, i'mn not a newbie in programming and have been working for a while in vb.net and .net environmnent.
Problem:
For some reason, while developing a vb.net 2005 application, when I try to update, delete or insert data into a table in an ms access database (2000 or 2002), all the execution is done successfully (without errors or exceptions) but the data is still unmodified. How do I modifiy the data? I tried with a dataset and calling update after modifying the dataset (and yes the rowstate was set to modified before calling the update) and I received a result of 1 row changed but nothign has changed on the access db. I tried with a Execute non query with a simple update query and again, the query returns 1 row affected (at least) but on ms access db side, nothing has changed. Weird enought, when I update the data with the visual studio 2005 network tab, the data remains updated which makes this really weird.
BTW: i tried the same code with an SQL Server connection and the update is permanent on the db side..
I would really appreciate any help or any tips that could come up ..
Here's the code I use for a simple update:
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Todo.mdb"
Dim con1 As OleDb.OleDbConnection = New OleDb.OleDbConnection(conn)
Try
con1.Open()
Dim cmdtest As OleDb.OleDbCommand = New OleDbCommand("update Exer1Arbitres set arbNom = 'test11'", con1)
msgbox(cmdtest.ExecuteNonQuery()) ' this returns 1
Catch ex As Exception ' no errors returned
MsgBox("Oops " + ex.Message.ToString)
End Try
End Sub
End Class
thanks for your time