By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

DBEngine - Access 2003 vs Access 2010

P: n/a
Hi folks,

My company recently upgraded our Office suite from 2003 to 2010. The problem in particular is with an Access database that was originally designed in Access 2003. The code in question used work in 2003 (see below code).

Expand|Select|Wrap|Line Numbers
  1. Private Sub engSave_Click()
  2.  
  3.     Dim strSql3 As String
  4.  
  5.     'Archive order number and cost data for engine.
  6.         strSql3 = "UPDATE tblQuotePkgEngine INNER JOIN qryQuotePkgEngine ON " & _
  7.             "(tblQuotePkgEngine.engPrcID = qryQuotePkgEngine.engPrcID) " & _
  8.             " AND (tblQuotePkgEngine.pkgID = qryQuotePkgEngine.pkgID) " & _
  9.             " SET tblQuotePkgEngine.soHist = [qryQuotePkgEngine]![OrderNo], " & _
  10.             " tblQuotePkgEngine.costHist = [qryQuotePkgEngine]![Cost (CDN)], " & _
  11.             " tblQuotePkgEngine.prcHist = [qryQuotePkgEngine]![Price] " & _
  12.             " WHERE (((tblQuotePkgEngine.pkgID)= " & Me.pkgID & "));"
  13.         DBEngine(0)(0).Execute strSql3, dbFailOnError
  14.  
  15.         Forms![fmQuotePkgDetails].Refresh
  16.         Forms![fmQuotePkgDetails]![modDate] = date
  17.  
  18.         MsgBox ("Engine modification now saved.")
  19.  
  20. End Sub
  21.  
Since the upgrade to 2010, this chunk of code no longer seems to work. No error messages are given. In fact by all appearances, it looks like it executes the code as the final message I see is the msgbox item but when you look on the table, values that are supposed to be copied to the archive fields are not being executed. My suspicion is that it has to do with the "DBEngine(0)(0).Execute strSql3, dbFailOnError" chunk of code, in particular the DBEngine(0)(0) piece.

I'm assuming Access 2010 does not recognize this anymore?

Can someone enlighten me please as this is something I've been trying to chase down for the last day or so.

Thanks in advance.

Alan
Nov 18 '10 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,494
I can't help much here Alan I'm afraid, but were I in your position I would :
  1. Trace (See Debugging in VBA) through the code until you determined that the results were not as you expected. That will give you which line is not behaving as expected.
  2. Search the web for pages dealing with differences between versions of Access (You may want to start at Exploring Office 2010).
Nov 18 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.