A
AlwaysFroosh!
Hello,
I am trying to set a variable in my code to a value located in a table using
the following code:
Dim LengthRecord As New ADODB.Recordset
Dim SQL As String
SQL = "SELECT SETTINGS.VALUE FROM SETTINGS WHERE SETTINGS.ROOT='TAG' AND
SETTINGS.SECTION='Serial' AND SETTINGS.KEYNAME='Length';"
LengthRecord.Open SQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
TagLength = LengthRecord("VALUE")
I keep getting an error that says:
Run-time error '-2147467259 (80004005)':
Method 'Open' of object '_Recordset' failed
What am I doing wrong? The Select statement only returns one value from the
table.
Thanks for the help,
Graham
I am trying to set a variable in my code to a value located in a table using
the following code:
Dim LengthRecord As New ADODB.Recordset
Dim SQL As String
SQL = "SELECT SETTINGS.VALUE FROM SETTINGS WHERE SETTINGS.ROOT='TAG' AND
SETTINGS.SECTION='Serial' AND SETTINGS.KEYNAME='Length';"
LengthRecord.Open SQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
TagLength = LengthRecord("VALUE")
I keep getting an error that says:
Run-time error '-2147467259 (80004005)':
Method 'Open' of object '_Recordset' failed
What am I doing wrong? The Select statement only returns one value from the
table.
Thanks for the help,
Graham