I am working in VBA through Excel 2010. I have one piece that works marvelously, and using the same method for another query, I get an automation error on the line where I put
records.Open query, conn
Where query2b is my query and c_n is my connection that I used in an earlier successful query.
my successful query looks like this:
query1 = "SELECT ..."
r_s.Open query1, Conn, adOpenStatic 'r_s is the ADODB recordset
...
r_s.Close
but then when I do the next query,
I have query2 = "SELECT ..."
Set records = CreateObject("ADODB.Recordset")
records.Open query, Conn, adOpenStatic
And VBA just gives me
"Run-time error '-2147217887 (80040e21)':
Automation error
Help Please?
records.Open query, conn
Where query2b is my query and c_n is my connection that I used in an earlier successful query.
my successful query looks like this:
query1 = "SELECT ..."
r_s.Open query1, Conn, adOpenStatic 'r_s is the ADODB recordset
...
r_s.Close
but then when I do the next query,
I have query2 = "SELECT ..."
Set records = CreateObject("ADODB.Recordset")
records.Open query, Conn, adOpenStatic
And VBA just gives me
"Run-time error '-2147217887 (80040e21)':
Automation error
Help Please?