I'm new around here but do Admin over @ PHPHelp.com... I've been developing a project for my degree which is basically based around an ATM machine.
Basically my problem is related to the updating of the database, I can't seem to see why it doesn't do anything despite no errors showing up...
Just a bit of background first..
DT is a data tables globally declared within my class...
Basically this problem applies to add a new row and updating a existing one. Although the data table HAS updating (I can check via echoing the related field) the ole connection doesn't appear to actually send it to the db
My new field query is:
Expand|Select|Wrap|Line Numbers
- Query("SELECT [accountNumber],[cardNumber],[transationAmount] FROM transactions") ',[transactionDate] // Populates the data table.. works fine
- MsgBox(dt.Columns.Count)
- Try
- newRecord = dt.NewRow
- newRecord("accountNumber") = CStr(Me.accountNum) '
- newRecord("cardNumber") = CStr(Me.cardNum) '
- newRecord("transationAmount") = CStr(amount) '
- dt.Rows.Add(newRecord)
- updateData()
- Catch ex As Exception
- Form1.msgReturn(ex.Message, Form1.rtnInital)
- End Try
Expand|Select|Wrap|Line Numbers
- Private Function updateData()
- dt.AcceptChanges()
- 'MsgBox(dt.Rows(0)("accountBalence"))
- Try
- Dim cmdbuilder As New OleDb.OleDbCommandBuilder(Form1.OleDbDataAdapter1)
- Form1.OleDbDataAdapter1.Update(dt)
- Return True
- Catch ex As Exception
- dt.Clear() 'Removes previous data set
- MsgBox(ex.Message)
- Return False
- End Try
- End Function