Hi,
I have retrieved some recordset via a stored procedure and they are correctly populated on a form in an Access ADP. Then I attempted to save these recordsets with some other newly defined fields into a temp table with the following code but I have the error 3708 stating that parameter not properly defined or inconsistent. Please Help....
rivate Sub SaveToTempTrial_Click()
Dim strMsg As String
Dim strOK As String
Dim cmd As ADODB.Command
On Error GoTo HandleErr
Set cmd = New ADODB.Command
With cmd
Set .ActiveConnection = CurrentProject.Connection
.CommandText = "spInsertTrialSample2"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter( _
"@UpfrontFeeID", adInteger, adParamInput, , Me.UpfrontFeeID)
.Parameters.Append .CreateParameter( _
"@PrimaryAccountNo", adChar, adParamInput, , Me.PrimaryAccountNo)
.Parameters.Append .CreateParameter( _
"@Amount", adCurrency, adParamInput, , Me.Amount)
.Parameters.Append .CreateParameter( _
"@FeeCode", adInteger, adParamInput, , Me.FeeCode)
.Parameters.Append .CreateParameter( _
"@ReconciledNominalDate", adDBTimeStamp, adParamInput, , Me.ReconciledNominalDate)
.Parameters.Append .CreateParameter( _
"@UpfrontNominalFeeID", adInteger, adParamInput, , Me.UpfrontNominalFeeID)
.Parameters.Append .CreateParameter( _
"@ReconcileNominal", adBoolean, adParamInput, , Nz(Me.ReconcileNominal, 0))
.Parameters.Append .CreateParameter( _
"@NominalAmount", adCurrency, adParamInput, , Me.NominalAmount)
.Parameters.Append .CreateParameter( _
"@ReconcileMAP33", adBoolean, adParamInput, , Nz(Me.ReconcileMAP33, 0))
.Parameters.Append .CreateParameter( _
"@ReconciledMAP33Date", adDBTimeStamp, adParamInput, , Me.ReconciledMAP33Date)
.Execute
End With
Set cmd = Nothing
ExitHere:
Exit Sub
HandleErr:
MsgBox Err & ": " & Err.Description, , "Insert to Temp error"
Resume ExitHere
Resume
End Sub
Alter Procedure "spInsertTrialSample2"(
@UpfrontFeeID int,
@PrimaryAccountNo char,
@Amount money,
@FeeCode int,
@ReconciledNominalDate datetime = Null,
@UpfrontNominalFeeID int,
@ReconcileNominal bit,
@NominalAmount money,
@ReconcileMAP33 bit,
@ReconciledMAP33Date datetime = Null)
As
Set Nocount on
Create table #tempTrial
(UpfrontFeeID int,
PrimaryAccountNo char,
Amount money,
FeeCode int,
ReconciledNominalDate datetime,
UpfrontNominalFeeID int,
ReconcileNominal bit default 0,
NominalAmount money,
ReconcileMAP33 bit default 0,
ReconciledMAP33Date datetime)
Insert into #tempTrial
(UpfrontFeeID,
PrimaryAccountNo,
Amount,
FeeCode,
ReconciledNominalDate,
UpfrontNominalFeeID,
ReconcileNominal,
NominalAmount,
ReconcileMAP33,
ReconciledMAP33Date)
Values(
@UpfrontFeeID,
@PrimaryAccountNo,
@Amount,
@FeeCode,
@ReconciledNominalDate,
@UpfrontNominalFeeID,
@ReconcileNominal,
@NominalAmount,
@ReconcileMAP33,
@ReconciledMAP33Date)
return
I have retrieved some recordset via a stored procedure and they are correctly populated on a form in an Access ADP. Then I attempted to save these recordsets with some other newly defined fields into a temp table with the following code but I have the error 3708 stating that parameter not properly defined or inconsistent. Please Help....
rivate Sub SaveToTempTrial_Click()
Dim strMsg As String
Dim strOK As String
Dim cmd As ADODB.Command
On Error GoTo HandleErr
Set cmd = New ADODB.Command
With cmd
Set .ActiveConnection = CurrentProject.Connection
.CommandText = "spInsertTrialSample2"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter( _
"@UpfrontFeeID", adInteger, adParamInput, , Me.UpfrontFeeID)
.Parameters.Append .CreateParameter( _
"@PrimaryAccountNo", adChar, adParamInput, , Me.PrimaryAccountNo)
.Parameters.Append .CreateParameter( _
"@Amount", adCurrency, adParamInput, , Me.Amount)
.Parameters.Append .CreateParameter( _
"@FeeCode", adInteger, adParamInput, , Me.FeeCode)
.Parameters.Append .CreateParameter( _
"@ReconciledNominalDate", adDBTimeStamp, adParamInput, , Me.ReconciledNominalDate)
.Parameters.Append .CreateParameter( _
"@UpfrontNominalFeeID", adInteger, adParamInput, , Me.UpfrontNominalFeeID)
.Parameters.Append .CreateParameter( _
"@ReconcileNominal", adBoolean, adParamInput, , Nz(Me.ReconcileNominal, 0))
.Parameters.Append .CreateParameter( _
"@NominalAmount", adCurrency, adParamInput, , Me.NominalAmount)
.Parameters.Append .CreateParameter( _
"@ReconcileMAP33", adBoolean, adParamInput, , Nz(Me.ReconcileMAP33, 0))
.Parameters.Append .CreateParameter( _
"@ReconciledMAP33Date", adDBTimeStamp, adParamInput, , Me.ReconciledMAP33Date)
.Execute
End With
Set cmd = Nothing
ExitHere:
Exit Sub
HandleErr:
MsgBox Err & ": " & Err.Description, , "Insert to Temp error"
Resume ExitHere
Resume
End Sub
Alter Procedure "spInsertTrialSample2"(
@UpfrontFeeID int,
@PrimaryAccountNo char,
@Amount money,
@FeeCode int,
@ReconciledNominalDate datetime = Null,
@UpfrontNominalFeeID int,
@ReconcileNominal bit,
@NominalAmount money,
@ReconcileMAP33 bit,
@ReconciledMAP33Date datetime = Null)
As
Set Nocount on
Create table #tempTrial
(UpfrontFeeID int,
PrimaryAccountNo char,
Amount money,
FeeCode int,
ReconciledNominalDate datetime,
UpfrontNominalFeeID int,
ReconcileNominal bit default 0,
NominalAmount money,
ReconcileMAP33 bit default 0,
ReconciledMAP33Date datetime)
Insert into #tempTrial
(UpfrontFeeID,
PrimaryAccountNo,
Amount,
FeeCode,
ReconciledNominalDate,
UpfrontNominalFeeID,
ReconcileNominal,
NominalAmount,
ReconcileMAP33,
ReconciledMAP33Date)
Values(
@UpfrontFeeID,
@PrimaryAccountNo,
@Amount,
@FeeCode,
@ReconciledNominalDate,
@UpfrontNominalFeeID,
@ReconcileNominal,
@NominalAmount,
@ReconcileMAP33,
@ReconciledMAP33Date)
return