1

This line of code:

rs.Open SQLStr, conn, adOpenStatic

is proving somewhat volatile - sometimes it runs with no problem, and sometimes it throws the error:

Variable not defined.

It appears to be the adOpenStatic causing problems. I'm trying to avoid referencing the ADODB library as it would then require all of my users to reference this library. If it didn't work full stop then fine but my frustration stems from the fact that sometimes it works and sometimes it doesn't.

Just wondered if anyone had come across this before and had a solution?

1
  • Why would you late bind this? "trying to avoid referencing the ADODB library as it would then require all of my users to reference this library" doesn't make any sense - if they don't have the library installed, CreateObject is going to throw anyway. Commented Jan 10, 2017 at 15:15

1 Answer 1

1

When working with external libriary in late-binding mode you can not work with constants like adOpenStatic. Use 3 istead (just three) wich is numeric representation of adOpenStatic.

Other parameters and theirs numeric repesentations you can find here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.