The obscure way to open an Access 97 database with MDW Security in Access2010

10. May 2012 12:38 by Mrojas in Access  //  Tags: , , , , ,   //   Comments (0)

I was in an AccessMigration to SQL Server and i needed to open an Access97 database with security (using a system.mdw file).

It took me a while to do, but it is possible to open an Access97 Database in Access2010.

I really thing that it is a little obscure. But these are the steps:

1. First open Access2010

2. After Opening Access2010, press Ctrl + G. That will open the Microsoft Visual Basic for Applications window.

3. On the Immediate Window run this command (to run it just time the command and press Enter): DoCmd.RunCommand acCmdWorkgroupAdministrator

4. Once you run this command you will see a dialog with a title of Workgroup Administrator, press the Join Button

  

5. When you press the join Button a Dialog with Title Workgroup Information File will prompt Click Browse and find your System.mdw file and press OK. And press Ok on the Workgroup Administrator Dialog

6. Now close Access 2010

7. Open Windows explorer. Find your .mdb file and double click it. Access2010 will prompt for user/password and then will upgrade your database.

Profiling Silverlight Applications with Visual Studio 2010

5. October 2011 11:11 by Mrojas in Silverlight  //  Tags: , , , , ,   //   Comments (0)

The VS Profiler Team has an excellent post teaching how to use the VS2010 profiler with Silverlight Applications.

The steps are simple.

Run the A Visual Studio Command Prompt

And follow these steps:

  1. VSPerfClrEnv /sampleon
  2. "c:\Program Files (x86)\Internet Explorer\iexplore.exe" C:\Breakout\Breakout\Bin\Release\TestPage.html
  3. VSPerfCmd /start:sample /output:MyFile /attach:<PID of iexplore.exe process>
  4. Run your scenario
  5. VSPerfCmd /detach
  6. VSPerfCmd /shutdown
  7. VSPerfClrEnv /off

NOTE: information reposted from http://blogs.msdn.com/b/profiler/archive/2010/04/26/vs2010-silverlight-4-profiling.aspx

When the finish you will have a file called MyFile.vsp and just open that with VS2010.

Setting the Default Printer in .NET

 
The following C# code shows how to use WMI to query printers information, set and get default printer.
public bool SetDefaultPrinter()
{
    System.Management.ManagementObjectSearcher search = 
default(System.Management.ManagementObjectSearcher); System.Management.ManagementObjectCollection results =
default(System.Management.ManagementObjectCollection); System.Management.ManagementObject printer =
default(System.Management.ManagementObject); search =
new System.Management.ManagementObjectSearcher("select * from win32_printer"); results = search.Get(); //Get Default Printer System.Management.ManagementObject defaultPrinter = null; foreach (System.Management.ManagementObject foundPrinter in results) { System.Management.PropertyDataCollection
propertyDataCollection = foundPrinter.Properties; if ((bool)foundPrinter["Default"]) // DEFAULT PRINTER { System.Diagnostics.Debug.WriteLine(foundPrinter["Name"]); System.Diagnostics.Debug.WriteLine(foundPrinter["Location"]); } } //Sets new default Printer foreach (System.Management.ManagementObject foundPrinter in results) { System.Diagnostics.Debug.Print(foundPrinter["Name"].ToString()); if (foundPrinter["Name"].Equals("PDFCreator")) { System.Management.ManagementBaseObject outParams =
foundPrinter.InvokeMethod("SetDefaultPrinter", null, null); if (outParams == null) System.Diagnostics.Debug.WriteLine("Unable to set default printer"); Int32 retVal = (int)(uint)outParams.Properties["ReturnValue"].Value; if (retVal == 0) return true; else return false; } } return false; }

Fix errors for atlbase.h and atlthunk.lib not found in Visual C++ 2010 express

29. June 2011 03:53 by Mrojas in General  //  Tags: , , , , ,   //   Comments (0)

If for some reason you have to use VC++ Express and you have projects that use ATL,
you will get annoying error messages like:

LINK : fatal error LNK1104: cannot open file 'atlthunk.lib'

Just follow the steps in this post and you well be ready to go:

http://www.quantcode.com/modules/smartfaq/faq.php?faqid=99

Program database manager mismatch

21. June 2011 08:58 by Mrojas in General  //  Tags: , , , , , , ,   //   Comments (0)

I was playing around with dumpbin trying to figure out some problems with a 32-bit dll and in order to make
dumpbin run from the command line I just copied the mspdb100.dll file to
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin>

Something simple right! No harm can be gotten from something like that? WRONG!!!

After that some of my C++ project stop compiling with the annoying message: Program database manager mismatch!!.

Luckily I remembered copying that file, so I just gave it a try, and guest what? Everything works fine now.

Well I’m posting it just a reminder that for VS C++ you must put attention on all the details Smile