473,903 Members | 4,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

suppress macro warning msgs when tranferring remote BE tables

200 New Member
When changing paths to a BE db located on a network via DoCmd.TransferD atabase is there a way to suppress the macro warning messages that appear? I have 14 tables, and 14 warning messages appear in succession one for EACH transfer.

Thanks as always :)

Mar 26 '09 #1
10 5437
489 Recognized Expert Contributor
You can disable / enable warning with the following. Just make sure that you re-enable warnings in your code after you finish with the transferdatabas e.

Expand|Select|Wrap|Line Numbers
  1. Docmd.SetWarnings false
  2. Docmd.SetWarnings True
Mar 26 '09 #2
32,584 Recognized Expert Moderator MVP
This is relatively safe as it only disables warning messages and not the more serious error messages. Still important to return to default state afterwards of course, but no need to worry that you may miss bugs in your code with this set.
Mar 26 '09 #3
200 New Member
Thanks for the quick replies.
Mar 26 '09 #4
200 New Member
Not working folks. Still getting the macro warnings (18 in total) when I am linking to my BE. Here's my code:
Expand|Select|Wrap|Line Numbers
  1.     For Each tdf In dbs.TableDefs
  2.         If Left(tdf.Name, 4) <> "MSys" Then
  3.             'turn off macro warnings
  4.             DoCmd.SetWarnings False
  5.             'transfer tables
  6.             DoCmd.TransferDatabase acLink, "Microsoft Access", Trim(strDbPath), acTable, tdf.Name, tdf.Name
  7.             SysCmd acSysCmdSetStatus, "Processing table [" & tdf.Name & "]..."
  8.         End If
  9.     Next tdf
Then, before exiting I am turning the warnings back on.

Any ideas??? Warning bmp is attached.
Attached Images
File Type: bmp warning.bmp (24.3 KB, 419 views)
Mar 27 '09 #5
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Ahh, the message you show is nothing at all to do with Access's internal user warnings. The user warnings are the ones which say things like 'you are about to update 100 rows in table xxxx - are you sure?'.

The security warning you are receiving is one from the OS itself, not from Access. I don't know how to disable these - but they have nothing to do with the SetWarnings settings in Access at all.

Mar 27 '09 #6
489 Recognized Expert Contributor
I believe all you have to do is to add the server to your trusted zone in Internet Explorer.
Mar 27 '09 #7
1,287 Recognized Expert Top Contributor
I had instructions for my users to add the file locations to Access trusted locations, so here they are:

· Open Access 2007 and select Access Options from the Office Button menu.
· In the Access Options dialog, select Trust Center on the left and click Trust Center Settings…
· In the Trust Center dialog, select Trusted Locations on the left and check Allow Trusted Locations on my network.
· Click Add new location… and type or browse to the location of the application.
· Check Subfolders of this location are also trusted.
· Click OK.
Mar 27 '09 #8
200 New Member
Thanks all,

Sure, I could provide instructions to my users on how to add the path as a trusted location per Chip's instructions if the BE were known and static. Problem is I've no idea where the end user will want to store the BE so I've given them the option to move it. So consider this scenario: A user wants to store their BE on a network share. While the db is closed, they move their BE. During start up, code in my start-up form checks if the BE path is valid and if not, presents a form to allow the user to change the BE path. This bit is now working except the user must accept a host (18 in total) warning messages (one for each linked table) if the BE is not in a trusted path.

Keep in mind this is an A07 runtime deployment so their is no way for a user to get into the trust center to change paths.

I am learning that the following solution may be possible. Take the new BE path selected by the user and convert it to UNC. Then save the UNC path as a trusted location by adding it to the registry. Then link the BE using DoCmd.TransferD atabase and the warnings should not appear. Does this sound like a logical approach?

Possible issue here:

Looks like if the EU selects an updated BE path on their server, it may not transfer at all using Transferdatabas e. I cannot test this as I'm developing in a non-server environment.
Mar 27 '09 #9
1,287 Recognized Expert Top Contributor
Is it better to use TransferDatabas e rather than just change the link location? Right now I'm using:

Expand|Select|Wrap|Line Numbers
  1. Function ReLink() As Boolean
  2. ...
  3.     For Each tdf In db.TableDefs
  4.         If Len(tdf.Connect) > 0 Then
  5.             tdf.Connect = ";DATABASE=" & strNewPath
  6.             Err = 0
  7.             On Error Resume Next
  8.             tdf.RefreshLink ' Relink the table.
  9.             If Err <> 0 Then
  10.                 ReLink = False
  11.                 Exit Function
  12.             End If
  13.         End If
  14.     Next tdf
  15. ...
Mar 27 '09 #10

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

Similar topics

by: Krishna Srinivasan | last post by:
I have a form with check boxes. When accessing a check box element that is not checked, I get a notice (Notice: Undefined variable..). Is there a way to hide these notices and warning in PHP code without having to modify the PHP.ini file? Krishna Srinivasan.
by: Doug Ly | last post by:
Hi, When I run this query using WinSQL to connect to a DB2 database, it gave me the warning: Error: SQLSTATE 01003: Null values were eliminated from the argument of a column function. (State:01003, Native Code: 0) Is there anyway to suppress this message in my report? Thanks
by: Kim Hellan | last post by:
I want to suppress the following warning when compiling. warning CS0169: The private field 'myvar' is never used In C++ you would do something like (not sure of the syntax): #pragma nowarn:0169 string myvar; #pragma warn:0169 Is this really still not possible in C#? I know you can set the /nowarn:0169 option in you project, but I do not want
by: J Swift | last post by:
I posted this question earlier but on the wrong usenet. I have a warning below that I need to suppress *warning C4018: '<' : signed/unsigned mismatch I searched google, Microsoft help and MSDN for an answer but no luck. I don't want to fix the cause because it's how the program is supposed to work. It's part of an example in a text and the example suppresses a similar warning in Borland. I am sure there must be a way to do this in...
by: Chris Stankevitz | last post by:
My .vcproj references an environment variable that no longer exists: Creating library... Project : warning PRJ0018 : The following environment variables were not found: $(WXWIN) How do I suppress this warning? Note this is a "PRJ" warning not a "C" (compiler) warning. FYI, my project must include these missing environment variables.
by: Laurent Deniau | last post by:
I was playing a bit with the preprocessor of gcc (4.1.1). The following macros expand to: #define A(...) __VA_ARGS__ #define B(x,...) __VA_ARGS__ A() -nothing, *no warning* A(x) -x B() -nothing, *warning ISO C99 requires rest arguments to be used*
by: Chris Shenton | last post by:
I am setting up handlers to log DEBUG and above to a rotating file and ERROR and above to console. But if any of my code calls a logger (e.g., logging.error("foo")) before I setup my handlers, the logging system will create a default logger that *also* emits logs, which I can't seem to get rid of. Is there a way I can suppress the creation of this default logger, or remove it when I 'm setting up my handlers? Thanks. Sample code:
by: Rex Mottram | last post by:
I'm using an API which does a lot of callbacks. In classic callback style, each routine provides a void * pointer to carry user-defined data. Sometimes, however, the user-defined pointer is not needed which causes the compiler to spit out a "helpful" warning. For example: % cat unused.c #include <stdio.h> int foo(char *str, void *data) {
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.