W
warway
My Access2000 form happily inserts a new record into a SQL2000 table using a
stored procedure apart from an unbound text field containing a formatted
date. I beleive that I have tried every variation, text, short date, long
date etc on the field, in the code behind the form Cstr, CDate, Cvar etc.
The field in the table is datetime, i've tried smalldatetime.
I either get a Type mismatch error or it cannot use the / in the data to
enter into the table.
cn.Execute ("Execute sp_InvoiceCreate " + CStr(Me.ShipmentID) + "," +
CStr(Me.cboInvoice.Column(0)) + "," + CStr(Me.GrossTotal) + "," +
CStr(Me.NetTotal) + "," + CStr(Me.VATTotal) + "," + CVar(Me.txtROE) + "," +
CVar(Me.cboCurrencyActualOut.Column(0)) + "," + CVar(Me.txtInvoiceDate))
Alter Procedure dbo.sp_InvoiceCreate (@Shipment int,@Company
int,@GrossAmount float,@NettAmount float,@Tax float,@ROE float,@Currency
int,@InvDate text)
AS
INSERT INTO tblInvoices
(ShipmentID,CompanyID,GrossAmount,NettAmount,Tax,ROE,CurrencyID,InvDate)
VALUES
(@Shipment,@Company,@GrossAmount,@NettAmount,@Tax,@ROE,@Currency,@Invdate)
Gives type mismatch in execution
cn.Execute ("Execute sp_InvoiceCreate " + CStr(Me.ShipmentID) + "," +
CStr(Me.cboInvoice.Column(0)) + "," + CStr(Me.GrossTotal) + "," +
CStr(Me.NetTotal) + "," + CStr(Me.VATTotal) + "," + CVar(Me.txtROE) + "," +
CVar(Me.cboCurrencyActualOut.Column(0)) + "," + CDate(Me.txtInvoiceDate))
Alter Procedure dbo.sp_InvoiceCreate (@Shipment int,@Company
int,@GrossAmount float,@NettAmount float,@Tax float,@ROE float,@Currency
int,@InvDate datetime)
AS
INSERT INTO tblInvoices
(ShipmentID,CompanyID,GrossAmount,NettAmount,Tax,ROE,CurrencyID,InvDate)
VALUES
(@Shipment,@Company,@GrossAmount,@NettAmount,@Tax,@ROE,@Currency,@Invdate)
Gives type mismatch in execution
Any ideas?
TIA
Andrew
(e-mail address removed)
stored procedure apart from an unbound text field containing a formatted
date. I beleive that I have tried every variation, text, short date, long
date etc on the field, in the code behind the form Cstr, CDate, Cvar etc.
The field in the table is datetime, i've tried smalldatetime.
I either get a Type mismatch error or it cannot use the / in the data to
enter into the table.
cn.Execute ("Execute sp_InvoiceCreate " + CStr(Me.ShipmentID) + "," +
CStr(Me.cboInvoice.Column(0)) + "," + CStr(Me.GrossTotal) + "," +
CStr(Me.NetTotal) + "," + CStr(Me.VATTotal) + "," + CVar(Me.txtROE) + "," +
CVar(Me.cboCurrencyActualOut.Column(0)) + "," + CVar(Me.txtInvoiceDate))
Alter Procedure dbo.sp_InvoiceCreate (@Shipment int,@Company
int,@GrossAmount float,@NettAmount float,@Tax float,@ROE float,@Currency
int,@InvDate text)
AS
INSERT INTO tblInvoices
(ShipmentID,CompanyID,GrossAmount,NettAmount,Tax,ROE,CurrencyID,InvDate)
VALUES
(@Shipment,@Company,@GrossAmount,@NettAmount,@Tax,@ROE,@Currency,@Invdate)
Gives type mismatch in execution
cn.Execute ("Execute sp_InvoiceCreate " + CStr(Me.ShipmentID) + "," +
CStr(Me.cboInvoice.Column(0)) + "," + CStr(Me.GrossTotal) + "," +
CStr(Me.NetTotal) + "," + CStr(Me.VATTotal) + "," + CVar(Me.txtROE) + "," +
CVar(Me.cboCurrencyActualOut.Column(0)) + "," + CDate(Me.txtInvoiceDate))
Alter Procedure dbo.sp_InvoiceCreate (@Shipment int,@Company
int,@GrossAmount float,@NettAmount float,@Tax float,@ROE float,@Currency
int,@InvDate datetime)
AS
INSERT INTO tblInvoices
(ShipmentID,CompanyID,GrossAmount,NettAmount,Tax,ROE,CurrencyID,InvDate)
VALUES
(@Shipment,@Company,@GrossAmount,@NettAmount,@Tax,@ROE,@Currency,@Invdate)
Gives type mismatch in execution
Any ideas?
TIA
Andrew
(e-mail address removed)