Dave's Technophorical Times

A blog about Microsoft's Technologies!
SharePoint :: MVC :: ASP.NET :: IIS :: SQL Server :: Visual Studio :: MS Access

You created a DLL in Visual Studio 2010 so you can reference it in MS Access VBA.

It works fine in 32-bit Office but you get an error (error 429 activex component can't create object) when trying to run in 64-bit Office.

Solution: Unfortunatley non built-in ActiveX objects cannot be created in 64-bit Office and there is no direct work around for this.

I ran into a very strange error recently when I took over someone elses MS Access project. The so called developer did not use Option Explicit anywhere in the code so I added it into all modules and fixed all the misspelled variables and missing variables. Then the final Error I got when compiling was "Procedure Too Long"! That was odd as the routine in question was maybe 1000 lines long so it was NOT too long at all. After reviewing the code in more detail I decided to change some of the massive If-Then-Else blocks into Case Statements and just like magic, after the first one, I was able to get past this stupid error.

There must be some sort of limitation on the number of If-Else statements in VBA routines.

from here: https://www.lifewire.com/increase-outlook-attachment-size-limit-1173679 

Increase the Outlook Attachment Size Limit

To change the size Outlook allows as a maximum for attachments to send:

  1. Press the keyboard shortcut Windows-R.
  2. Type "regedit" in the Run dialog.
  3. Click OK.
  4. Travel down the registry tree to the entry corresponding to your Outlook version:
    • Outlook 2010: HKEY_CURRENT_USER\­Software\­Microsoft\­Office\­14.0\­Outlook\­\Preferences.
    • Outlook 2013: HKEY_CURRENT_USER\­Software\­Microsoft\­Office\­15.0\­Outlook\­\Preferences.
    • Outlook 2016: HKEY_CURRENT_USER\­Software\­Microsoft\­Office\­16.0\­Outlook\­\Preferences.
  5. Double-click the MaximumAttachmentSize value.
    • If you cannot see MaximumAttachmentSize:
      1. Select Edit | New | DWORD Value from the menu.
      2. Enter "MaximumAttachmentSize" (not including the quotation marks).
      3. Press Enter.
      4. Now double-click the MaximumAttachmentSize value you just created.

  1. Enter the desired attachment size limit in KB under Value Data:.
    • To set a size limit of 25MB, for example, enter "25600."
    • The default value (with MaximumAttachmentSize not present) is 20MB or 20480.
    • For no attachment file size limit, enter "0." Practically all mail servers have a size limit, though, so "0" is not recommended; you would invariably get large messages back as undeliverable after an often long and fruitless uploading process.
    • Ideally, the limit corresponds to your mail server's limit. Reduce the Outlook limit by some 500KB to allow wiggle room.

  1. Click OK.



Azure Backups

by Dave Stuart | Tags:

Simple, easy and cheap.


Network discovery requires that the DNS Client, Function Discovery Resource Publication, SSDP Discovery, and UPnP Device Host services are started, you may check this on both sides to make sure they are started.

If you get this error for no apparent reason in MS Access then you probably just need to decompile the file like this

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "d:\My Documents\access\mayapp.mdb" /decompile

From here: https://support.microsoft.com/en-ca/help/214459/info-optional-feature-not-implemented-error-message

I got this error when running the code via MS Access VBA.

When you use ActiveX Data Objects (ADO) to pass parameters to a stored procedure, you may receive the following error:

Run-time error '2147217887 (80040e21)':
[Microsoft][ODBC SQL Server Driver] Optional Feature Not Implemented.

This error can occur if you attempt to set the TYPE of a parameter in an ADODB command object's parameters collection to a type that is not supported by the data provider.

For example, using SQL Server 7.0, create a stored procedure on the PUBS database:

   CREATE PROCEDURE GetEmployeeInfo (@thedate datetime, @NumEmployees int output)AS 
SELECT @NumEmployees = count(*) FROM EMPLOYEE WHERE hire_date < @thedate

This stored procedure returns an output parameter of type int indicating the number of employees hired before a given date. The date is passed to the stored procedure as a parameter, and the number of employees is passed to the calling program as an output parameter.

Now create an ADO application to use the stored procedure. The example given is written in Visual Basic.

Private Sub MySubroutine()
Dim dbConnection As ADODB.Connection
Dim dbCommand As ADODB.Command

Set dbConnection = New ADODB.Connection
Set dbCommand = New ADODB.Command

Dim DSNNAME As String
Dim USERNAME As String
Dim PASSWORD As String

DSNNAME = "Pubs"

dbCommand.ActiveConnection = dbConnection

Dim TheDate As Date
TheDate = Now

dbCommand.CommandText = "GetEmployeeInfo"
dbCommand.CommandType = adCmdStoredProc
dbCommand.Parameters.Append dbCommand.CreateParameter("@thedate", adDBDate, adParamInput, 0, TheDate)
dbCommand.Parameters.Append dbCommand.CreateParameter("@NumEmployees", adInteger, adParamOutput, 0)

Dim strTheString As String
strTheString = "There are " & dbCommand.Parameters("@numemployees") & " employees who were hired before " & TheDate
MsgBox strTheString, vbOKOnly, "Demonstration"
End Sub

When the sample code is run, it gives this error:

Run-time error '2147217887 (80040e21)':
[Microsoft][ODBC SQL Server Driver] Optional feature not Implemented.

This is because SQL Server does not support the adDBDate datatype. To correct this problem, change the datatype of the @theDate parameter to adDBTimeStamp.

In order to determine the number, names, types, and sizes of parameters needed in a stored procedure, use the Parameters.Refresh method of the command object. You can call this method during development of your application to determine the correct requirements for the stored procedure, then remove the expensive call to Parameters.Refresh after you have gathered the necessary data.

If you all of a sudden find that your VBA breakpoints do not work then check the "Use Access Special Keys" checkbox via Access Options/Current Database. More than likely it is NOT checked. Maybe you accidently unchecked it!

Specificy for Windows 7.

Please try Disable the generation of thumbs.db files by the Local Group Policy Editor and your problems will be resolved. They are only generated for compatibility with outdated applications, and are most certainly NOT needed for Windows operation.

Run "Group Policy" - select Edit Group Policy when it comes up.

> User Configuration
> Administrative Templates
> Windows Components
> Windows Explorer


    table_name varchar(255),
    row_count int

EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
SELECT table_name, row_count FROM #counts ORDER BY table_name, row_count DESC
DROP TABLE #counts


The output will be a list of tables and their row counts.

If you just want the total row count across the whole database, appending:

SELECT SUM(row_count) AS total_row_count FROM #counts

will get you a single value for the total number of rows in the whole database.

The Blogger

Dave Stuart I'm a Developer with a passion for coding. I enjoy the challengers that come with the job! SharePoint is one of my expert areas along with .NET Web Development with MVC and good old MS Access VBA coding. I Blog so that I can remember how I did that way back when; PLUS all this stuff is searchable! I constantly study and run my own business, Dafran Inc. I have passed 22 Microsoft Exams since 1998 when I first jumped on the treadmill of knowledge. I hope that you enjoy this Blog as much as I enjoy updating it. All the very best from Calgary, Alberta, Canada. contact me at linkedin @ dafran.ca


<<  December 2017  >>

View posts in large calendar

Sign in