|
-
Feb 11th, 2000, 10:05 PM
#4
Thread Starter
Hyperactive Member
i inserted all of the references and still had a problem , so i inserted other references :
MS data formating object lib.
MS Access 9.0 object library
MS ActiveX data object lib 2.1
MS ActiveX data object Recordset lib. 2.1
MS DAO 3.6 object lib.
so the unsrecognised error disapeared but now i have another one : "Type mismatch"
so i thought maybe there is an error in the code so there i am pasting the code , hoping that anyone can help :
Dim oDB As Database
Dim oRs As Recordset
Dim addline As ListItem
'Open your Database
Set oDB = Workspaces(0).OpenDatabase(App.Path & "\file.mdb")
'Select the Records You Want in the Listbox, In This Example, the LastName of all Employees
Set oRs = oDB.OpenRecordset("Select membername FROM Memberlist", dbOpenForwardOnly)
While Not oRs.EOF
'Step through the Recordset adding the "LastName" Field of Each Record to the Listbox
Set addline = ListView1.ListItems.Add(, , oRs("membername"))
addline.SubItems(1) = oRs("memberlastname")
oRs.MoveNext
Wend
------------------
- regards -
- razzaj -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|