Set the First Home Page in IE Internet Explorer

19. February 2009

A registry tweak, use at your own risk.

Works in IE6 and IE7. This is not tested in IE8 however I see no reason, thus far, that it won't work for IE8.

In windows you can use Regedit by clicking Start, Run and then type Regedit.
This will set the First Home Page for IE. This is the page that loads when you first start IE. This not to be confused with the Home button in IE. The home button should follow whichever Homepage you have set in IE's Internet Options. So in effect you could have two home pages. One which shows when you start IE and one which shows when you click Home. At this point it would be a good idea to print this portion and close all open windows as you should re-boot to ensure the new settings take. Also keep in mind Software that protects changes to the registry should be disabled, like Adaware Adwatch and Spybots Search & Destroy Teatimer. Remember to re-enable any software you disabled when you are finished.

It is a good idea to set a restore point in Windows XP or back up your Registry at this point. Both are beyond the scope of this post, you can Google "back up your Registry" to find the information you may need.

[HKEY_CURRENT_USER\Software\Microsoft \Internet Explorer\Main]
"First Home Page"="
http://www.google.com/"

You will need to use the Folder Icons in the left hand window and expand each folder icon until you find the "Main" folder and left click it. My own PC lacked this value.

If the String Value "First Home Page" does not exist you will have to ensure you have left clicked "Main" in the left hand side of the Registry Editor. Once this is done re-verify "First Home Page" is not present in the right hand side of the window. If "First Home Page" is not present then Rt click the right hand side of the window and then select New/String Value. This will insert a new value ready to be named, so name it "First Home Page" without the Quotes. Double click your new entry "First Home Page" and enter a new value.

As above "
http://www.google.com/" would be the First homepage URL you wish to use.
Use the above at your own risk; I am not responsible if you screw up your registry.

The folowing picture is what it should look like when you are finished:

STOP the IE7 Get it now Offer 

Note: If you wish to change your first home page then you will need to re-edit the above registry setting.

Tags: 

Reference , ,

MS Access Table Design

15. February 2009
I am going to discuss MS Access Table Design in this post it will be detailed and lengthy. We will deal with basic data; each record will contain Name and Address information. We will then walk through the process of designing the Table or Tables as the situation may require. We will touch on Field Data Types, Primary keys and Indexing and field sizes.  We could go about this in at least two ways. The first is to set up a single Table for our data in which we include the Name of the contact and their Address. A single table is simple and functional for smaller databases. The Second is to split the Names from the Addresses into two Tables each with a common field we can use to join them. Two tables will add a small level of complexity and is better for larger databases.  The actual process of creating a Table will be similar for both methods and the process is similar in MS Access 97, 2000 and 2003. MS Access 2007 has some differences however once you have the initial table in design view you can follow along. 
For a Basic Table Design with pictures see my MS Access Basic Table Design Tutorial.

 

Section One: Creating an MS Access Table

This section will have some commonalities for both the Single and the Two Table design process.

Part One: Creating the Table in MS Access

1) In an existing MS Access Database, under the Objects Menu of left hand side of the window, select Tables
2) Select Create Table in Design View
3) A new window will pop up called Table1: Table where 1 can be any number depending on current table names if any

Part Two: Creating Fields for an MS Access Table

            1) The new Table Design window will have three columns: Field Name, Data Type, Description
            2) Under Field Name you will enter the Names of the fields we want in our new Table
            3) Enter in the following Fields:
                        a) RECNUM              
                        b) CONTACT
                        c) ADDRESS
                        d) ADDR2
                        e) CITY
                        f) STATE
                        g) ZIP
                        h) PREFIX
                        i) FIRSTNAME
                        k) LASTNAME
                        l) SUFFIX
                        m) GENDER
                        n) ZIP5
            4) In the Description column you can type a description for each field
            5) Enter in the following descriptions for others who may view the Table:
                        a) RECNUM field: “Master Record Number for each contact.”
                        b) ZIP field: 9 digit zip code
                        c) ZIP5 field: 5 digit zip code 
            6) Select Data Types from the Data Type column, default is Text
            7) Change the following Data Type:
                        a) RECNUM Field: Data type Autonumber
                        b) The rest can remain as Text

Zip codes you may think should be set to Data Type Number, this is incorrect. MS Access will drop all leading Zeros for any number, at least for Versions 97-2003. As for 9 digit Zip codes you have a – and the dash makes the number a string Text data type. MS Access 2007 may have a Data Type for Zip codes however Text works just fine in either case.

At this point you may wish to set Field sizes on the bottom half of the screen named “Field Properties” on the “General” Tab find Field Size. Text fields default to 50, you can enter in the appropriate size for ZIP (Set to 10, 9 digit zip code and the -), ZIP5 (Set to 5) and so on. Be aware that if you enter data whose length is longer than the field size, via Appends, Updates or otherwise, the data will be truncated to the field size.

 

Part Three: Setting Primary Keys and Indexing in MS Access

            1) RECNUM field: Right click and select Primary Key
                       
                       
a) Note that the RECNUM field would be used to join your contacts to another table such as one called SALES
                        b) To Join fields in a Query they must be of the same Data Type (Autonumber is considered a Data Type of Number and is a Long Integer under Field Size)
                        c) You can select multiple fields as Primary Key, to do this Click one field, then hold the CTRL key and click another, while holding CTRL right click one of the fields selected and click Primary Key
                        d) Primary Keys must be Unique, meaning there can be no duplicate records within the Primary Key
                        e) Primary Keys automatically set Indexed to “Yes (No Duplicates)” attempting to change this would result in the removal of the Primary Key

            2) ZIP5, CITY, STATE, GENDER and LASTNAME fields: Left click each one   at a time
                        a) Per each field on the bottom half of the screen named “Field Properties”  on the “General” Tab find “Indexed” its default is No
                        b) Change No to “Yes (Duplicates OK)” by clicking and selecting it from the list
                        c) Fields you will be searching through or using to join to other tables should be indexed to improve performance

 

At this point you can close your table. MS Access will then ask you to save if you have not already. MS Access will also ask you to set a Primary Key if you have not.

Hear the Single Table Design process ends.

 

Section Two: Creating Two Tables in MS Access to store related Data
You may want two tables in which both tables will have a field in common to tie the two together. In my case I will have one table for contacts and a second for their location.

Part One:
The same as “Section One”, “Part One process” for both tables

            1) In an existing MS Access Database, under the Objects Menu of left hand side of the window, select Tables
            2) Select Create Table in Design View 
            3) A new window will pop up called Table1: Table where 1 can be any number depending on current table names if any

Part Two:  Creating Fields for an MS Access Table

 

            1) The First table I will refer to and eventually save as New_Contacts
            2) Under Field Name you will enter the Names of the fields we want in our new Table
            3) Enter in the following Fields:
                        a) RECNUM              
                        b) CONTACT
                        c) PREFIX
                        d) FIRSTNAME
                        e) LASTNAME
                        f) SUFFIX
                        g) GENDER

Part Three: Setting Primary Keys and Indexing in MS Access

            1) RECNUM field: Right click and select Primary Key
                        a) Note that the RECNUM field would be used to join your New_Contacts table to the second table I will call LOCATION
                        b) To Join fields in a Query they must be of the same Data Type (Autonumber is considered a Data Type of Number and is a Long Integer under Field Size) both tables will include the RECNUM field
                        c) Primary Keys must be Unique, meaning there can be no duplicate records within the Primary Key

            2) GENDER and LASTNAME fields: Left click each one at a time
                        a) Per both fields on the bottom half of the screen named “Field Properties” on the “General” Tab find “Indexed” its default is No
                        b) Change No to “Yes (Duplicates OK)” by clicking and selecting it from the list
                        c) Fields you will be searching through or using to join to other tables should be indexed to improve performance Primary Keys automatically set Indexed to “Yes (No Duplicates)”

You would now want to save the New_Contacts Table. 

Part Four: The Second Table in MS Access

            1) The Second table I will refer to and eventually save as LOCATION
            2) Under Field Name you will enter the Names of the fields we want in our new Table
            3) Enter in the following Fields:
                        a) RECNUM              
                        b) ADDRESS
                        c) ADDR2
                        d) CITY
                        e) STATE
                        f) ZIP
                        g) ZIP5

Part Five: Setting Primary Keys and Indexing in MS Access

            1) RECNUM field: Right click and select Primary Key
                       a) Note that the RECNUM field would be used to join your New_Contacts table to the second table I will call LOCATION
                       b) To Join fields in a Query they must be of the same Data Type (Autonumber is considered a Data Type of Number and is a Long Integer under Field Size) both tables will include the RECNUM field
                       c) Primary Keys must be Unique, meaning there can be no duplicate records within the Primary Key

            2) CITY, STATE and ZIP5 fields: Left click each one at a time
                        a) Per both fields on the bottom half of the screen named “Field Properties” on the “General” Tab find “Indexed” its default is No
                        b) Change No to “Yes (Duplicates OK)” by clicking and selecting it from the list
                        c) Fields you will be searching through or using to join to other tables should be indexed to improve performance Primary Keys automatically set Indexed to “Yes (No Duplicates)”

You would now want to save the LOCATION Table. 
One thing to note that pertains to both methods: upon creating new fields on the bottom half of the screen named “Field Properties” on the “General” Tab find “Required”. Set this to No if you want to be able to leave fields blank when entering new data. 

You should now be done Designing your Table or Tables in MS Access and are now ready to begin entering Data.

Tags: 

MS Access, Reference , , , ,

Prevent Clicking your AdSense by Accident in ASP.NET

13. February 2009

Here is a simple ASP.NET Code Snippet that Hides your AdSense by blocking or filtering your IP.

This part you would want to place before what you want to block the IP from:

<%

string strIP = Request.UserHostAddress;

switch (strIP) {

case "IP#1 here":

Response.Write("No Ad1: " + strIP + " ");

break;

case "IP#2 here":

Response.Write("No Ad2: " + strIP + " ");

break;
default:

%>

The following you place after whatever it is you want blocked from certain IPs:

Some Code here

<%

break;

}

%> 

Tags:

Reference , ,

MS Access Group by, Count and Sum Query

9. February 2009

I posted this in a forum somewhere; I figured I would repost here with pictures.

Say you have a Table named 1A and Three Fields Named COUNTRY, COMPANY and BALANCE.
The following SQL Code Counts Each Company in each Country and Sums their Balance all in one Query:

SELECT [1A].COMPANY, [1A].COUNTRY, Sum([1A].BALANCE) AS SumOfBALANCE, Count("") AS SHOW_COUNT
FROM 1A
GROUP BY [1A].COMPANY, [1A].COUNTRY;

MS Access Count and Sum Query. 


In MS Access you can copy/paste the SQL into a Query using SQL View. You can then write over the "1A"s with your own table name.

MS Access SQL View Query. 


SQL View is very handy in Reverse as well. On Running the Query you will then Count each instance of a Company within a Country and Sum their Balances within said Countries.

To get a company’s Grand Total you would run the above as a Make Table Query and then run the Following on the New Table:
Use the Method above to paste into a new Query:

SELECT [1A].Company, Sum([1A].BALANCE) AS SumOfBALANCE
FROM 1A
GROUP BY [1A].Company;

A two step process for Totals of a Company World wide, a one step process for Totals of a Company per Country.

Tags: 

MS Access, Reference , , , , ,

Prevent Clicking your AdSense by Accident

6. February 2009

Here is a simple ASP Code Snippet that Hides your AdSense by blocking or filtering your IP.

This part you would want at the top of a page:
<%
dim blockip
 
blockip = Request.ServerVariables("REMOTE_HOST")
%>

The following you place wherever your Ads would be:

A Single IP# Version:


<%
 if blockip <> "000.000.000.000" then%>

    <div align="center">
“Your AdSense Code here.” Note: Replace the 000.000.000.000 and 111.111.111.111 with the IP# you wish to block.
    </div>
<%   
   else
   "Show Something Else."
   end if   
%>

 

A Two IP # Version:

<%
 if blockip <> "000.000.000.000" then
    if blockip <> "111.111.111.111" then %>
    
“Your AdSense Code here.” Note: Replace the 000.000.000.000 and 111.111.111.111 with the IP# you wish to block.
  
<%   
   else
      "Show Something at work."
   end if   
 else
     "Show Something at home."
 end if
%>

Tags:

Reference , ,

MS Access Tutorials, Examples and Help

4. February 2009

The following are links and descriptions of various MS Access Queries authored by me:
MS Access Tutorials For my Complete List

 

MS Access tutorials 2000, 2002, 2003, 2007:

A series of Microsoft Access Database Tutorials and Examples written by myself.


  • Left Hand Column Covers VBA



  • All tutorials created in MS Access 2003

  • Right Hand Column Covers Tables and Queries

  • MS Access Autonumber Field with VBA
    Creates an Autonumber field using VBA, Changes a current fields name, Adds a regular Text Field all in VBA on an Existing Table
    "Not Enough Space on Temporary Disk" error work around
    Makes use of a MS Access Form and Module

  • MS Access Create Table
    This tutorial walks you through the MS Access Create Table in Design View process

  •  MS Access VBA Update Field
    Using VBA to Update a Field, VBA Code to Update an existing field

  • MS Access Basic Table
    In this tutorial you will learn basic MS Access Table Design : Index, Autonumber using data type

  •  MS Access VBA Create Field
    Using VBA to create a new Field with several data types available

  • MS Access Query Builder
    A very Basic MS Access Select Query using an All Fields Wild card

  • MS Access VBA Change Field Data Type
    Using VBA to Change a Fields Data Type, VBA Code that changes a Fields data Type using ALTER Table ALTER Column

  • MS Access Query Builder 2
    MS Access Select Query using specific criteria with joins

  • MS Access VBA Check if Table Exists
    VBA Check if Table Exists, VBA Code to Check for a table

  • MS Access Query Builder 3
    Select Query using specific criteria with WildCards in MS Access

  • MS Access VBA Check if Field Exists
    VBA Check if Field Exists, VBA Code to Check for a Field in a Table

  • MS Access Append Query Tutorial
    A simple "How To" MS Access Append Query

  • MS Access VBA Delete Query
    Using VBA Delete Query, VBA Code to Delete existing records given Criteria

  • MS Access Append Query in SQL
    Shows how to view the MS Access Append Query In SQL View

  •  MS Access VBA Get All Fields
    Using VBA to Get All Fields, VBA Code that Returns all Fields Within a Table

  • MS Access Update Query Tutorial
    An MS Access Update Query that uses a Yes/No Field to select records

  • MS Access VBA Rename Field
    Using VBA to Rename a Field, VBA Code to rename existing fields

  • MS Access Insert Into or Make Table Query Tutorial
    Create a new table using the MS Access Make Table Query

  • Coming Soon!

  • MS Access Simple Primary key
    Learn how to set the MS Access Primary Key: Setting the Primary Key for one or more fields in a Table

  • Coming Soon!

  • MS Access Count Query Tutorial
    Create a new Query to "Group By" and count a with criteria in MS Access

  • Coming Soon!

  • MS Access Count Query Tutorial for a Yes/No Field
    Create a new Query to "Group By" and count a Checked Yes/No field in MS Access

  • Coming Soon!

  • MS Access Delete Query Tutorial
    A basic MS Access Delete Query using criteria


  • Tags:

    MS Access, Reference , , ,