Running SQL queries in ADO

P

Phineas

I have an an Excel spreadhseet that connects via ADO to a Access database,
see code:

Dim conAccessConnection As ADODB.Connection
Set conAccessConnection = New ADODB.Connection
conAccessConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
conAccessConnection.Open DATABASE_FILE

I run a SQL qury as string

Dim r As Recordset
Set r = conAccessConnection.Execute(SQL_QUERY)

Everything works fine until I use SUM and GROUP BY statements in SQL_QUERY
when I get a <Method 'Execute' of object '_Connection' failed>

I am using MDAC 2.7 on Windows XP Professional SP1

Any ideas?
 
C

Cindy Meister

Since you haven't gotten an answer here, yet, you might try asking this in a
group specific to using ADO: data.ado

It would probably be a good idea to include one of the SELECT statements
that's generating the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top