PDA

Click to See Complete Forum and Search --> : Stupid but urgent!!!


bstl
May 17th, 2000, 10:40 AM
Hi,

A stupid beginner's question.

A very small question- When we use the 'BeginTrans...CommitTrans' for database entry it does not always update the Access records. We are using the Jet Database Engine. There is no consistency in updating the records. It works when there is no 'BeginTrans...CommitTrans'.
Please help...

Thanx in advance

Regards
BSTL

:confused:

andreww
May 17th, 2000, 02:58 PM
Like you i'm only a beginner but I have had more success with opening the table / dataset using DAO it's quick easy and doesn't take a lot of brain to suss (ideal for me)
If you want a hand with DAO let me know

bstl
May 17th, 2000, 05:07 PM
Thanx for the sugestion, but can u help in starting off with DAO?

Regards
BSTL

andreww
May 17th, 2000, 05:24 PM
Heres a bit of code i did earlier
declarations:
Dim dB As Database
Dim qd As QueryDef
Public LATESTBATCH As String

'in module
Function GetLatestBatch()

Set dB = DBEngine.OpenDatabase("data.mdb")
Set qd = dB.QueryDefs("latestbatchnumber")
'connect dataset to data control
Set frmMain.Data1.Recordset = qd.OpenRecordset()

frmMain.Data1.Recordset.MoveFirst 'select first rec
LATESTBATCH = frmMain.Data1.Recordset!Filename
'frmMain.dtaLatestFile = LATESTBATCH
End Function

this opens the database and attaches the data to data1 datacontrol on the form 'main'
I only retrieve the first record of one field called 'Filename' but you can use the same thing with multiple records and move through the dataset using .movenext and .moveprevious
don't forget if you change any record value to use .update to commit the changes