Click here to Skip to main content
15,915,508 members
Home / Discussions / Database
   

Database

 
GeneralRe: How should my database like Pin
LovelyHelp29-Apr-06 5:32
LovelyHelp29-Apr-06 5:32 
GeneralRe: How should my database like Pin
LovelyHelp29-Apr-06 4:36
LovelyHelp29-Apr-06 4:36 
GeneralRe: How should my database like Pin
Colin Angus Mackay29-Apr-06 5:19
Colin Angus Mackay29-Apr-06 5:19 
GeneralRe: How should my database like Pin
LovelyHelp29-Apr-06 5:41
LovelyHelp29-Apr-06 5:41 
QuestionUrgent help from an expert! Pin
JUNEYT28-Apr-06 14:16
JUNEYT28-Apr-06 14:16 
QuestionMS Access and C# Help Pin
achrafus28-Apr-06 11:38
achrafus28-Apr-06 11:38 
AnswerRe: MS Access and C# Help Pin
Colin Angus Mackay28-Apr-06 21:14
Colin Angus Mackay28-Apr-06 21:14 
QuestionAccess Databases Pin
QC_200028-Apr-06 4:00
QC_200028-Apr-06 4:00 
Hi,

I'm writing a Windows application that's a front end interface for an Access database. I'm using VB.NET and I'm getting a very strange error when I try to edit a record in one of my tables. The error says:

"5 - Cannot set 'Discrepancy'"

Discrepancy is the column name.

The strange thing is that the line of code that's raising the error is within a Try, Catch, End Try block but the error is raised without the code execution passing through the Catch part of the block! And even stranger than that, the new value that I'm setting to the 'Discrepancy' field is being set, even though the error message says that it can't set it!!

I've checked, double-checked, and triple-checked all of the usual suspects (spelling, table mapping, schema, oleadapter configuration, etc) and everything seems fine. I can't for the life of me see what is wrong.

Can anyone help please?

I've included my code below. The line that's generating the error is the one with the EndEdit() method. I've also tried checking for errors on the line immediately before the EndEdit() method and there were none.

Try
Dim Record As DataRow = Me.dtsRent.Tables(0).Rows(Me.cmbWeek.SelectedIndex)
Dim Balanced as String
If CInt(Me.txtRentDisc.Text) = 0 Then Balanced = "Yes" Else Balanced = "No"
Record.BeginEdit()
Record.Item("Modified By") = Profile("Officer").ToString
Record.Item("Date Modified") = DateTime.Now.ToString
Record.Item("Reconciled") = Balanced
Record.Item("Total Payments") = CDec(Me.txtRentPayments.Text)
Record.Item("HBP19 Controls") = CDec(Me.txtRentHB19.Text)
Record.Item("Discrepancy") = CDec(Me.txtRentDisc.Text)
Record.EndEdit()
Me.adpRent.Update(Me.dtsRent)
Catch ex As Exception
MsgBox(Err.Number & " - " & Err.Description)
End Try

Thanks in advance.
QC
AnswerRe: Access Databases Pin
Rob Graham28-Apr-06 5:41
Rob Graham28-Apr-06 5:41 
GeneralRe: Access Databases Pin
QC_200028-Apr-06 5:59
QC_200028-Apr-06 5:59 
QuestionHow to FTP a File using SQL Server 2000? Pin
pubududilena28-Apr-06 3:57
pubududilena28-Apr-06 3:57 
QuestionUnpredicted behaviour i IN clause Pin
qur28-Apr-06 2:42
qur28-Apr-06 2:42 
Questionsearch case insensitive in access Pin
klakero28-Apr-06 1:16
klakero28-Apr-06 1:16 
QuestionRe: search case insensitive in access Pin
Eric Dahlvang28-Apr-06 5:47
Eric Dahlvang28-Apr-06 5:47 
QuestionEnterprise library Pin
WDI27-Apr-06 23:33
WDI27-Apr-06 23:33 
QuestionQuery on UNION Query Pin
DiligenZ27-Apr-06 19:00
DiligenZ27-Apr-06 19:00 
AnswerRe: Query on UNION Query Pin
Colin Angus Mackay27-Apr-06 20:38
Colin Angus Mackay27-Apr-06 20:38 
QuestionSQL connection issue with window Xp SP2 Pin
Lisana27-Apr-06 5:30
Lisana27-Apr-06 5:30 
AnswerRe: SQL connection issue with window Xp SP2 Pin
Colin Angus Mackay27-Apr-06 6:01
Colin Angus Mackay27-Apr-06 6:01 
GeneralRe: SQL connection issue with window Xp SP2 Pin
Lisana27-Apr-06 6:07
Lisana27-Apr-06 6:07 
GeneralRe: SQL connection issue with window Xp SP2 Pin
Jerry Hammond27-Apr-06 10:03
Jerry Hammond27-Apr-06 10:03 
QuestionHow to create a schema? Pin
Goalie3527-Apr-06 4:19
Goalie3527-Apr-06 4:19 
AnswerRe: How to create a schema? Pin
Eric Dahlvang27-Apr-06 4:44
Eric Dahlvang27-Apr-06 4:44 
AnswerRe: How to create a schema? Pin
Frank Kerrigan27-Apr-06 4:47
Frank Kerrigan27-Apr-06 4:47 
QuestionSelect * From [Orders] IN '' [ODBC;Driver= ... Pin
Thomas Wells27-Apr-06 3:53
Thomas Wells27-Apr-06 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.