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

Using "!" with a recordset #88

Closed
wopag opened this issue Apr 22, 2021 · 2 comments
Closed

Using "!" with a recordset #88

wopag opened this issue Apr 22, 2021 · 2 comments

Comments

@wopag
Copy link

wopag commented Apr 22, 2021

Describe the bug
Open a database with ADODB - compiler doesnt allow the use of the "!" to grab a field name?

To Reproduce
Using Microsoft DAO 3.6 Object Library, with a connection string to MYSQL database ( driver={MySQL ODBC 5.1 Driver} )

Dim dDatabaseConnection = New ADODB.Connection
Dim rs As New ADODB.Recordset

dDatabaseConnection.ConnectionString =
dDatabaseConnection.CursorLocation = adUseClient
dDatabaseConnection.CommandTimeout = 60
dDatabaseConnection.open

rs.open "SELECT * FROM versionstext order by ID DESC LIMIT 1", dDatabaseConnection, adOpenKeyset, adLockOptimistic

debug.print rs.Fields(0).value ' works
debug.print rs.Fields("ID").value ' works

debug.print rs!msg ' too few arguments, expected 1 in call to 'item'
debug.print rs![msg] ' too few arguments, expected 1 in call to 'item'

Expected behavior
debug.print rs!msg should print the contents of the field msg. Fails with "too few arguments, expected 1 in call to 'item'"
debug.print rs![msg] should print the contents of the field msg. Fails with "too few arguments, expected 1 in call to 'item'"

Additional context
Unless im missing an external reference?

@bclothier
Copy link
Collaborator

Unfortunately that's another preview limitation --- the use of bang operator makes it a late-bound call to the members of the object, and the preview does not allow late-binding of the object.

Note that rs!msg is equivalent to rs.Fields("msg").Value but with the side effect that this has to go through the IDispatch.

@WaynePhillipsEA
Copy link
Collaborator

@bclothier it's the IDispatch implementation inside twinBASIC classes that isn't yet live.

This should have been supported, but was a bug. Thanks for reporting.
Now fixed in v0.9.1944

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

3 participants