'No value given for one or more required parameters'

bobmac-

Registered User.
Local time
Today, 03:21
Joined
Apr 28, 2008
Messages
59
I hope someone can help me. I'm pulling my hair out. I'm getting an error on an rst.open.

'No value given for one or more required parameters'

I'm using ADO

Here is some of the code:

================================================================
whereis = " tblRefreshedTotliserData.[RealTime]<#3/6/2008#"
Set cnn = CurrentProject.Connection

If strMeter = "" Then
rst.Open "Select * from tblRefreshedTotaliserData where" & whereis, cnn, adOpenKeyset, adLockOptimistic
================================================================
The RealTime data is Date/Time field created by a 'make table' query:

SELECT nodes.description, variables.varName, variablelog.value, variablelog.time, CDate(sdate(variablelog.time)) AS RealTime INTO tblRefreshedTotaliserData
FROM (nodes INNER JOIN variables ON nodes.nodeId = variables.nodeId) INNER JOIN variablelog ON variables.varId = variablelog.varId
WHERE (((variables.varName)="Total_peak"))
ORDER BY nodes.description, variablelog.time;

The Sdate function is to change a UNIX timestamp into a Access Date/Time. I included the CDate to get the field to be of type DATE/TIME otherwise it comes back as text
 
You've spelled the table name incorrectly in the WHERE clause.
 
Change this:

Code:
whereis = " tblRefreshedTotliserData.[RealTime]<#3/6/2008#"

Set cnn = CurrentProject.Connection

If strMeter = "" Then
rst.Open "Select * from tblRefreshedTotaliserData where" & whereis, cnn, adOpenKeyset, adLockOptimistic
to this:
Code:
Dim strSQL As String

whereis = " [RealTime] < #3/6/2008#"
Set cnn = CurrentProject.Connection
strSQL = "Select * from tblRefreshedTotaliserData where" & whereis
If strMeter = "" Then
rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic
 
Sorry about the spelling! I must have been staring at it too long.
I'm not getting the error I was before but the values are bit strange, but I'll should be able to sort that out

Once again
Thanks fellas


bob
 
Let us know if you still have trouble (and sneaky Bob L, editing your post... ;) ).
 

Users who are viewing this thread

Back
Top Bottom