paul.hartland at fsmail.net
paul.hartland at fsmail.net
Mon Mar 21 05:26:33 CST 2005
Just an error message like below: Run-time error '-2147217900 Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT' or 'UPDATE Message date : Mar 21 2005, 11:25 AM >From : "Gustav Brock" To : accessd at databaseadvisors.com Copy to : Subject : RE: [AccessD] Running Access Query With Parameters From VB6 Hi Paul You may need to reveal to us what is returned ... /gustav >>> paul.hartland at isharp.co.uk 03/21 12:10 pm >>> It works on all my other queries, just not this one....I have five query names in strQueries(), three of which I pass date parameters to, this is the only one not working -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 18 March 2005 17:00 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Running Access Query With Parameters From VB6 Hi Paul You need to pass an SQL string in strSQL. I doubt very much that this: strQueries(intQuery) & " '" & dtKPIStart & "', '" & dtKPIFinish & "'" will do that. /gustav >>> paul.hartland at fsmail.net 03/18 5:49 pm >>> 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- 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