From: Inquisitive1 on 12 Apr 2010 10:04 I have some code that works properly in one database that I have pulled into another database, but it does not work in the other database. I am not experienced enough to resolve the issue. I have a feeling that it has to do with references, but I am at a loss at how to fix it. I did make the references match in the new database, but that did not fix the problem (there is code that uses both ADO and DAO). I would greatly appreiciate any assistance!! The Available references selected (in priority order) in the database where the code IS NOT working are below. Visual Basic For Applications Microsoft Access 11.0 Object Library Mircrosoft Excel 11.0 Object Library OLE Automation Microsoft ADO Ext. 2.8 for DDL and Security Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library The Available references selected (in priority order) in the database where the code IS working are below. Visual Basic For Applications Microsoft Access 11.0 Object Library Microsoft ActiveX Data Objects 2.1 Library OLE Automation Microsoft ADO Ext. 2.8 for DDL and Security Microsoft DAO 3.6 Object Library Here is the code: Option Compare Database Option Explicit Dim sQueryName As String ------------------------------------------------------------------------------------- Public Function ConfirmCertStatus() DoCmd.SetWarnings False If ValidCertStat() Then DoCmd.RunMacro "mcr_SCL_CustomStatusProcessing" Else DoCmd.Hourglass False MsgBox "An unknown cert status has been provided.", vbInformation, "Unknown Certification Status" End If DoCmd.Hourglass False End Function ------------------------------------------------------------------------------------- Private Function ValidCertStat() As Boolean On Error GoTo Err_ValidCertStat Dim cmd As ADODB.Command Dim rst As ADODB.Recordset Dim prm As ADODB.Parameter ValidCertStat = True DoCmd.SetWarnings False sQueryName = "1-UnknownCertStatusInSCLUpdateHistory" Set rst = New Recordset rst.CursorLocation = adUseClient rst.CursorType = adOpenDynamic Set cmd = New Command cmd.ActiveConnection = CurrentProject.Connection cmd.CommandText = sQueryName cmd.CommandType = adCmdTable rst.Open cmd If rst.RecordCount > 0 Then ValidCertStat = False End If rst.Close Set rst = Nothing Set cmd = Nothing Exit_ValidCertStat: Exit Function Err_ValidCertStat: ValidCertStat = False Resume Exit_ValidCertStat End Function
From: Rich P on 12 Apr 2010 11:23 you need to update MDAC >Microsoft ActiveX Data Objects 2.1 Library to Microsoft ActiveX Data Objects 2.5 Library or higher Here is an article that focuses on MDAC 2.6 http://www.pcreview.co.uk/forums/thread-1697291.php You can also download MDAC 2.6 from here (I believe) HTH Rich *** Sent via Developersdex http://www.developersdex.com ***
From: Inquisitive1 on 12 Apr 2010 14:06 On Apr 12, 11:23 am, Rich P <rpng...(a)aol.com> wrote: > you need to update MDAC > > >Microsoft ActiveX Data Objects 2.1 Library > > to Microsoft ActiveX Data Objects 2.5 Library or higher > > Here is an article that focuses on MDAC 2.6 > > http://www.pcreview.co.uk/forums/thread-1697291.php > > You can also download MDAC 2.6 from here (I believe) > > HTH > > Rich > > *** Sent via Developersdexhttp://www.developersdex.com*** Rich, That did not work. I left everything the same and changed the query name by removing the "1-". Everything works fine now. Why is it that the code runs when the query/table name does not begin with a number? This is very odd.
|
Pages: 1 Prev: Image Display Problem ! Next: Printing Checks from Access |