Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / December 2003

Tip: Looking for answers? Try searching our database.

Workspaces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steven - 30 Dec 2003 02:49 GMT
I have created a workspace and I am doing 3 dbs.Execute
functions.

wrkDefault.BeginTrans

Set dbs = OpenDatabase(dbName)

dbs.Execute "INSERT INTO ....etc"
dbs.Execute "UPDATE .... INNER JOIN ..... etc"
dbs.Execute "DELETE table.* from table"

If MsgBox("Save and commit?", vbYesNo) = vbYes Then
 wrkDefault.CommitTrans dbForceOSFlush
Else
 wrkDefault.Rollback
End If

If I choose NO and do the wrkDefault.Rollback everything
appears to work fine except when I go back and open a
recordset on the table where I was deleting the records
the rst.RecordCount = 0 ; but the table still has the
records as I expected because I did not commit the
transaction.  Why does the rst.RecordCount say 0 when the
table actually has records?

Thank you for your help.

Steven

.
Dutch - 30 Dec 2003 17:47 GMT
Do not use rst.RecordCount.  Use rst.bof and rst.eof; if
both of these are true then there are no records.  If one
or both are false then the table has records.  Put this in
your program where you are opening the record set after
you have not committed the records.

MsgBox rst.bof
MsgBox rst.eof
MsgBOx rst.RecordCount

This will prove interesting to you.

>-----Original Message-----
>I have created a workspace and I am doing 3 dbs.Execute
[quoted text clipped - 29 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.