Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2012, 05:20 PM
marreco marreco is offline SQL ADODB.RecordSet Error 91 Windows XP SQL ADODB.RecordSet Error 91 Office 2007
Novice
SQL ADODB.RecordSet Error 91
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default SQL ADODB.RecordSet Error 91

Hi.



Code:
Dim sTotal As String

Dim rsCount As ADODB.Recordset
'This line of error 91 "to the object variable or With block variable not set
rsCount.Open "Select Count(Bairro) from [Registros$] where Bairro = 'Centro'"
msgbox "O Total de Regsitros é " & rst(0)

sTotal = "Select Count(Bairro) from [Registros$] where Bairro = 'Centro'"
msgbox "O Total de Regsitros é " & sTotal
Reply With Quote
  #2  
Old 04-30-2012, 04:36 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline SQL ADODB.RecordSet Error 91 Windows 7 32bit SQL ADODB.RecordSet Error 91 Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

You have to create an instance (an object) of the recordset before you can do things with it such as call its Open method.
Code:
Dim rsCount As ADODB.Recordset

Set rsCount = CreateObject("ADODB.RecordSet")
Reply With Quote
  #3  
Old 05-02-2012, 04:43 PM
marreco marreco is offline SQL ADODB.RecordSet Error 91 Windows XP SQL ADODB.RecordSet Error 91 Office 2007
Novice
SQL ADODB.RecordSet Error 91
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default

hi.

Thank you!! my fryend!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Visual Basic error - run time error 504 crazymorton Word 11 01-13-2012 04:32 AM
SQL ADODB.RecordSet Error 91 Microsoft office 2010 error 2908 and error 1935 !!!!!!heeeeellpppp!!!!!!!!! bennypryde Office 1 01-05-2012 03:33 PM
getting div error accablues Excel 9 07-27-2011 07:58 PM
Runtime error 5487 - Word cannot complete the save to to file permission error franferns Word 0 11-25-2009 05:35 AM
Receive error cannot open this form because an error occurred in BCM 2007 bornhusker Outlook 0 06-01-2009 10:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft