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

add lcase as an option when LoadRecordset #88

Open
dtrillo opened this issue Mar 6, 2019 · 3 comments
Open

add lcase as an option when LoadRecordset #88

dtrillo opened this issue Mar 6, 2019 · 3 comments

Comments

@dtrillo
Copy link

dtrillo commented Mar 6, 2019

Hi.
I wonder if if is possible to add a new parameter on functions LoadRecordset and LoadFirstRecord to allow that the key can be always lower case.
I do like this:

public sub LoadFirstRecord(byref rs, lcaseall) ' Change 3.8.2
dim field

	for each field in rs.fields
		k = field.name: if lcaseall then k = lcase(k)
		add k, field.value
	next
end sub
@dtrillo
Copy link
Author

dtrillo commented Mar 6, 2019

There is a new option, in order to not loose compatibility with previous versions, just creating a new function:

' Load properties from the first record of an ADO RecordSet object
' @param rs as ADODB.RecordSet
public sub LoadFirstRecord2(byref rs, lcaseall) ' Change 3.8.2
dim field

	for each field in rs.fields
		k = field.name: if lcaseall then k = lcase(k)
		add k, field.value
	next
end sub
public sub LoadFirstRecord(byref rs) 
	LoadFirstRecord2 rs, false
end sub

@rcdmk
Copy link
Owner

rcdmk commented Mar 10, 2019

Hi. I think this could be a property to set in the object and all parsing from it would use lowercase keys. What do you think?

Something like this:

<%
set json = New JSONObject
json.LowerCaseKeys = true ' hypothetical property

' from here on every key added would be in lowercase
' ...
%>

@dtrillo
Copy link
Author

dtrillo commented Mar 11, 2019

That would be great!
So, you need to modify serializeObject, don't you?
I think this option will reduce problems with the response, instead of working on the model of the database.

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

No branches or pull requests

2 participants