access vba
4 TopicsMS Access passthrough query performs very slow when executing a stored procedure
I have a passthrough query in my Access frontend that I use to import data from a sql server db. I work with MS 365 MSO Version 2302 32 Bit. Before executing the passthrough query I pass the connectionstring and the sql to the querydef object and then I pass the output to a DAO recordset: Set qdf = CurrentDb.QueryDefs("myPTQuery") qdf.Connect = myconnectionstring qdf.SQL = "EXEC MyStoredProc " & param1 & ", " param2 Set rstDAO = qdf.OpenRecordset When I execute the stored procedure in SSMS using the same parameters it takes 2 seconds. In MS Access I need to set the ODBCTimeout parameter to 4 minutes to avoid a timeout error. This problem occures rarely, i.e. only under certain parameters. But I cannot figure out any significant difference between the cases the passthrough query performs well and the ones it doesn't. It seems like the timeout occures regardless on which parameters are passed to the stored proc. It worked before. Could it be caused by some office update? Any ideas on how to improve the performance of the passthrough query?522Views0likes2CommentsWalking Directories Finds A Directory That Doesn't Exist
I have a VBA application that walks directories and captures the number of files in each and their total size. I hit an unusual problem. A directory contains a reference to a subdirectory that doesn’t exist. The reference is: C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData\Application Data\*.* It comes from: FindFirstFileW(sPathFileUTF32, fdW) Where sPathFileUTF32 is: C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData Attempt to walk it: FindFirstFileW(sPathFileUTF32, fdW) Where sPathFileUTF32 is: C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData\Application Data\*.* Throws an error: Error[3]: The system cannot find the path specified. File Manager does not see that subdirectory: Dir in a CMD window does not see that subdirectory: Why does FindFirstFileW return a path to a directory that does not exist?493Views0likes2CommentsAppcrash Access / VBA
Hi, I am part of a development team that has an application written in access / vba (access runtime 2000) in production and without installing any updates on some machines, with the Windows 10/11 operating system, the program no longer starts. Searching the internet, we found this article: https://learn.microsoft.com/en-gb/DeployOffice/security/internet-macros-blocked#use-policies-to-manage-how-office-handles-macros Could the problem be related to this update? We tried following the guidelines to get it back up and running but couldn't fix it. Has anyone faced and solved any similar problem? Thanks for any help. --- Salve, faccio parte di un team di sviluppo che ha in produzione un'applicazione scritta in access / vba (access runtime 2000) e senza l'installazione di nessun aggiornamento su alcune macchine, con sistema operativo Windows 10/11, il programma non parte più. Eseguendo delle ricerche su internet abbiamo trovato questo articolo: https://learn.microsoft.com/en-gb/DeployOffice/security/internet-macros-blocked#use-policies-to-manage-how-office-handles-macros Il problema potrebbe essere collegato a questo aggiornamento? Abbiamo provato ad seguire le linee guida per ripristinare il funzionamento ma non siamo riusciti a risolvere. Qualcuno ha affrontato e risolto qualche problema simile? Grazie per un eventuale aiuto.2.5KViews0likes13CommentsEmail merge error - 3048
Hi, Some code was written in the past that worked fine until this last week or so then we get error 3048. As per a lot of suggestions on this forum we have made the location of both the client end database and the root database on the network trusted, but still get this error. As the code is a few years old I thought I would post to see if anyone knows of improvements we could make to it. It is to send statements to different contacts, here is the code: Private Sub Command62_Click() Dim rst As DAO.Recordset Set rst = CurrentDb.OpenRecordset("qry_mass_emails") Do Until rst.EOF Me.unit_sales_unit_no_sel.value = rst("unit_no") If DCount("id", "tbl_trans", "unit_no=" & Me.unit_sales_unit_no_sel.value & " AND flag=False AND contra=False") > 0 Then Call sndrpt_unit_sales2 Else Call sndrpt_unit_sales3 'DoCmd.SendObject , , , DLookup("email", "tbl_tenants", "id=" & DLookup("tenant", "tbl_units", "unit_no=" & Me.unit_sales_unit_no_sel)), , , "Sales Report", "Sorry, you have no sales transactions to report on." & Chr(10) & Chr(10) & "Regards" & Chr(10) & "Astra Antiques", False End If rst.MoveNext Loop rst.Close DoCmd.Close DoCmd.OpenForm "frm_menu_reports", , , stLinkCriteria MsgBox "Mass E-Mails Sent" End Sub Thanks for your suggestions. Katherine875Views0likes1Comment