Immediate Window in Visual Studio

The Immediate Window is your most valuable ally while debugging code. The Immediate Window is the equivalent of a debug window that allows you to watch the values of the variables in your code. (Bring up the Immediate Window by clicking on the View/Immediate Window Menu Option for Access v 2.0; View/Debug Window Menu Option for Access v 8.0)

The Immediate Window can be used to return values, set values and test the validity of conditions.

1. Putting a question mark before a variable or condition (e.g. ?MyVar) returns the value of MyVar. But remember that MyVar must be a variable local to the procedure you are stepping through or it must be a global variable. Asking for the value of a variable that is not declared in the current procedure will give you an error.

2. To set the value of MyVar while stepping through your code, you can bring up the Immediate Window and set the value just like you would in the Access Basic code.

MyVar = “The new value of this variable”

3. You may terminate a program by typing

End

in the Immediate Window.

4. If you are a teeny bit lazy about typing in the variable names in the Immediate Window each time you want to check their values, you could use this alternative instead:

Debug.Print MyVar

If you put this line at strategic points in your code you can see your code run through uninterrupted and see the values in the Immediate Window!! Since there is always a downside to everything, there is one here too. This slows down the execution speed of your code tremendously. So if you do choose to use this then you either comment out these lines or delete them entirely from your modules.

5. (Access v 2.0 only) One trick is to ensure that there are at least two line breaks between each variable whose value you wish to check. You may have noticed that if you write in two consecutive lines like:

?MyVar

?MyOtherVar

 

and if you put the cursor on the first line and hit <Enter> to check the value of MyVar again, then the second line is overwritten by the value of MyVar, even if it is empty. So, if you skip a line, you can keep using these two lines over and over again without having to retype them in every time you want to check the values.

(This does not happen in Access v 8.0)

We use the Immediate Window extensively while testing our code. To check values, to run functions. YES! You can execute functions or subroutines by ….

?MyFunction(Arg1, Arg2)

or

?MySub Arg1, Arg2

Posted in ASP.net | Tagged , | Leave a comment

IDENT_CURRENT, @@IDENTITY, SCOPE_IDENTITY

IDENT_CURRENT – returns the last identity value generated for a specific table in any session and any scope

@@IDENTITY – returns the last identity value generated for any table in the current session, across all scopes 

SCOPE_IDENTITY – returns the last identity value generated for any table in the current session and the current scope

Comparing identity values returned by IDENT_CURRENT, @@IDENTITY and SCOPE_IDENTITY

The following example shows the different identity values that are returned by IDENT_CURRENT, @@IDENTITY, and SCOPE_IDENTITY.

