Thursday, October 15, 2009
"Access is Denied" on a folder as Windows Administrator ?
When an Windows administrator attempts to access a user's folder or file, the administrator receives an "Access is Denied" message.
This behavior occurs because a user or an administrator applied a Group Policy object to redirect the user's folder to a network share (\\Server\Share\UserName), and did not change the Grant the user exclusive rights default setting.
Only the user, to whom the folder belongs, has authorization to access this folder when this default setting is used.
Solution
An administrator must take ownership of the folder in order to change the Access Control List (ACL) or to access the folder.
To take ownership of a folder, follow these steps:
Right-click the desired folder, click Properties, and then click
the Security tab.
Click OK when you receive the following message:
You only have permission to view the current security information on username
Click Advanced, and then click the Owner tab.
Select a new owner, select Replace owner on subcontainers and objects, and then click OK.
Click Yes when you receive the following message:
You do not have permission to read the contents of directory path and directory name. Do you want to replace the directory permissions with permissions granting you Full Control?
Close, and then reopen Properties to refresh the ACL.
Note: The permissions for this folder are now being inherited from the parent folder. In most cases you should block inheritance from the parent by clearing the Allow inheritable permissions from parent to propagate to this object check box. You will then be able to change the permissions on this folder.
Monday, September 21, 2009
Call a method in another assembly with C#
Assembly assembly = Assembly.LoadFrom(@"C:\App\bin\xyz.dll");
// Create the actual type
Type classType = assembly.GetType("xyz", true, false);
// Create an instance of this type and verify that it exists
object dynamicObject = Activator.CreateInstance(classType);
if (dynamicObject != null)
{
// Verify that the method exists and get its MethodInfo object
MethodInfo invokedMethod = classType.GetMethod("Start");
if (invokedMethod != null)
{
object[] parameters = new object[2];
parameters[0] = jobType;
parameters[1] = argument;
// Invoke the method with the parameters
invokedMethod.Invoke(dynamicObject, parameters);
}
}
Wednesday, September 16, 2009
Join workgroup file with Access 2007
2. Press CTRL+G to open the Immediate window.
3. Type the following line of code, and then press ENTER.
DoCmd.RunCommand acCmdWorkgroupAdministrator
4. In the Workgroup Administrator dialog box, click Join, and then click Browse.
5. Locate and then click the following file, and then click Open:
C:\Program Files\Common Files\system\System.mdw
6. In the Workgroup Administrator dialog box, click OK, and then click Exit
OR
Make a shortcut with the following : "path to 2007msaccess.exe" "path to mdb" /wrkgrp "path to secure.mdw"
Thursday, July 16, 2009
Embed script : ScriptLoadFailedException
Error: Sys.ScriptLoadFailedException: The script '.../WebResource.axd?d=...' failed to load. Check for: Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
Solution :
Add this line at the end of the javascript that is loaded :
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
Friday, June 19, 2009
ASP.NET: 3 Steps to embed web resources into dll
Add your JS file to custom control project. Right click on the file - Properties - Build Action - Embedded Resource
Open your AssembyInfo.cs file and add following line
[assembly: System.Web.UI.WebResource("YourNamespace.FileName.js", "application/x-javascript")]
In your custom control OnLoad event add following line:
Page.ClientScript.RegisterClientScriptResource(this.GetType(), "YourNamespace.FileName.js");
That's all!
Wednesday, April 22, 2009
Debug with Visual Studio 2005 and IE8
http://www.microsoft.com/windows/internet-explorer/beta/readiness/developers-existing.aspx#lcie
Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process. You can work around this by disabling the process growth feature of LCIE. Here's how:
1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0
Since you are running on Windows Server 2003, this is all you should need to do. If you run into the same problem on Vista or newer, you will also need to turn off protected mode.
Saturday, April 18, 2009
Disabling script debugging in VS 2008
Open a new command prompt (start->run, cmd.exe). If you are on a 64-bit computer this needs to be a 32-bit prompt (start->run, c:\windows\syswow64\cmd.exe)
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f
(re)enable all script debugging
reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {170EC3FC-4E80-40AB-A85A-55900C7C70DE} /f
Tuesday, February 24, 2009
How to disable controls with a class in Firefox
.Button[disabled] { color: Green }
.MyLink { font-family: Arial; font-size: 11px; color: Black }
.MyLink[disabled] { font-family: Arial; font-size: 11px; color: Green }
.MyDiv { font-family: Arial; font-size: 11px; color: Black }
.MyDiv a { font-family: Arial; font-size: 11px; color: Red }
.MyDiv a[disabled] { font-family: Arial; font-size: 11px; color: Green }
Thursday, February 19, 2009
Monday, February 16, 2009
Windows 2003 : Disable roaming profile
Administrative tools > Active Directory Users and Computers > Users > Properties > Tab profile
> Clear Profile path area
Wednesday, February 11, 2009
DateTime format
The following table lists the standard DateTime format patterns associated with DateTimeFormatInfo properties. For more information, see Standard Date and Time Format Strings.
Format pattern | Associated property/description |
---|---|
d | |
D | |
f | Full date and time (long date and short time) |
F | FullDateTimePattern (long date and long time) |
g | General (short date and short time) |
G | General (short date and long time) |
m, M | |
o, O | Round-trip date/time pattern; with this format pattern, the formatting or parsing operation always uses the invariant culture |
r, R | RFC1123Pattern; with this format pattern, the formatting or parsing operation always uses the invariant culture |
s | SortableDateTimePattern (based on ISO 8601) using local time; with this format pattern, the formatting or parsing operation always uses the invariant culture |
t | |
T | |
u | UniversalSortableDateTimePattern using the format for universal time display; with this format pattern, the formatting or parsing operation always uses the invariant culture |
U | Full date and time (long date and long time) using universal time |
y, Y |
The following table lists the custom DateTime format patterns and their behavior. For more information, see Custom Date and Time Format Strings.
Format pattern | Description |
---|---|
d, %d | The day of the month. Single-digit days do not have a leading zero. The application specifies "%d" if the format pattern is not combined with other format patterns. |
dd | The day of the month. Single-digit days have a leading zero. |
ddd | The abbreviated name of the day of the week, as defined in AbbreviatedDayNames. |
dddd | The full name of the day of the week, as defined in DayNames. |
f, %f | The fraction of a second in single-digit precision. The remaining digits are truncated. The application specifies "%f" if the format pattern is not combined with other format patterns. |
ff | The fraction of a second in double-digit precision. The remaining digits are truncated. |
fff | The fraction of a second in three-digit precision. The remaining digits are truncated. |
ffff | The fraction of a second in four-digit precision. The remaining digits are truncated. |
fffff | The fraction of a second in five-digit precision. The remaining digits are truncated. |
ffffff | The fraction of a second in six-digit precision. The remaining digits are truncated. |
fffffff | The fraction of a second in seven-digit precision. The remaining digits are truncated. |
F, %F | Displays the most significant digit of the seconds fraction. Nothing is displayed if the digit is zero. The application specifies "%F" if the format pattern is not combined with other format patterns. |
FF | Displays the two most significant digits of the seconds fraction. However, trailing zeros, or two zero digits, are not displayed. |
FFF | Displays the three most significant digits of the seconds fraction. However, trailing zeros, or three zero digits, are not displayed. |
FFFF | Displays the four most significant digits of the seconds fraction. However, trailing zeros, or four zero digits, are not displayed. |
FFFFF | Displays the five most significant digits of the seconds fraction. However, trailing zeros, or five zero digits, are not displayed. |
FFFFFF | Displays the six most significant digits of the seconds fraction. However, trailing zeros, or six zero digits, are not displayed. |
FFFFFFF | Displays the seven most significant digits of the seconds fraction. However, trailing zeros, or seven zero digits, are not displayed. |
gg | The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string. |
h, %h | The hour in a 12-hour clock. Single-digit hours do not have a leading zero. The application specifies "%h" if the format pattern is not combined with other format patterns. |
hh | The hour in a 12-hour clock. Single-digit hours have a leading zero. |
H, %H | The hour in a 24-hour clock. Single-digit hours do not have a leading zero. The application specifies "%H" if the format pattern is not combined with other format patterns. |
HH | The hour in a 24-hour clock. Single-digit hours have a leading zero. |
K | Different values of the Kind property, that is, Local, Utc, or Unspecified. |
m, %m | The minute. Single-digit minutes do not have a leading zero. The application specifies "%m" if the format pattern is not combined with other format patterns. |
mm | The minute. Single-digit minutes have a leading zero. |
M, %M | The numeric month. Single-digit months do not have a leading zero. The application specifies "%M" if the format pattern is not combined with other format patterns. |
MM | The numeric month. Single-digit months have a leading zero. |
MMM | The abbreviated name of the month, as defined in AbbreviatedMonthNames. |
MMMM | The full name of the month, as defined in MonthNames. |
s, %s | The second. Single-digit seconds do not have a leading zero. The application specifies "%s" if the format pattern is not combined with other format patterns. |
ss | The second. Single-digit seconds have a leading zero. |
t, %t | The first character in the AM/PM designator defined in AMDesignator or PMDesignator, if any. The application specifies "%t" if the format pattern is not combined with other format patterns. |
tt | The AM/PM designator defined in AMDesignator or PMDesignator, if any. Your application should use this format pattern for languages for which it is necessary to maintain the distinction between AM and PM. An example is Japanese, for which the AM and PM designators differ in the second character instead of the first character. |
y, %y | The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero. The application specifies "%y" if the format pattern is not combined with other format patterns. |
yy | The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero. |
yyy | The year in three digits. If the year is less than 100, the year is displayed with a leading zero. |
yyyy | The year in four or five digits (depending on the calendar used), including the century. Pads with leading zeros to get four digits. Thai Buddhist and Korean calendars have five-digit years. Users selecting the "yyyy" pattern see all five digits without leading zeros for calendars that have five digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected. |
yyyyy | The year in five digits. Pads with leading zeros to get five digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected. |
yyyyyy | The year in six digits. Pads with leading zeros to get six digits. Exception: the Japanese and Taiwan calendars always behave as if "yy" is selected. The pattern can be continued with a longer string of "y"s padding with more leading zeros. |
z, %z | The time zone offset ("+" or "-" followed by the hour only). Single-digit hours do not have a leading zero. For example, Pacific Standard Time is "-8". The application specifies "%z" if the format pattern is not combined with other format patterns. |
zz | The time zone offset ("+" or "-" followed by the hour only). Single-digit hours have a leading zero. For example, Pacific Standard Time is "-08". |
zzz | The full time zone offset ("+" or "-" followed by the hour and minutes). Single-digit hours and minutes have leading zeros. For example, Pacific Standard Time is "-08:00". |
: | The default time separator defined in TimeSeparator. |
/ | The default date separator defined in DateSeparator. |
% c | Where c is a format pattern if used alone. To use format pattern "d", "f", "F", "h", "m", "s", "t", "y", "z", "H", or "M" by itself, the application specifies "%d", "%f", "%F", "%h", "%m", "%s", "%t", "%y", "%z", "%H", or "%M". The "%" character can be omitted if the format pattern is combined with literal characters or other format patterns. |
\ c | Where c is any character. Displays the character literally. To display the backslash character, the application should use "\\". |