Object Variable or with block variable not set

rstwo.Open "SELECT * from xyz", conn, adOpenKeyset, adLockPessimistic, adCmdText

Why ?
LVL 20
jitgangulyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Harisha M GEngineerCommented:
Hi,

Do you have one of these:

Dim rstwo As New ADODB.RecordSet

or

Set rstwo = New ADODB.RecordSet

---
Harish
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jitgangulyAuthor Commented:
I have this
Dim rstwo As ADODB.Recordset
0
Harisha M GEngineerCommented:
jitganguly, you may have to post the code prior to this for us to know the exact reason.

You may not have initialized conn
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Dim rstwo As ADODB.Recordset
Set rstwo = New ADODB.RecordSet   'mgh's first comment
'Your conn code, then...
rstwo.Open "SELECT * from xyz", conn, adOpenKeyset, adLockPessimistic, adCmdText
0
Harisha M GEngineerCommented:
New ??
0
jitgangulyAuthor Commented:
No done deal.
I put Set rstwo = New ADODB.RecordSet
0
Harisha M GEngineerCommented:
Have either this:

Dim rstwo As ADODB.Recordset
Set rstwo = New ADODB.RecordSet  
rstwo.Open "SELECT * from xyz", conn, adOpenKeyset, adLockPessimistic, adCmdText

or this:

Dim rstwo As New ADODB.Recordset
rstwo.Open "SELECT * from xyz", conn, adOpenKeyset, adLockPessimistic, adCmdText
0
Harisha M GEngineerCommented:
Thanks :)
0
jitgangulyAuthor Commented:
I am getting current recordset does nto support updation

rstwo.Open "SELECT * from abc", conn, adOpenDynamic, adLockPessimistic, adCmdText
            If Not rstwo.EOF Then
                rstwo("Match_id") = MMMaxID + 1
                rstwo.Update
                Set rstwo = Nothing
                rs("match_id") = mmaxid + 1
                rs.Update
            End If
0
Harisha M GEngineerCommented:
jitganguly, I don't know the exact reason for this, but some of the site's PAQs point in the direction that the permissions may not be correct
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.