I am using VB6 and a SP in SQL Server 2000. It works for me before I add the InvDate line so I know the problem is there. It gives me the error of "Optional feature not implemented". My field is set up as a Name: InvDate, DataType: datetime, Size: 7.
I know it is in the InvDate part, but I don't know where it is going wrong
Here is my code in VB6.
Here is my SP.
I know it is in the InvDate part, but I don't know where it is going wrong
Here is my code in VB6.
Code:
Private Sub Command1_Click()
Dim cnConn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim prm As New ADODB.Parameter
cnConn.Open "Driver={SQL Server};Server=hhb-intranet;Database=HHbShippers;uid=jk;pwd=jk;"
cmd.ActiveConnection = cnConn
' If cnConn.State = adStateOpen Then MsgBox "Here"
cmd.CommandText = "sp_ScannerInsertInvoice"
cmd.CommandType = adCmdStoredProc
' cmd.Parameters.Append cmd.CreateParameter("ScannerID", adInteger, adParamInput, , 2)
cmd.Parameters.Append cmd.CreateParameter("Invoice", adChar, adParamInput, 7, "G10008")
cmd.Parameters.Append cmd.CreateParameter("InvDate", adDBDate, adParamInput, , "6/1/2005 8:53:27 AM")
cmd.Parameters.Append cmd.CreateParameter("EmployeeID", adInteger, adParamInput, , 1001)
cmd.Execute
Set cmd = Nothing
End Sub
Here is my SP.
Code:
CREATE PROCEDURE dbo.sp_ScannerInsertInvoice (
--Parameters
@Invoice char (7),
@EmployeeID int,
@InvDate DateTime
)
AS
INSERT INTO Invoices
(Invoice, EmployeeID, Complete, InsertDateTime, InvDate)
VALUES
(@Invoice, @EmployeeID, 0, GetDate(), @InvDate)
GO