[AccessD] Running Access Query With Parameters From VB6

paul.hartland at fsmail.net paul.hartland at fsmail.net
Fri Mar 18 10:49:52 CST 2005


To all,

I have a query in an Access database which is used to produce KPI reports, the query is called qryKPI_SickDays_By_Region_By Month3 and expects a start and finish date.  

In my VB application I have a connection to the database inside a funtion called OpenDataConn and use the following code (dtKPIStart and dtKPIFinish are the start and end dates).
strSQL = strQueries(intQuery) & " '" & dtKPIStart & "', '" & dtKPIFinish & "'"
Set rsKPIData = OpenDataConn.Execute(strSQL)
When I run the program I the following error message:

Run-time error '-2147217900
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE

Anyone any ideas what I am doing wrong ?

Thanks for the help in advance.

Paul Hartland

-- 

Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/

This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm


More information about the AccessD mailing list