Programmers for Hire
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgrammers for Hire

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 2nd, 2002, 09:07 PM
fizch fizch is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 2 fizch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Learning COM+

I am trying to use COM objects in my ASP code. I am still new to COM objects in ASP is the only problem. I am using VB6 to create my apartment threaded, in process component. Where I am having problems is creating/utilizing a ADO recordset. I have created and instantiated a connection object in the class initialize subroutine. That gets created no problem, but everytime I try to create a recordset object, I get errors. The erros says something along the lines of this object does not support automation. I started out using early binding, but that hasn't work so I have moved to late binding, and I still can not get it working. Here is the code that keeps breaking it.<br><br><div class="msgQuoteWrap"><div class="msgCode"><br>'************************************************* *******************************<br>' SUBROUTINE TO UPDATE PAGEVISITED COUNTER<br>'************************************************* *******************************<br>Private Sub UpdatePageCounter(strQuery As String)<br> On Error GoTo ErrorRoutine<br><br> Dim strSelectQuery As String, rs As New ADODB.Recordset, nHits As Integer<br> Dim strUpdateQuery As String<br><br> Set rs = CreateObject("ADODB.Recordset")<br> <br> strSelectQuery = "Select Times_Visited from Content " & strQuery<br><br> rs.Open strSelectQuery, cn, adOpenStatic, adLockOptimistic<br><br> If Not rs.EOF Then<br> nHits = rs("Times_Visited") + 1<br> Else<br> nHits = 1<br> End If<br><br> rs.Close<br><br> strUpdateQuery = "Update Content set Times_Visited = " & nHits & " " & strQuery<br> rs.Open strUpdateQuery, cn, adOpenStatic, adLockOptimistic<br><br> Set rs = Nothing<br><br> Exit Sub<br>ErrorRoutine:<br> myResponse("Response").Write "Object threw: " + Err.Description<br> Err.Raise 45000, "Navigator.UpdatePageCounter"<br>End Sub<br></div></div><br><br>The code actually breaks at 'Set rs = CreateObject("ADODB.Recordset")'<br><br>Do not ask me why, that is why I am posting here. Any help you guys could give would be greatly appreciated.

Reply With Quote
  #2  
Old December 2nd, 2002, 11:01 PM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
Do you have a reference to the Microsoft ActiveX Data Objects 2.5 (or newer) library in your component? That could be a deal breaker if not referenced.<p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><br><a href="http://www.dotnetbb.com" target="_blank"><img src="http://www.dotnetbb.com/sigs/dnb_468_static.gif" border="0"></a></p>

Reply With Quote
  #3  
Old December 2nd, 2002, 11:08 PM
fizch fizch is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 2 fizch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
But of course. I should have ActiveX Data Objects 2.7 referenced.

Reply With Quote
  #4  
Old December 2nd, 2002, 11:49 PM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
Are you using Access or SQL Server for this?

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgrammers for Hire > Learning COM+


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT