tfurnivall
Registered User.
- Local time
- Today, 02:59
- Joined
- Apr 19, 2012
- Messages
- 81
Hi
I'm building a lab environment into one of my projects. I'm testing the distribution of values over a largish number of attempts to create a unique value.
I have a table called LAB_UniqueIDTest, with two fields:
LAB_ID - the string value being tested, and
LAB_UsageCount - the number of times the value has been created.
I'm trying to open the table using the following code:
I have similar snippets of code all over the application - either with a literal (as here) or as a string parameter.
I do not, ever, use the options parameter of rs.open (mainly because I can't translate the gibberish in the documentation into English), but these snippets work. Delightfully!
All except this one :-(
I get error message "Run time error -2147217900 (80040e14)
Invalid SQL statement - expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE
My guess is it's because somehow the Open procedure is trying to interpret the tablename as a SQL statement. But how come it isn't this obtuse at other times?
I know it's something I'm doing, but I can't figure it out.
Can anyone help? I'll blush unseen when I learn how I've screwed up!
Tony
I'm building a lab environment into one of my projects. I'm testing the distribution of values over a largish number of attempts to create a unique value.
I have a table called LAB_UniqueIDTest, with two fields:
LAB_ID - the string value being tested, and
LAB_UsageCount - the number of times the value has been created.
I'm trying to open the table using the following code:
Code:
' Initialize access to the LAB_UniqueIDTest table
Set rs = New ADODB.Recordset
rs.Open "LAB_UniqueIDTest", _
CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic
I do not, ever, use the options parameter of rs.open (mainly because I can't translate the gibberish in the documentation into English), but these snippets work. Delightfully!
All except this one :-(
I get error message "Run time error -2147217900 (80040e14)
Invalid SQL statement - expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE
My guess is it's because somehow the Open procedure is trying to interpret the tablename as a SQL statement. But how come it isn't this obtuse at other times?
I know it's something I'm doing, but I can't figure it out.
Can anyone help? I'll blush unseen when I learn how I've screwed up!
Tony