troubleshooting Question

open ADO recordset from a view with Dynamic/BatchOptimistic?

Avatar of joefunsmith
joefunsmithFlag for United States of America asked on
Visual Basic Classic
7 Comments1 Solution284 ViewsLast Modified:
My open statement looks like this...

tempRS.Open "select * from myView", "myDatabase", adOpenDynamic, adLockBatchOptimistic

and the cursor location is set prior to this line as UseClient

I get an error msg of ..
     [Microsoft][ODBC Driver Manager] Data source name not found and no default driver


I am thinking the reason I am getting this error is because I am using a view in my select

statement instead of a table.

The reason I am using a view is, I have to implement a workaround where I retrieve a blank

recordset with the same layout as another which is retrieving its recordset from a stored

procedure.  This one cannot be retrieved using a stored procedure and the underlying select

statement is 127 lines in QA.  Since VB balks at line continuations past (what is it? 9 lines?)

 Even if I unstructured the sql, I think it would be too long.  There is a limit how long an

individual line of code can be, is there not?  I was trying to find specs on the limitations of

the VB IDE and haven't found anything.  At any rate, I figured the approach I am using above

would work best, but the workaround specifies to NOT use a stored procedure, and to use


If I can't use a view  in the statement, do you have any other suggestions?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros