JerryKlmns
IS-IT--Management
From the MS-Access enviroment, I use the NZ Function to convert nulls to zeros, from different fields of joint queries, in a parameter query gathering all needed fields, in order to sum them up.
From the VB6 enviroment, I execute a command object (TheCmd), over an open connection (Cnn), with query name (TheQuery), parameters (Dates:From - To) and pass the resulting set to a recordset object (rstRecordSource) like this
Then I get the
err.Number -2147217900
err.Source Microsoft JET Database Engine
err.Description Undefined function 'nz' in expression.
Deleting the field using the nz function from the parameter query residing within MS-Access, everything works fine!
That 's a general call to many queries I need to run so, it is not possible to rewrite all these queries using that nz function!!!!!!!!!!!!!!
Any ideas ????? Thank 's in advance.
From the VB6 enviroment, I execute a command object (TheCmd), over an open connection (Cnn), with query name (TheQuery), parameters (Dates:From - To) and pass the resulting set to a recordset object (rstRecordSource) like this
Code:
DateFrom = txtFrom.Text
Set TheParam1 = New ADODB.Parameter
With TheParam1
.Type = adDate
.Direction = adParamInput
.Value = DateFrom
End With
DateTo = txtTo.Text
Set TheParam2 = New ADODB.Parameter
With TheParam2
.Type = adDate
.Direction = adParamInput
.Value = DateTo
End With
Set TheCmd = New ADODB.Command
Set TheCmd.ActiveConnection = Cnn
With TheCmd
.CommandText = TheQuery
.CommandType = adCmdStoredProc
.Parameters.Append TheParam1
.Parameters.Append TheParam2
.Prepared = True
End With
Set rstRecordSource = TheCmd.Execute
Set TheParam1 = Nothing
Set TheParam2 = Nothing
Set TheCmd = Nothing
Then I get the
err.Number -2147217900
err.Source Microsoft JET Database Engine
err.Description Undefined function 'nz' in expression.
Deleting the field using the nz function from the parameter query residing within MS-Access, everything works fine!
That 's a general call to many queries I need to run so, it is not possible to rewrite all these queries using that nz function!!!!!!!!!!!!!!
Any ideas ????? Thank 's in advance.