I’ve been struggling all day calling a Stored Procedure from a classic ASP page. I have a few basic noobie questions.
First, is this the best way to add a parameter to my command:
cmd.Parameters.Append cmd.CreateParameter("@SubmissionDate", adDBTimeStamp, adParamInput, , txtDate)
Second, is adDbTimeStamp the proper type to use when mapping to a smalldatetime parameter in my Stored Procedure?
Third, how do I pass a null date to a datetime stored procedure?
Also, what editors are popular for classic ASP development. I was told to use Dreamweaver (bought CS4) but I’m really having some performance issues and have downgraded to the mighty NotePad.
Thanks!
The
adDBTimeStampis the correct data type for passing in a datetime and using Append/CreateParameter is the best way to create the parameter.However would
txtDatebe a string? You should really convert this to a Date type first. Thats not a easy as it sounds unless you can be very sure of the date format used when entering the data on the form.To pass in null just replace the parameter with the Null expression value:-
I use VS2005/2008 to edit most ASP but I like to have Notepad++ hanging around when I want to tweak something quickly.