Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vbnullstring as parameter causes error #9

Open
Energeer opened this issue May 25, 2022 · 1 comment
Open

vbnullstring as parameter causes error #9

Energeer opened this issue May 25, 2022 · 1 comment

Comments

@Energeer
Copy link

First of all thanks very much for this Library! Not sure if this is by design or if my usage is wrong, however if I pass a vbnullstring or "" as a parameter an error occurs.

The line below in AdoParameterProvider results in the size property of the ADO parameter defaulting to 0 for empty strings. The size property is not allowed to be 0 for string types (at least not in what I am using it for) and causes an error.

If IsCharMapping(Result.Type) And Len(Value) > 0 Then Result.Size = Len(Value)

I have fixed the issue in my project by changing the line to:

If IsCharMapping(Result.Type) Then
     If Len(Value) > 0 Then Result.Size = Len(Value) Else Result.Size = 1
End If

Is there a better way?

@retailcoder
Copy link
Member

Setting a minimum size of 1 seems like a sensible default indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants