How to Migrate Data From Microsoft Access to MySQL

December 14th, 2007

Okay, the past two days have been so hectic for me I decided to Blog about it. So just how do you Migrate a 40,000 record Table from Microsoft Access into MYSQL database? Well just to tell you up front my experience is one of having to do it using Godaddy’s Shared Hosting Environment. But I don’t think that really matters that much so I”ll just keep on with my blog here. My environment:

Windows XP OS
Microsoft Access2007
Godaddy.com for the Shared Hosting running on a Linux Platform and being forced to use the ir phpMyAdmin version 2.9.1.1

Okay so here was my dilemma. I had a songlist.mdb that was 12MB in size and contained 40,000 records in one table. I needed this data loaded into MySQL and I wasn’t going to do it manually 1 record at a time.

Solution:

First in Microsoft Access you can export your table out as a .xls file which you can then save as a .csv file. Access is nice as it gives you many other file formats to export your data as like xml and a few others… But for this purpose we needed it to be .csv as required by the ol phpMyadmin (which by the way will only let you upload a .csv as long as it’s under 2MB(which mine wasn’t) but we’ll save that discussion for later on). So in Access:

1. Select your Table
2. Right Click it and choose Export
3.Choose Excel
4. Browse to the directory where you want to save your file
5. Save your filename to whatever you want

Now open up your .xls file that you just saved and then save it out as a .csv. Simply choose Save As option and in the “Save as Type” dialogue box slect CSV (comma delimited).

