p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Databases (http://p2p.wrox.com/forumdisplay.php?f=62)
-   -   Microsoft VBScript runtime error '800a000d' (http://p2p.wrox.com/showthread.php?t=11848)

mwlyoung April 15th, 2004 04:30 AM

Microsoft VBScript runtime error '800a000d'
 
Hi there

We have recently upgraded from MSSQL7 to MSSQL2000 and since then I have been experiencing some problems.

My connection string in global.asa:

Sub Application_OnStart
  Application("ConnectionString") = "PROVIDER=SQLOLEDB;DATA SOURCE=SQLSERVER;UID=sa;PWD=;DATABASE=KWIKPAY2"
End Sub

In clientheader.asp:

Set cnClientReports = Server.CreateObject ("ADODB.Connection")
        cnClientReports.Open Application("ConnectionString")
        cnClientReports.CommandTimeout = 300

        Set rsElectricity = Server.CreateObject ("ADODB.Recordset")
        rsElectricity.CursorType = adOpenStatic
        rsElectricity.Open "SELECT bElec FROM tbl_OutletOperations WHERE szSiteNo = '" & Trim(Session("Outlet") & "'"), cnClientReports


In footer.asp:

<a href="clientmenu.asp" class="whitetext" style="text-decoration : none">Home</a> | <a href="rpt_outletdetail.asp" class="whitetext" style="text-decoration : none">Order Details</a> | <a href="rpt_normalsales.asp" class="whitetext" style="text-decoration : none">Normal Sales</a> | <a href="rpt_vouchersreissued.asp" class="whitetext" style="text-decoration : none">Reissued Vouchers</a> <% if rsElectricity("bElec") then %>| <a href="rpt_elecsales.asp" class="whitetext" style="text-decoration : none">Electricity Sales</a> | <a href="rpt_electrans.asp" class="whitetext" style="text-decoration : none">Electricity Transactions</a> <% end if %> <% if NOT rsISOOutlet.EOF then %> | <a href="rpt_isosales.asp" class="whitetext" style="text-decoration : none">Integrated Sales</a> <% end if %>

bElec is of type bit in the database.

The error message that I am getting is:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsElectricity'

/admin/footer.asp, line 9


Any help will be greatly appreciated.

Thanks
Louis

Imar April 15th, 2004 04:42 AM

Is clientHeader.asp included by footer.asp?
If not, it makes sense you get the error. The rsElectricity object is defined in the header file, but cannot be reached by the footer file.

If that's not the problem, can you elaborate a bit about your set up? E.g. which pages where, is included, etc. Also, indication what line 9 is may help.

Finally, using the SA account is not recommended. Using the SA account with a blank password is even worse..... ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Hypnotize by Audioslave (Track 10 from the album: Audioslave)


mwlyoung April 15th, 2004 04:47 AM

Hi Imar

Thanks for your help. I've found the error. clientheader.asp was included after footer.asp. I didn't write the pages, so don't ask me why this was like that, but most importantly, now it works.

I'm not using sa with a blank password on the live database, this is on a test database which is not even connected to the live system most of the time.

Cheers
Louis

Imar April 15th, 2004 04:54 AM

Ah, OK. Well, glad it's working now.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Getaway Car by Audioslave (Track 13 from the album: Audioslave)



All times are GMT -4. The time now is 01:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.