USE AdventureWorks;
GO
IF OBJECT_ID(N’t6′, N’U') IS NOT NULL
    DROP TABLE t6;
GO
IF OBJECT_ID(N’t7′, N’U') IS NOT NULL
    DROP TABLE t7;
GO
CREATE TABLE t6(id int IDENTITY);
CREATE TABLE t7(id int IDENTITY(100,1));
GO
CREATE TRIGGER t6ins ON t6 FOR INSERT
AS
BEGIN
   INSERT t7 DEFAULT VALUES
END;
GO
–End of trigger definition

SELECT id FROM t6;
–id is empty.

SELECT id FROM t7;
–ID is empty.

–Do the following in Session 1
INSERT t6 DEFAULT VALUES;
SELECT @@IDENTITY;
/*Returns the value 100. This was inserted by the trigger.*/

SELECT SCOPE_IDENTITY();
/* Returns the value 1. This was inserted by the
INSERT statement two statements before this query.*/

SELECT IDENT_CURRENT(‘t7′);
/* Returns value inserted into t7, that is in the trigger.*/

SELECT IDENT_CURRENT(‘t6′);
/* Returns value inserted into t6. This was the INSERT statement four statements before this query.*/

– Do the following in Session 2.
SELECT @@IDENTITY;
/* Returns NULL because there has been no INSERT action
up to this point in this session.*/

SELECT SCOPE_IDENTITY();
/* Returns NULL because there has been no INSERT action
up to this point in this scope in this session.*/

SELECT IDENT_CURRENT(‘t7′);
/* Returns the last value inserted into t7.*/

Posted in SQL | Tagged , , , | Leave a comment

Computer Slow down Issues

My Windows computer boots up slow.

Question:

My Windows computer boots up slow.

Answer:

A slow Microsoft Windows boot up can be caused by a wide variety of issues. Below are various suggestions and tips that can help improve the overall speed of your computers startup.

Disable startup programs

Programs that are loading up as the computer starts up to remain active in memory are often one of the main causes of a slow boot in Windows. Disabling programs you don’t often use from automatically starting up each time the computer boots can increase the boot time.

A program that makes managing your Windows startup programs easily is Mike Lin’s Startup Control Panel. Using this program you can disable any program in any of the locations programs use to start themselves automatically.

Additional information about disabling startup programs can also be found on document CHTSR.

Scandisk / Defrag

Running Microsoft ScanDisk and Defrag or similar disk utilities on the computer can help verify the hard disk drive has no errors as well as make sure the data on the hard disk drive is organized in the most efficient method. We suggest running both of these utilities at least once every few months.

Hard disk drive space

If your computer does not have at least 250MB of free available hard disk drive space this can cause an overall slowdown with your computer as well as decrease the boot time. Make sure your computer hard disk drive has 250MB or more of available disk space. Additional information about determining available hard disk drive space can be found on document CH000369.

Add memory

Adding additional memory (RAM) to the computer will help increase the overall speed of the computer and in some cases can also increase the load times of your computer. Today, we suggest all computers be running a minimum of 1GB of memory in their computer. If your computer is running less than this it may be time to upgrade.

Update drivers and Windows

Corrupt, incorrect, and/or out-of-date drivers can cause a number of different issues. Make sure your computer has the latest drivers as well as any available Microsoft Windows updates.

See document CH000545 for additional information and help with updating Windows.

Information about finding software and drivers updates can be found on document CH000644.

Registry cleaner

Although we don’t often recommend registry cleaners in some rare situations running cleaners can help improve the overall performance of Windows including the Windows startup. If you’ve run through all of the above recommendations you may want to clean your system registry.

Additional information on registry cleaners and recommendations can be found on document CH001077.

Format and reinstall

If after following all the above steps your computer still seems to be slow you may wan to erase everything from the computer and re-install Windows. This will clean your computer and make it like new. Additional information about how to do do this can be found on document CH00186.

Posted in Common Computing | Tagged , , | Leave a comment

Lost or forgotten Windows NT / 2000 / XP password

Lost or forgotten Windows NT / 2000 / XP password.

Question:

Lost or forgotten Windows NT / 2000 / XP password.

Answer:

Disclaimer: Gaining access to an account or computer that is not yours without permission by using any of the below steps is against the law. This document was created for users who’ve forgot their own computers Windows password. Additional legal information and policy information can be found on our legal page.

There are various utilities that enable a user to gain access to a computer they have forgotten the password to, below is a listing of some of the more popular utilities available.

Log into an alternate account

Often many users will leave the administrator account alone and/or have other accounts with administrator rights. If you’re not logging into the computer as administrator or have other accounts follow the below steps to reset your other accounts password.

  1. Reboot the computer into Safe Mode. Additional information about getting into Safe Mode is found on document CHSAFE.
  2. When logging into Safe Mode you should be prompted with an option to what account you wish to use. Select the Administrator account. If prompted for a password try simply pressing Enter on the keyboard for no password. If this does not work, try other passwords you may have used. If you’re unable to log into the Administrator account skip to the next suggestion.
  3. Once you’ve logged into the Administrator account open Control Panel and User Accounts.
  4. In User Accounts select the account you wish to change the password for, click change password and then enter the new password or click remove the password to remove the password from the account.

Windows XP users and Prevent a forgotten password option

If you have Windows XP and have gone through the “prevent a forgotten password option” and have created a diskette, use the diskette created to recover the forgotten password.

If you have not done this but would like information about how to do it, please see document CH000628.

Offline NT Password & Registry editor

The offline NT password & registry editor is a great utility that enables users to overwrite their Windows NT, 2000, and XP SAM file, the file containing their passwords, with a new password. This will not allow a user to view their previous password, however, it will allow the user to gain access to their unencrypted files again.

This utility is free and can be found on the below link.

http://home.eunet.no/~pnordahl/ntpasswd/ 

Emergency Boot CD

In addition to several other features, the EMCD, or Emergency Boot CD, is capable of changing the passwords of any user, including the administrator password in Windows NT, 2000, and XP without needing to know the previous password.

This utility is free and can be found on the below link.

http://ebcd.pcministry.com/ 

Other utilities

There are numerous other free and commercial utilities available for bypassing or changing an unknown password in Microsoft Windows NT, 2000, and XP. The above two utilities are the more popular solutions and are highly recommended. If these utilities do not suit your needs, you may also want to perform a quick search on your favorite search engine

Data recovery

If you have tried the above suggestions and are unable to gain access to the files you need to access, some data recovery companies may be able to access your data. Additional information about data recovery as well as links to companies specializing in this service can be found on document CH000342

Format and reinstall Windows on the computer

Finally, if after the above steps you are still unable to gain access to your computer, or if you are unable to use any of the above utilities, unfortunately, your only alternative to getting access to your computer would be to erase everything on the computer and reinstall Windows. Any data you need access to will need to be restored from your backups.

Posted in Common Computing | Leave a comment

Password Protect my files and folders in Windows

How do I password protect my files and folders in Windows?

Question:

How do I password protect my files and folders in Windows?

Answer:

Tip: Before password protecting any document you may wish to create a backup of the non-password protected folder and files in case you forget the password in the future.

The majority of Microsoft Windows operating systems do not come with a method of password protecting your sensitive files and/or folders. If you’re using Microsoft Windows 3.x, Windows 95, Windows 98, you will need to download or purchase a third-party program to password protect your files and folders in Windows; skip down to the other security solutions section if you’re using one of these operating systems.

Microsoft Windows XP professional users
Microsoft Windows XP home users
Other security solutions for protecting your files and folders in Windows
Things to remember when encrypting or password protecting files and folders

Microsoft Windows XP professional users

The below steps for encrypting the files on Windows XP professional applies to users who are using a computer that has different accounts. If you’re using a single account for all users who use the computer you will need to see the below other security solutions section.

  1. Select the folder you wish to encrypt.
  2. Right-click the folder and click Properties.
  3. Click the Advanced button.
  4. Check “Encrypt contents to secure data” option.
  5. Click Apply and then Ok.

Encrypt contents to secure data is grayed out

This will be grayed out if you’re using the home edition of Microsoft Windows XP. See the below steps for securing the contents of your folders in Windows XP home.

Show “Encrypt” on the context menu

The newest version of TweakUI also enables you to show the Encrypt option in the context menu. To do this, follow the below steps.

  1. Open TweakUI. If you do not have TweakUI you can find additional details about getting and installing TweakUI in document CH000141.
  2. In the TweakUI window, select Explorer
  3. In the right side of the window under Settings, locate Show ‘Encrypt’ on context menu and check the box. This option should be below Prefix ‘shortcut to’ on new shortcuts and above Show ‘View workgroup computers’ in NetPlaces.

If you’re missing this option, see document CH000711 for additional information.

Microsoft Windows XP home users

  1. Select the folder you wish to encrypt.
  2. Right-click the folder and click Properties.
  3. Click the Sharing tab.
  4. Check the box Make this folder private
  5. Click Apply and then Ok.

Make this folder private is grayed out

In order for this option to work in Microsoft Windows XP home you must meet the below requirements.

  1. The hard disk drive must be formatted in NTFS and not FAT32. Additional information about determining the type of file system your hard disk drive is running can be found on document CH000713.
  2. The folder you’re attempting to encrypt must be in your own personal folder. For example, if your name is bob, you must be encrypting a folder that is or that is contained within the below folder:

    C:\Documents and Settings\Bob\

    You cannot encrypt any folders outside of this folder. If you wish to encrypt outside this folder see the below other security solutions.

Other security solutions for protecting your files and folders in Windows

File and folders not frequently used

If you need to password protect files and/or folders that you do not frequently use, one of the simplest ways is to compress the folder and files with a compression utility and password protect the compressed file. However, each time you wish to work or modify the files you will need to uncompress the files using the password.

Windows ME and Windows XP users – Microsoft Windows ME and Windows XP come with their own compression utility. This utility can also be used to compress and password protect files.

Tip: When a file is compressed, users can still view a listing of the files in the compressed file. If you wish for both your file names and the contents to be hidden, move all the files into a single folder and password protect that folder.  

File and folders frequently used or accessed

If you need to password protect and/or encrypt data you frequently use, you will need to install a third-party program that will enable you to protect your files and folders. Below are some free and commercial solutions.

  • AxCrypt – An excellent free encryption utility that enables users to encrypt all files within a folder and not allow those files to be viewed unless a passphrase (password) is known.
  • WinCry – A freeware utility that enables your files to be encrypted, secure deletion, as well as other helpful methods of protecting your files.
  • Folder Guard – A commercial version of a password protection software that enables you to password protect files, folders, and other Windows resources.

Click here to search for more solutions to password protect files and folders in Windows.

Things to remember when encrypting or password protecting files and folders

  1. There is no such thing as a 100% protected file. There are numerous tools, utilities, and instructions for how to break a lot of the encryption and passwords on files. However, the protection methods listed above will protect your files from the majority of users who may encounter them. If you’re working with really sensitive data we suggest a commercial product for protecting your files and data.
  2. Even though a file or folder may be password protected it still can be deleted (unless the program supports the ability to protect files from being deleted). Always remember to backup all your files, even those protected by passwords.
  3. If you forget the password, unless you’re willing to spend the time attempting to break it or pay someone else to break the password, all your file data will be lost. Unless you’ve made a backup of the non-password protected data.
Posted in Common Computing | Leave a comment

SQL Backup – Enable Agent XP’s

SQL Backup:
—————
When you are think about sql backup, you have lot of options to do within your SQL Studio.

Simple & Immediate Backup:
———————————–
This is quite simple and this backup won’t recur. This is will do the backup for this instance.

Todo this,
-> Extract Database
-> Right click on the database which you want to backup
-> Tasks -> Backup

-> On the Backup Database window show the location and get the backup

Scheduling Backup:
———————–
This is most used and required one. You can schedule the back up here.

Todo this,
-> In Object Explorer, Extract Management Folder
-> Right Click Maintenance Plans

If you get any error message, that suppose to be a Agent XP’s issues. You need to enable this by running the following query:

sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE;
GO
sp_configure ‘Agent XPs’, 1;
GO
RECONFIGURE
GO

Once you done this you will get the wizard and follow the wizard schedule your backup.

Article Based: SQL Server 2005
Backup Tested: Windows Server 2003

Posted in SQL | Tagged , , | 1 Comment

Add Favicon to Your Web

 

favicon.cio

favicon.ico

What is favicon?
——————-
A favicon (short for favorites icon), also known as a website icon, shortcut icon, url icon, or bookmark icon is a 16×16 pixel square icon associated with a particular website or webpage. A web designer can create such an icon and install it into a website (or webpage) by several means, and most graphical web browsers will then make use of it. Browsers that provide favicon support typically display a page’s favicon in the browser’s Address bar and next to the page’s name in a list of bookmarks. Browsers that support a tabbed document interface typically show a page’s favicon next to the page’s title. The Microsoft Windows Shell also uses favicons to represent “Internet shortcuts” to web pages

Use of favicon:
——————
-> It doesn’t provide anything better in functionality
-> But instead of showing the internet explorers icon in the Address bar and your Tab, You can have your own icon
-> This podcasts your logo with more effective way

Add favicon.ico to your web
————————————
-> The image size should be 16X16 (will be better)
-> The image should be converted from your own format(png,jpg,gif) to .ico
-> You can use the following tools to make your image as favicon.ico – http://www.favicon.cc, http://www.favicon.co.uk/, http://www.favicongenerator.com/ or you can use own paint tool, if you have such a advanced paint tool.
-> Place your favicon image to your web directory
-> Add the following tag “<link rel=”shortcut icon” href=”http://www.sellwincreation.com/favicon.ico” />” inside the <head></head> tag

Posted in Web | Tagged , , , | 1 Comment

Block Internet Access Using Content Advisor

Blocking Internet Access through Content Advisor:
—————————————————————

We have seen before about blocking internet through very simple method like host editing. Here we have another option called “Content Advisor”, which is better than all other methods. And basic security is ensured by this method. The only drawback is, it will works fine with only Internet Explorer. Other Browsers we have to check it about equivalent feature.

To enable this feature, You need to log on using administrator account. Follow the below steps to activate Content Advisor:

Step1: Open Internet Explorer
Step2: Go to Tools->Internet Options. Click Content Tab
Step3: On Content Advisor, Click Settings and General Tab
Step4: On General Tab set supervisor password, click ok and close
Step5: Again on Internet Options, below Content Advisor click the Enable Button. It will ask you for supervisor password which you set it before. Click Ok and Clsoe.
Step6: Restart the Internet Explorer.

So thats it. Now if you try to access any of the website, it will block you and ask for supervisor password to access that particular page.

Check this blog in certain period. I will update you about more security tips. Thank you!!!

Posted in Common Computing | Tagged , , , | Leave a comment

Thumbs.db

Thumbs.db

I’m sure everyone using Windows XP, VISTA or FTP Server has seen a small file in some directories called thumbs.db. Many of thm may fed up with this file. This thumbs.db will be created, where you have images or other multimedia files. Although you delete this file, It will create it back. Well! So what is Thumbs.db?

Thumbs.db is a cache of the thumbnail pictures in a directory. It speeds up the showing of thumbnails when you are viewing a folder in Thumbnail view. It just for Thumbnail View of your folder and saves the time to recount the total number of pictures and loading thumbnail view.

To turn this feature off, do the following:

1) Open My Computer
2) Click on Tools
3) Click on Folder Options
4) Click on the View Tab
5) Place a check in the option “Do not cache thumbnails”
6) Click Ok
7) Close My Computer