If your hosting provider doesn’t set limits on the file size of your csv then simply make sure that you have your table created in MySQL just as it is in Microsoft Access. (If you don’t know how to do that just email me at jimmyharrell@jimmyharrell.com and I’ll call you up and walk you through it. Pretty easy.

Now if you’re limited to file size as I am then you’ll need to break up your csv file into chunks. So for me that meant 10,000 records at a time to keep the file size under 2MB. To do this is pretty easy

1. Open up your csv file and simply go down to the 10,000th record. Any row after that, you’ll delete. Just make sure you have a copy of the entire csv as a backup somewhere b/c you’ll have to do this four more times to get the other 30,000 reocrds. Once you’ve done this then go to the phpmyAdmin and select your table, then select Import (I’ve attatched a screenshot) .

Screenshot of my myPhpAdmin

Now I don’t know about you but for me, in the first field of my KaraokeTracks Table, I had a field named AritstName.

This field had , <-commas in the name like this: McGraw, Tim. So in the phpadmin screenshot you’ll see something that says “Fields terminated by” and to the right you’ll see a ; <- semicolon.

At first when I would load my .csv file I kept getting an “Invalid Field Count” error message which frustrated me to death b/c my csv file has 7 fields ans so did my Table in my MySQL table. So when I changed the value from a ; to a , (semicolon to a comma) and then uploaded the csv file it was like magic. Abracadabra I know had my first 10,000 records loaded into My Table all in a matter of about 10 seconds.

SelectORacle CSS Selector Translater. A Powerful Tool for CSS Developers.

November 11th, 2007

Ever wondered what a particularly complex CSS selector really means? Here’s your chance to find out! Simply enter one or more semi-colon separated selectors or rulesets into the following “Direct Input” area, or provide the URL of a stylesheet in the “URL Input” area. Best of all, the SelectORacle will flag potential errors and other problems, and it won’t choke on any actual rules. You’ve always wanted to know what makes those line-noise posers tick– now you can.


Best Extension out there for Firefox Browser

November 11th, 2007

Have you guys heard of FEBE and CLEO? If not and you’re an avid Mozilla Firefox Browser user, by far these are the best extensions Firefox has to offer. Why? Well it’s simple. FEBE allows you to manage all of your extensions and CLEO works alongside of FEBE. It allows you to package all of your extensions into one single .xpi file which you can name whatever you like. Once you have this .xpi file, then you can upload it to any ftp server and share it with other developers/users. This also means that now everytime you install Mozilla on a different machine that you don’t have to re-install all of your extensions. You simply get your .xpi file (for example my xpi is named. JimmyHarrellsExtensions.xpi).
1. I”ll download this xpi file on whatever machine I’m on.
2.Install Mozilla Firefox browser on my machine.
3. Click File–> Open on the Mozilla browser window and simply open up the .xpi file.
4. Mozilla opens installs all your existing extensions and you’re done.

Woo hoo.

Free CSS Formatter and Optimizer

November 11th, 2007

CleanCSS is a powerful CSS optimizer and formatter. Basically, it takes your CSS code and makes it cleaner and more concise.

Why optimize?

Well for two reasons mainly. It helps you get smaller CSS file sizes and better written code. The way the optimizer works actually lets you decide how much compression you want. From super compressed (virtually unreadable and editable by a human being) to visually pleasing. I prefer the standard setting because it gives you a little of both.

Another cool feature is that it helps you with shorthand coding. I am by no means an expert at CSS. I do not have all the shorthand methods memorized (yet!). For those of you using Dreamweaver, like myself, you’ll find that it likes to use longhand code. By this I mean putting each seperate rule on it’s own line. This can get tedious copying and pasting it make a small change. A lot of that stuff can get consolidated into one line, like backgrounds and borders.

So your main reasons for wanting to optimize are to make sure your CSS files are clean. There is a certain art form in clean and concise code. And I’m not even a programmer and I can see that. I’m an artist, so this tool really helps speed things up.

This Q&A was taken directly off Clean CSS. To get to the site you can go to my site in my Sig Line and simply Click on “My Top Ten Sites” in the left Nav Bar. Have fun and remember to optimize your CSS.

How To Transfer and Share Your Dreamweaver Snippets

November 11th, 2007

Boy oh boy this is a hidden gem for you Dreamweaver lovers. Do you use snippets? Snippets are simply blocks of code that you use to make your life easier as a developer. Whether it be JavaScript snippets, HTML snippets etc. There may be a snippet that you use all of the time. I know I do for popups etc. Anyways this is how you can take all of your snippets for Dreamweaver at home and put them on your work computer or simply share them with other Dreamweaver Developers.

For Windows XP and Dreamweaver8 Users only ( I’m sure its something similar for other OS’s and versions of Dreamweaver)

1. You’ll need a Flash Drive or FTP site.
2. On windows you must have hidden files and folders enabled. If you don’t, ope n up your MyDocuments folder and click on –>Tools–>Folder Options–View and under Hidden Files and Folders be sure to check the Show Hidden Files and Folders Option. Now you’ll be able to see hidden system files.

3. Now that you’ve enabled hidden files go to MyComputer

C:\DocumentsandSettings\[UserName]\ApplicationData\Macromedia\Dreamweaver 8\Configuration

Then find the “Snippets” folder

4. Copy and past this folder either on your Flash drive or FTP site.

5. When you get to work or whereever you have Dreamweaver8 running, simply make sure you have hidden files and folders enabled and overwrite your snippets folder with the new one.

6.Open up Dreamweaver and Abracadabra you now have your new snippets loaded from you old machine.

2nd Best Browser Extension for Mozilla FireFox

November 11th, 2007

Foxmarks. Ever wondered how you can take all your Favorite Bookmarks on your home computer and have them at work? Well now you can with the Mozilla Foxmarks add-on. It simply allows you to login and automatically upload/update your existing bookmarks on your local machine to the Foxmarks server. Then when you open up Mozilla FF at work or whereever simply login to your Foxmarks account and sync up. Now you have all of your bookmarks at work. It’s that simple.

How To Get Rid of Recent Projects in Visual Studio

November 9th, 2007

Ever go to your start page and in your Recent Projects dialogue window see all of those recent projects/branches that you used to work in, and not be able to get rid of them?

Screenshot in Visual Studio

Well today, I’m going to share a little tip on how to do it. It’s quite simple really. The problem is that it’s stored in your registry.

In order to remove them, you simply have to know where to go in your registry to delete the files.

Caution: Removing files in your registry can be dangerous and harm your system. Be sure to follow these directions carefully, or you could open up a can of worms and have the IT Desktop Support department looking for your head.

Click Start->Run-> and type “regedit”. When the diologue box opens up, here is your path to remove the files:

HKEY_CURRENT_USER/Software/Microsoft/Visual Studio/Version number (for example 8.0)/ProjectMRUList

Remove the Project File Paths you no longer use and then Restart Visual Studio.

Rounded Corners Made Easy A Step-By-Step Guide

November 8th, 2007

This post is about a technique that I use quite often over at Chemistry.com whenever someone from our Product department comes over and provides me with a comp that contains rounded corners in the Design.

It’s really efficient and although this is a pretty verbose post, once you choose your “type” of rounded corner, you can literally have your rounded corner and content ready and out the door within 15 mins. This technique utilizes the Rounded Cornr” Generator found on www.roundedcornr.com.

It is a pure CSS approach and the images for the rounded corners are even provided to you via the generator. Here is a link to the original Word Document if you want to download the word version. Otherwise, enjoy.

Rounded Corners Made Easy A Step-By-Step Guide

If you want :
Rounded corners with a border using Solid Web Safe Colors

Note: The width of the box should not be stretched to more than 1024 pixels using this option, and the height of the content should not be stretched to more than 600 pixels so to fix the width go to step 4.

This option creates images as png’s if you want gif’s take the images after they’re created and simply open up your favorite image editing program and save them as gifs. Make the necessary changes in your css to reference the gif images.

1. Simply visit www.roundedcornr.com and choose the “RoundedCornr with Border” option. Fill in the required attributes and it will spit out the HTML, CSS, and Images for your rounded corners just as you like.

2. Replace the <p> tag with a <div> tag just in case you need to create a layout with the rounded corner box.

3. Change this css declaration block:

.roundedcornr_content, .roundedcornr_bottom {
margin-top: -19px;

NOW BECOMES

.roundedcornr_content, .roundedcornr_bottom {
margin-top: 0px;

4. Create a wrapper class (and a hack for IE 6 and earlier) and set the width:

.wrapper {
overflow:auto;
width:700px;
}

* html .wrapper {
height:100%;
}

5. Be sure to put the wrapper div around the rounded corner divs. Your HTML should now look like the sample HTML below, just remember the width of the box can be no longer than 1024pixels or similar if you’re using % or ems for your wapper class instead of pixels. In this example I set the width to 700 pixels as you can see in the above CSS.

 

 

<div class=”wrapper”>
<div class=”roundedcornr_box”>
<div class=”roundedcornr_top”><div></div></div>
<div class=”roundedcornr_content”>
<p>Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class=”roundedcornr_bottom”><div></div></div>
</div>
</div>

6. You’re done.

 

 

 

 

If you want :
Rounded corners using Gradient Web Safe Colors with or without a border

Note: The width of the box has no limitations with this option, unlike the Basic Rounded Corner with Borders options listed above. Here the width of the box can be as wide as you need it to be.

1. First you will need to know the bottom color of the gradient fill which you need to use. For example in my gradient for this exercise, I want it to go from white to #ebd0cc(which is a pinkish color)

2. Simply visit www.roundedcornr.com and choose the “RoundedCornr with Gradient” option. Fill in the required attributes and it will spit out the HTML, CSS, and Images for your rounded corners just as you like.

Note: For the most part, when you’re creating gradients you’ll want the the “Background color” attribute to be white or #FFFFFF and the “Box color at top” attribute to be white or #FFFFFF since a gradient usually starts out as white, and color fills in as the content grows within the box.

The “Box color at bottom” attribute is usually the gradient color fill that you’re shooting for so as mentioned earlier in this example my color is #ebd0cc (pinkish).

Now the “gradient height in pixels” attribute is important because it determines when the gradient color starts to come in. The basic principle behind this is the lower the number, the quicker the gradient begins to fill the box as content is placed in it versus the higher the number the more content you have the add to get the color to start appearing. The default here of 60 is a good place to start.

without a border

3. Once you’ve made your selections, roundedcrnr spits out your HTML, CSS, and Images. Save EVERYTHING IF you’re not wanting borders around your rounded corner box. Go to step 4.

with a border

If you want a border, you ONLY need to save the HTML, CSS, and ONE image. The ONLY image you want to save here is the grad.gif image. Save these three items to your local environment. Later we’ll have to go back and choose the “RoundedCornr with Border” option to get our other four border images. (if you save all the images here then it’s ok, b/c we’ll overwrite them later)

4. We’ll now need to introduce/add four new classes to our CSS. These classes help set the width of the box and the border colors. (if you don’t want borders then leave off the .wrappertop and .wrapperbottom classes and ONLY add the .wrapper and * html .wrapper class and go to step 5) Here in this example, I’m setting the width to 471 pixels wide. You can use ems or percentages if you like. I’m also using a grayish color for my borders around the box, and giving myself some left and right margins for the text that will appear in my box. The width of .wrappertop and .wrapperbottom must be the same. The .wrapper must be 20px more than top and bottom as seen in the code below. Go to step 6.

.wrappertop {
border-bottom:1px solid #D3D3D3;
width:471px;
margin:0px 10px;
}

.wrapper {
overflow:auto;
width:491px;
}
/* Hack for IE 6 and lower */
* html .wrapper {
height:100%;
}

.wrapperbottom {
border-top:1px solid #D3D3D3;
width:471px;
margin:0px 10px;
}

5. If you’re not using borders, all you have to do is add the new wrapper class div to the HTML. Your HTML should now look like the HTML below. You’re done.

<div class=”wrapper”>
<div class=”roundedcornr_box”>
<div class=”roundedcornr_top”><div></div></div>
<div class=”roundedcornr_content”>
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
</div>
<div class=”roundedcornr_bottom”><div></div></div>
</div>
</div>
</div>

6. Now it’s time to go back and choose the “RoundedCornr with Border” option to get our other four border images. Here we’ll be getting four of the five images that will be created. These images will help us build our border as well. Let’s go through the attributes:

Corner radius in pixels: should be the same as the corner radius you selected for the Rounded Corner with Gradient option.

Background Color: For the most part, when you’re creating gradients you’ll want the the “Background color” attribute to be white or #FFFFFF.

Box color: This should be the same color as “Box color at bottom” chosen when you were filling in the “Rounded Crnr with Gradient” option earlier. For example my color was #ebd0cc which is a pinkish color. So I’ll choose that same color here. This very important in relation to the corner images that we’re about to create.

Border Color:This will need to match the border attributes in the above css classes (wrappertop and wrapper bottom specifically) or simply the border color you want. But they will need to match the classes border color or vice verca.

Border width in pixels: This will need to match the border attributes in the above css classes (wrappertop and wrapper bottom specifically). Most of the time it will be 1 unless you want a thicker border.

Margin in pixels: ( set it to 0 and read on)

Note: Be sure to add these 4 additional declaration blocks to the class .roundedcornr_content (this also helps assist us in building our border around the box) . The margin must change to the way it is below (you basically get rid of the original 10px of margin on the right and left). Use the padding to set the left and right margin’s instead. so it now looks like this:

.roundedcornr_content {
margin:0;
padding: 0px 10px;
border-left:1px solid #D3D3D3;
border-right:1px solid #D3D3D3;
}

Margin in pixels: I’m sure it can be used, but I leave it at its default of 0 as mentioned above.

7. Save ONLY TWO IMAGES HERE: br.png and bl.png. We are now going to open up our favorite image editing program and do a little cropping of these two images. We’ll also be changing these images from .png’s to gif’s. when saving them in our image editing program.

a. Open up br.png and blow it up. Move all the way to the bottom right and try to crop the bottom right part of the image somewhere around 10×10 pixels. Save it AS A GIF or if you saved all the images earlier then Overwrite br.gif.

b. Open up bl.png and blow it up. Move all the way to the left and try to crop the left half of the image somewhere around 10×10 pixels. Save it AS A GIF or if you saved all the images earlier then Overwrite bl.gif.

8. Remember when I was talking about Box color: above being the same color so your corner images would turn out right? Well we have to now go back to the “RoundedCornr with Border” option to get our other two border images for the top section. However, when we go back to this option, we’re only concerned with this attribute as we’re only trying to get two more images for the top section of our box. When you go back simply change this value from our pinkish color #edbd0cc to white or #ffffff for this attribute. The reason is b/c our top images need to be white not pink b/c the top of the gradient is white. Go ahead and hit the “Create RoundedCrnr >>” button. As you’ll see new HTML, CSS & Images are spit out as usual. However, we’re only concerned with the images(2 of them) created here.

9. Now you’ll want to save two more images here: tr.png. and tl.png. Just like above, we have some image cropping to do. However, tr.png won’t need to be cropped. It will only need to be saved out as a gif.

a. Open up tr.png and simply Save it AS A GIF, or if you saved all the images earlier then Overwriting tr.gif.

b. Open up tl.png and blow it up. Move all the way to the top left and try to crop the top left part of the image somewhere around 10×10 pixels. Save it AS A GIF or if you saved all the images earlier then Overwrite tl.gif.

10. Add the new wrapper class div to the HTML. Your HTML should now look like the HTML below. You’re done.

YOU’RE DONE BUT BE SURE THAT CLASSES ARE REFERENCING THE CORRECT IMAGES. EACH TIME YOU CREATED IMAGES HERE YOU HAD DIFFERENT NUMBERS I.E. _403228. THESE MAY BE DIFFERENT SO MATCH THEM UP.

<div class=”wrappertop”> </div>
<div class=”wrapper”>
<div class=”roundedcornr_box_737319″>
<div class=”roundedcornr_top_737319″><div></div></div>
<div class=”roundedcornr_content_737319″>
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
</div>
<div class=”roundedcornr_bottom_737319″><div></div></div>
</div>
</div>
</div>
<div class=”wrapperbottom”> </div>

 

 

If you want :
Rounded corners without a border using Solid Web Safe Colors

Note: The width of the box has no limitations with this option, unlike the Basic Rounded Corner with Borders options listed above. Here the width of the box can be as wide as you need it to be.

1. Simply visit www.roundedcornr.com and choose the “Basic Rounded Cornr” option. Fill in the required attributes and it will spit out the HTML, CSS, and Images for your rounded corners just as you like.

2. The only thing we need to do here is simply add a wrapper class to control the width of the box and then add the wrapper div to the html. HTML and CSS example below: You’re Done.

/* CSS Document */
.roundedcornr_box_734614 {
background: #cccccc;
}
.roundedcornr_top_734614 div {
background: url(roundedcornr_734614_tl.png) no-repeat top left;
}
.roundedcornr_top_734614 {
background: url(roundedcornr_734614_tr.png) no-repeat top right;
}
.roundedcornr_bottom_734614 div {
background: url(roundedcornr_734614_bl.png) no-repeat bottom left;
}
.roundedcornr_bottom_734614 {
background: url(roundedcornr_734614_br.png) no-repeat bottom right;
}

.roundedcornr_top_734614 div, .roundedcornr_top_734614,
.roundedcornr_bottom_734614 div, .roundedcornr_bottom_734614 {
width: 100%;
height: 10px;
font-size: 1px;
}
.roundedcornr_content_734614 { margin: 0 10px; }

.wrapper {
overflow:auto;
width:300px;
}

* html .wrapper {
height:100%;
}

<div class=”wrapper”>
<div class=”roundedcornr_box_734614″>
<div class=”roundedcornr_top_734614″><div></div></div>
<div class=”roundedcornr_content_734614″>
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
</div>
<div class=”roundedcornr_bottom_734614″><div></div></div>
</div>
</div>