Category Archives: SQL

Fixing Firefox’s ‘NS_ERROR_NOT_AVAILABLE’ Error When Using PageMethods.

So here I am, doing some Virtual Earth stuff with PageMethods (which will be in an upcoming post), something I’ve done many times over the last year and some, and I’m running into some issues.

First off, IE7 does nothing, it just sits there. I add some break points in the static method that the PageMethod is calling, and again, nothing. So I load up Firefox, poynt to the URL of the page, and unlike IE7, Firefox does something.

However, it wasn’t something that I was expecting. In the Error Console it had the following message:

Error: [Exception… “Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]” nsresult: “0x80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: http://localhost:50007/NS_ERROR_NOT_AVAILABLE/ScriptResource.axd?d=ZgyDU9i45kjT :: Sys$Net$XMLHttpExecutor$get_statusCode :: line 4166” data: no]
Source File: http://localhost:50007/NS_ERROR_NOT_AVAILABLE/ScriptResource.axd?d=ZgyDU9i45kjT-145205
Line: 4166

Continue reading

‘The user is not associated with a trusted SQL Server connection.’

About a month or so ago I came across this error message in SQL Server 2000 whenever I tried to test out YetAnotherForum (YAF) on my machine. I followed the instructions and created the database and the user like their instructions said. I even recreated the user and tried different settings, then recreated the database and then the user, but with no luck.

Finally, I searched Google, and found the simple answer, and VOILA, Darth Vader’s my father bob’s my uncle.

Continue reading

Selecting Random Records With SQL

Have you ever wanted to be able to SELECT a random record or records from a database table, but was unsure how to do it with SQL, instead of through code?

I ran across this problem a few years ago when I was developing Vibez, if you would like to know, is an electronic music community that I developed when I first got into doing web development almost 6 years ago, and was written in ASP with Access (I know, I know …).

What I needed, was a way to SELECT one random link from the Links Directory, every time someone viewed the main page. I wasn’t able to properly figure out how to accomplish this, and ended up slapping together some code to give me the end result that I wanted. If you were to ever see the code, you probably would feel sick to your stomach.

Now that I’m in the planning stages of rewriting the site in ASP.Net with SQL Server 2005 replacing the Access back-end, I decided to revisit this problem and see if there was an easier way to do this.

Fortunately there is a way to do it in SQL Server (and MySQL, PostgreSQL, Oracle, DB2, SQLite, and yes, even your favourite, MS Access), and I’ll show you how.

Continue reading