The only drawback of the thumbs.db file is that it takes up disk space. Although this space is very small in most cases, if you have a lot of thumbs.db files littering your hard drive you may be able to save some valuable space by removing them. Follow the steps below to turn off the creation of this file and delete the thumbs.db files that are on your hard drive.

Posted in Common Computing | Tagged , , , | Leave a comment

Send Form Information Via Email – HTML

To send a Form Via Email in your WebPage:
—————————————–

This below page will allow you to send a user form via email to us. You must the place which is action=”", This will vary according to the ISP. The below will work, if you hosted with Yahoo Server. For Godaddy you may have to use the built in script like gdform.aspx which comes along with the host. Like each provider there would be some script or any solution would be available to send email.

<html>
<head></head>
<body>

<h3>E-Mail Form:</h3>   
<form method=”post” action=”http://webhosting.yahoo.com/forms?login=YourLoginName“>
<input type=”hidden” name=”Subject” value=”Submission From Intranet”/>
<input type=”hidden” name=”Redirect” value=”ThankYou.aspx”/>
<span class=”style4″>
<font color=”#0000FF”>Your Name:</font></span><br>
<input type=”text” name=”Name” value=”" size=”20″ style=”width: 254px”><br/>
<span class=”style4″>&nbsp;<font color=”#0000FF”>Your E-Mail:</font></span><br/>
<input type=”text” name=”Email” value=”" size=”20″ style=”width: 254px”>
<span class=”style4″>
<br/>
<font color=”#0000FF”>Message:</font></span><br>
<input type=”text” name=”Comment” value=”" size=”40″ style=”width: 254px; height: 79px”><br/><br/>
<font color=”#000080″>
<input type=”submit” value=”Send” style=”background-color:blue;width:76px”></font>&nbsp;&nbsp;&nbsp;
<font color=”#000080″>
<input type=”reset” value=”Reset” style=”background-color:blue;width:76px”></font>
</form>

</body></html>

Posted in Web | Tagged , , | Leave a comment