LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Too few parameters

hi
i've gotton this error before BUT..... when using MS query and the code was
prompting for parameter input FROM the access side. in this case, the prompt
for parameters must be on the excel side and the access query must not have
parameters.
i am guessing and cannot test but try removeing one of the parameters.
the access query has already selected your data so i would try the excel
side first.

my thoughts
regards
FSt1

"MarkS" wrote:

Hi,

I use this query in Access
Select Max([Version]) As VerionNo From [Gen - ES Sites] Where [Scheme] = "REC"
And it works fine

In Excel VBA I use this code
'Provider = Microsoft Access
ACCESSConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=S:\STAR\risk\ECO\ECO.mdb;"

' Create Connection Object and open it on files.MDB
Set connMelbourne = New ADODB.Connection
connMelbourne.ConnectionTimeout = 60
connMelbourne.ConnectionString = ACCESSConnect
connMelbourne.Open
connMelbourne.CommandTimeout = 620

' Get the latest version
sSql = "Select Max(Version) As VerionNo " & _
"From [Gen - ES Sites] " & _
"Where Scheme = " & Chr(34) & "REC" & Chr(34)
' Run Query and load record set
rsADO.Open sSql, connMelbourne, adOpenStatic, adLockReadOnly

and at the last line I get this error

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

I have tried putting square brackers around both column names, unfortunatly
that didn't work

Has anyone got any sugestion

Thanks MarkS

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
parameters DavidC Excel Discussion (Misc queries) 3 October 12th 09 06:48 PM
Too few parameters Laebrye Excel Discussion (Misc queries) 1 May 26th 09 11:56 AM
Too few parameters lou sanderson Excel Discussion (Misc queries) 1 January 13th 06 06:35 PM
Too few parameters lou sanderson Excel Programming 1 January 13th 06 06:35 PM
too few parameters lou sanderson Excel Programming 1 December 14th 05 07:53 PM


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"