codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Runtime Error in VBA  RachelMary at 05:55 on Wednesday, November 08, 2006
 

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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  Security - Code verify
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007