Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2007, 10:47 PM
Registered User
 
Join Date: Jul 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yzlin04 Send a message via Yahoo to yzlin04
Default Please help, Update MS Access table from datagrid

I'm using VB.net 2003. I can delete a row in datagrid (dgTempTransaction), but my MS Access table can't directly being updated. The row i deleted is still exist in my MS Access, but in my datagrid, it already being deleted.
The table name in my MS Access: tableTempTransaction.

Here is my code for that part...i don't know where is the error. Please help me..... Thanks anyway.

Dim currManager As CurrencyManager

If IsNothing(DsTempTransaction1) Then Exit Sub

currManager = CType(BindingContext(DsTempTransaction1, "tableTempTransaction"), CurrencyManager)

'get the current row
Dim dRow As DataRow = CType(currManager.Current, DataRowView).Row

'prompt to save changes
If MsgBox("Are you sure want to delete this item?", MsgBoxStyle.OKCancel, "Hands On Programming") = MsgBoxResult.OK Then
'delete it from the dataset
dRow.Delete()

'get just the changed data
Dim dsChanged As DataSet = DsTempTransaction1.GetChanges
'>>>Problem in this part...table inside MS Access cannot be updated.
Else
'reset the dataset
DsTempTransaction1.RejectChanges()
End If

 
Old August 6th, 2007, 07:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

what are you doing in the part that fails??

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to update ms access's table [email protected] ASP.NET 2.0 Professional 0 September 18th, 2006 02:41 AM
How to insert,delete,update datagrids to MS Access maximus101 VB Databases Basics 0 May 8th, 2006 03:03 PM
Block some columns from update in MS DataGrid zee_ahmed2002 Pro VB 6 1 October 13th, 2004 07:52 AM
Update problem in MS Access 2000 socoolbrewster Access 1 March 12th, 2004 07:09 PM
MS Access Table Help Imran82 BOOK: Beginning Access VBA 0 December 23rd, 2003 08:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.