By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,620 Members | 982 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,620 IT Pros & Developers. It's quick & easy.

runtime error 91

P: 2
how can i solve "object or with block variable not set" ie runtime error 91 in vb
my code is

Dim max_range as integer
Form_load()
max_range = adodc1.recordset.recordcount // ERROR IN THIS LINE
formula for random no
text1.text = random no
text2.text = adodc1.recordset.fields("message")
end sub

PLEASE REPLY FAST........
SRRY FOR THE TROUBLE
THNX IN ADVANCE
Apr 8 '07 #1
Share this Question
Share on Google+
3 Replies


iburyak
Expert 100+
P: 1,017
Where did you get this?


[PHP]adodc1.recordset[/PHP]

It is an object and it doesn't look that it is declared or collected anywhere.
Apr 8 '07 #2

P: 2
i get it in adodc1.recordset.recordcount

does adodc1 need to be initialize........... please help
Apr 8 '07 #3

iburyak
Expert 100+
P: 1,017
It is hard for me to judge. I don't see your code.

Did you connect your Adodc1 control to any data source?
Did you do anything similar to this?

[PHP]With Adodc1
' initialize our connection to the database
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "\housedata.mdb;Persist Security Info=False"
' set up the first query
.RecordSource = BuildQuery()
' refresh the data source to make sure the query goes through. I'm still unclear
' as to how a bunch of this works...
.Refresh
End With[/PHP]
Apr 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.