Ken's given you a good answer, I just wanted to add:
Bill Kellaway wrote:
> Connect.Open = "DATABASE=blah;UID=blah;PWD=blah;DSN=blah;"
You should be using the native OLEDB provider for SQL: the ODBC provider has
been deprecated by Microsoft. See
www.connectionstrings.com
> Connect.Execute("Insert_LeadStat")
> Connect.Close
> Set Connect = Nothing
> ************************************************** *******************
> Gives me this error:
> Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
> [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
> 'insert_LeadStat' expects parameter '@OfficeNum', which was not
> supplied.
> /ltsenroll/leadsource_dbadd.asp, line 22
You did not pass any parameters.
>
> Here's my Stored procedure ...
> ************************************************** *******************
> CREATE PROCEDURE [insert_LeadStat]
> ( @OfficeNum [int],
> @LTSOffice [varchar](50),
> @AdminRep [varchar](50),)
> AS INSERT INTO [MFKProductions].[dbo].[LeadStats]
> ( [OfficeNum],
> [LTSOffice],
> [AdminRep],)
> VALUES
> ( @OfficeNum,
> @LTSOffice,
> @AdminRep,)
> GO
>
If you want to use a Command object to run this procedure, you may want to
give my free Stored Procedure Call Code Generator a try. It's available at
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear
However, your procedure has no ouptut parameters and you do not seem to be
interested in the Return parameter, so you do not need a Command object: you
can use the stored-procedure-as-connection-method technique:
dim offnum, lts, admin
offnum = ...
lts = "..."
admin = "..."
Connect.insert_LeadStat offnum, lts,admin
Pass the parameter values just as if insert_LeadStat was a native method of
your connection object. Use variables or literal values.
HTH,
Bob Barrows