Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of SQL.REQUEST in Excel

Status
Not open for further replies.

WAR40K

Technical User
Oct 29, 2003
29
US
I have an Exel Worksheet that generates charts based upon data retrieved from an MS Access Database a server. I want to count the total number of records in a Query called ArrowElec. Then I want to count the number of records in the same Query where the field MDR is not null using the SQL function COUNT(). I have tried using the following:

SQL.REQUEST(&quot;DSN=MS Access Database; DBQ=H:\Quality\InspLog\RecInspLog.mdb&quot;,,,&quot;SELECT COUNT(*) FROM ArrowElec WHERE ((DATE>#3/31/03#)AND(DATE<#7/1/03#)&quot;)

I was able to get the SQL.REQUEST() function to work using a db on my local drive. however, all I get is #N/A in the target cell when using the file on the network server.

Does the Access database have to be opened exclusively by the computer running the SQL.REQUEST()? I'm wondering becuase the SQL.REQUEST() seems to work when it points at an Access database that is either closed or opened exclusively by me.

Would appreciate any comments or alternate methods to accomplish the above task.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top