ASP's Server.CreateObject() returning null

Started by
1 comment, last by Wan 14 years, 10 months ago
Hi all, I'm doing some ASP coding for my game website and am getting a very bizarre error indeed, and after conducting a thorough, failed, search for the solution, have decided that I am at the mercy of better programmers on these forums :-) So, all I am trying to do is executed a simple SQL query on one of my ASP pages. The weird thing is that the *exact* same code works elsewhere in the page... which has me wondering if this could be a scope issue....

Dim rs, query
query = "SELECT * FROM myTable"
set rs = Server.CreateObject("ADODB.RecordSet")
set rs = conntemp.Execute(query)

' Now attempt to use the rs object
tempID = rs("myTableID")

' etc...

After inspecting the return values, to my horror, Server.CreateObject() is returning null, and so is Connection.Execute()!!! What are the different possibilities? My connection string hasn't changed, and queries using the *exact same code* (less the query to myTable - which has been checked, and rechecked, and re-rechecked) work elsewhere on the page. Help!!!
Advertisement
Anybody?
Warning: it's been a looooong time since I've used ASP scripting

What does the working code look like? What are the differences?
By the way, you probably have a better chance if this was moved to Web Development.

This topic is closed to new replies.

Advertisement