Tuesday, May 22, 2007

Tuesday, March 27, 2007

Changing Table Owner in SQL Server

Something I do upon occassion, but not so often that I can remember it.

To change the owner of a table in SQL Server, open query analyzer, make sure you are in the database containing the table whose owner you want to change, and execute the following stored procedure:

sp_changeobjectowner 'TableName' , 'OwnerName'

Where:
TableName is the name of the table
OwnerName is the name of the account you want to assign ownership to

You can actually use this to change the ownership of any object in the database....

Monday, February 12, 2007

Money Making on the Web - Affiliate Marketing

Making money on the web is still very much possible, even for the hobbyist webmaster working in his or her spare time from the computer in the corner of the family room. Affiliate martketing is alive and well, albeit in a diffferent form than is was a few years before. Heck, if you've gone through all the trouble to learn ASP, you might as well try to put it to your own use!

For those of you who don't know, affiliate marketing is a method of promoting web businesses in which you are rewarded for every visitor, subscriber, customer, and/or sale you drive through your efforts. So it's sort of like traffic directing - you send the traffic, and if the custoemr completes a transaction, be it a sale or sign up, you get a cut.

Merchants like affiliate marketing because it's "pay for performance", meaning the merchant doesn't pay anything unless there are results. Some merchants run their own affiliate programs while others use third party services like Linkshare, Commission Junction, or Performics for tracking.

At it's most basic level, it works like this: You build a site about widgets becasue you collect them. You talk about them and rate them and, on your review pages, you proviode an affiliate link to a store that sells widgets. If any visitors to your website click throguh that special link and buy a widget, you get paid. Sweet.

Getting started with an affiliate program is easier than you think. Just head over to Amazon and sign up (it's called their Associates program). Then, on your blog write a review of a book you just read or a DVD movie you just watched. Amazon makes it simple to look up that product and drop in a bit of JavaScript code that will put an image of the book or movie up along with a coded link. Visitors pour into your site, read your glowing review, and hasten over to Amazon (through your link) and snap up the book. Viola! Instant Taco Bell money!

Stay tuned for more advanced money making conversations....

Friday, February 09, 2007

Some of My Sites

I’ve been pretty lax about adding new stuff to the site. I’ll try to change that. A few encouraging emails have convinced me at least more than on person is reading this thing.

It also occurred to me that visitors might be interested in seeing some of my projects. All the new ASP work I do nowadays is for my own personal projects, At work, we are on .Net 2.0. I cracked my first book this week, having finally decided that if I want to keep my job, I better get caught up!

Anyway…. Here are a few of my sites, some new, some old. WARNING: I’m a programmer, not a graphic designer! Try not to vomit on your keyboard.

http://www.sfreader.com/ – this is a book review site for science fiction, fantasy and horror. It was my first ASP site and the one I used to teach myself programming. It launched in 2000. It’s grown a lot since then, with the addition a few years back of a forum that has become quite popular with SF fans and writers. It started on Access, but about a year back I finally ported it over to SQL. It gets about 500 visitors a day and remains my most popular (though one of my lowest earning) sites. You can get a free web page if you are a writer or fan of SF. I run an annual short story contest with cash prizes, and the Mother of All Speculative Fiction Directories is slowly getting bigger. It’s a fun site and I get all the free books I can read from the publishing companies!

http://www.yawds.com/ – my take on a directory site. I used some cool AJAX stuff here (yes, you CAN use AJAX with ASP!). Still offering free premium listings for kick-off, so if you have a site, submit it.

http://www.ishophq.com/ – the mother of my price comparison sites. This one pulls from ALL the products in my database, which is populated with data feed inventory from over 40 merchants. For a while there, this and the niche site where doing REALLY well. Not so well any more…. Stupid search engines…. When I noticed a particular product doing well (like duvets for example), I’d break that product out into its own site (http://www.treadmillhq.com/). I’ve got about 50 of them, but they are slowly expiring. Since the SERP debacle, some of them didn’t even earn back the $9.20 I paid to GoDaddy to register the name! My first SQL server site. I taught myself how to use full text indexing and how to write stored procedures with this one.

http://www.nutribody.com/ – great domain name, sucky site. Pulls from the iShopHQ database. Someday I might do something worthwhile with it. Still pulls about 200 visitors a day, but I don’t know what they do there. They obviously aren’t buying anything….

So those are a few. I’ve got a ton of others, but they are all iShopHQ niche product knock-offs. The CPA and CPL I’m doing with Freetastic has given me a lot of great marketing ideas though, so I’m not done yet! I might post a little here about it, even though it’s not really ASP related.

Thursday, January 18, 2007

Form Field Focus On Page Load

Sorry for not posting in so long... I've been lazy, or, rather, busy with other stuff and lazy about RetroWebDev.

In any case, here's another (hopefully) useful tip; how to get the curser to be in a form field on a page load. I find it especially useful for admin type pages that require a log in. You can have everything ready to go for the user to just start typing.

<BODY onLoad="document.forms.MyForm.UserName.focus()">
In this example, your form would look like this:
<form method="post" name="MyForm" action="YourActionPage.asp">
<input type="text" name="UserName" size="15">
<input type="text" name="Password" size="15">
<input type="submit" value="Search">
</form>
This is a simple log in form with two fields: UserName and Password. In this example, when the page loads, the cursor will be placed in the UserName field.

Remember! JavaScript is case sensitive!

Sunday, December 03, 2006

Free Online Keyword Research Tools

I decide to post this list since I can't find a single list that contains all the tools I use (which isn't many):

Google AdWords Keyword Tool, Keyword Sandbox Tool Good tool but it's Google after all, so keep in mind that you and everyone else on the planet is using it.

MIVA Keyword Generator Note this is from the UK, so spellings might be non-USA

Overture Keywords Suggestion Tool Same problem here as with Google - any keywords you generate here will probably not be unique. Also somewhat of a pain, because it it alphabetizes the keyword varients it returns. So "cheap tennis racket" varients ceom out as "cheap racket tennis", "american express credit card" varients come out as "american card credit express" etc. Annoying

Search Engine Keyword Tracker & Keyword Ranking Tool This on is hand because it generates some Wordtracker words as well as the Overture ones. That's what I use it for. For some reason, the Overture lookup here sometimes seems to be faster than the actual Overture site.

7Search Keyword Suggestion Tool. Brings back 100 at a time. Good varients here.

The Miva and 7Search tools are pretty good, and probably not as widely used as the Google and Overture tools. I tend to use them for my main research and then augment with Google and Overture.

I'm pretty sure Microsoft has one too, but I can't find a link to it. Maybe you have to be an adCenter user to get access....

Monday, November 13, 2006

Geek Babe Monday - Jessica Alba

Jessica Marie Alba was born April 28, 1981, in Pomona, California. She relocated with her family (her father was in the Air Force) several times; Biloxi, Mississippi, then back to California, followed by Del Rio, Texas, and finally back to the West Coast.

Alba knew she wanted to be an actress since the age of 5. Her first film role, in the 1994 film Camp Nowhere, came her way by chance. After one of the characters dropped out of the production, dark-haired Jessica was cast as the replacement, thanks to the fact that her hair matched that of the original actress. She then ventured onto the small screen, with commercials for Nintendo and J.C. Penney, and a recurring role in Nickelodeon's The Secret World of Alex Mack.

Following Nickelodeon, Jessica was cast as Maya in the 1995 series Flipper. While working with dolphins on the television series, Jessica was cast in the disastrous film Venus Rising, as well as the 1996 made-for-TV movie Too Soon for Jeff and an episode of Chicago Hope.

1998 was filled with television appearances, including a recurring role on the primetime soap Beverly Hills, 90210, Brooklyn South and The Love Boat: The Next Wave. As for film, audiences could catch Jessica in P.U.N.K.S. (aka Rebels), Never Been Kissed, and Idle Hands.

With Jessica's growing popularity and her exotic looks, it's no wonder that James Cameron cast her as the lead role in his television series, Dark Angel.
Jessica Alba in The Fantastic FourJessica Alba Swimsuit
Jessica returned to the scene with the title role in 2003's Honey. After her role as stripper Nancy Callahan in 2005's Sin City, Jessica starred in Into the Blue and Fantastic Four.

2007 promises to be a busy year. Jessica will be seen in a slew of movies: Saw IV, The Eye, Sin City 2, Fantastic Four: Rise of the Silver Surfer, Good Luck Chuck, Awake, Bill, and The Ten. Whew!

Friday, November 10, 2006

Counting Active Users in ASP

Although I have specifically addressed global.asa, I have written about it in the How to Filter out Bad Bots in ASP with Global.asa post. This method of keeping track of active users also uses the global.asa file along with an application variable. Put this in your global.asa:
<script language=vbScript runat=server>

sub session_onStart()
application.lock()
application("SCount") = application("SCount") + 1
application.unlock()
end sub

sub session_onEnd()
application.lock()
application("SCount") = application("SCount") - 1
application.unlock()
end sub

sub application_onStart()
' don't need a lock in onStart()
application("SCount") = 0
end sub
</script>
The, on any page you want to display the count, put
<%
Response.Write "Users Online: application("SCount")
%>
This method isn't 100% accurate and does have a few pitfalls:

It creates a "hotspot" during application.lock() that can cause delays when a new visitor arrives

You have no control over whether users launching new windows will trigger new sessions which will increment the count

You are constantly holding and modifying an application variable in memory, though you rarely use it

You need a modified copy of global.asa for each application, and have to aggregate different sites/applications separately

Nevertheless, for a quick and easy and mostly accurate way to count the number of active sessions, this will work.

Tuesday, November 07, 2006

Errors When Trying to do Response.Redirect

Ever tried to do Response.Redirect and get the following error?
Response object error 'ASP 0159: 80004005'
Header Error. The HTTP headers are already written to the client browser.
Any HTTP header modifications must be made before writing page content.
When calling response.redirect, you have to execute it BEFORE any client-side code, including the opening <html> tag.

This usually isn't a problem in IIS 6 (Server 2003) because in IIS 6 the default setting for Response.Buffer is True by default. This means the server holds the page content until it's all ready to go and then sends it to the client. If Response.Buffer is set to True, you can call Response.Redirect anytime before the page is complete and it will work.

In older versions of IIS, Response.Buffer is set to False by default. This means content gets sent to the client as the page is executing. In this scenario, you'll get an error if you try to execute Response.Redirect anytime after content has been sent.

The fix? If you're in a version of IIS older than IIS 6, set Response.Buffer = True at the top of the page.

Another error you can get when using Response.Redirect is Object Moved. One way to prevent this from happening is using Response.Clear first (note that buffering must be enabled). At the top of the page:
Response.Buffer = true
Before you call Response.Redirect:
Response.Clear
Response.Redirect "http://www.domain.com"

Monday, November 06, 2006

Geek Babe Monday - Erin Gray



This is a late post, since I was a little under the weather yesterday and didn't make time to post. Missed last week too....

This post might more rightly be called Retro Geek Babe Monday. Erin Gray was one of the first models to successfully crossover into television. She is best known as "Kate Summers" on the highly watched TV show "Silver Spoons" (1982), and (the reason for her status as a Geek Babe) Colonel Wilma Deering on the TV show "Buck Rogers in the 25th Century" (1979).
Erin Gray - ModelErin Gray - Col Wilma Deering in Buck Rogers

Erin Gray was born on January 7, 1950 in Honolulu. Gray moved with her family from Hawaii to California when she was eight years old and graduated from Pacific Palisades High School. She was fifteen when a chance meeting with Nina Blanchard, head of one of Hollywood's top model agencies, convinced her what she wanted to do in life.

Moving to New York, she became one of the town's most sought-after models, in elite company with Farrah Fawcett, Veronica Hamel and Susan Blakely. TV viewers encountered her commercials for Breck, Max Factor, Clairol, Camay Soap and RC Cola, and a classic spot for English Leather cologne in which she provocatively delcared, "My men wear English Leather - or they wear nothing at all!"

Between modeling assignments, she studied acting with well-known coach Warren Robertson and when movie-TV offers came in, she was ready. Universal was impressed by her performances on such series as "Police Story" and "Gibbsville" and signed her to a seven-year contract. Under that pact, the studio co-starred her as a tough-minded newspaper reporter in Irwin Shaw'sEvening in Byzantium (1978) (TV).

Her performance scored with both critics and audiences, and led directly to the role in "Buck Rogers in the 25th Century" (1979). As a result, she has become a regular commuter between Hollywood and New York, the hub of the magazine and fashion world.