|
Hi All,
i'm running a vba application using Ms Access.
in my database,Employee table, i'm having department ID same for 3 employees
i need to get that id in an array
i gave the code as
value = recordset.Fields(0).value
'value will record the count of Deptid coulmn whic have the same ID
Dim i As Integer
Dim data(4) As Integer
recordset.Close
Set recordset = New ADODB.Recordset
For i = 1 To value
sql_check = "select Deptid from Employee where deptName = '" & Name & "'"
recordset.Open sql_check, connection, adOpenDynamic, adLockOptimistic
connection.Execute sql_check
data(i) = recordset.Fields(0).value
Next i
but i' getting a runtime error that operation not allowed when the object is open
Please help...
regards
Rachel
|
|
|
|
|
|
|
// |