Link to home
Start Free TrialLog in
Avatar of camper12
camper12

asked on

Pass null to stored procedure

Hi,

I am trying to pass null to a parameter in stored procedure through vba. I am using the following:
If Sheets("f").Range("G3").Value = " " Then
rsCommand.parameters.Append rsCommand.CreateParameter(LB", adInteger, adParamInput, , Null)
Else
rsCommand.parameters.Append rsCommand.CreateParameter("LB", adInteger, adParamInput, , Sheets("f").Range("G3").Value)

It is going to the if statement but in the watchlist it is not assigning NULL to LB but it is showing empty.

Thanks
Avatar of Michael Fowler
Michael Fowler
Flag of Australia image

Null should work but you are missing a a double quote try

rsCommand.parameters.Append rsCommand.CreateParameter("LB", adInteger, adParamInput, , Null)
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial