|
-
Jul 1st, 2010, 09:42 PM
#7
Thread Starter
Frenzied Member
Re: Help requested
Hi Guys, thanks for the responces.
Wen, I have the required result in Access, but wanted to use VB to have a standalone .exe I could give to someone else. My next big hurdle will be to see if the table can also be included and compiled with the .exe.
Si, I didn't get the tutorial running, but did find something else explaining how to use the Data Control and I could connect (bind?) that to a label and see the data using the arrows to move around. But I could not 'get' the data into a variable, to then use .additem and populate the combo box.
No matter, I changed plans to
Code:
Option Explicit
Public gobjEmpDB As Database
Private Rst As Recordset
Public Sub OpenEmpDatabase()
Set gobjEmpDB = OpenDatabase("E:\Access\SheetMusic\Sheetmusic.mdb")
End Sub
Public Sub CloseEmpDatabase()
gobjEmpDB.Close
Set gobjEmpDB = Nothing
End Sub
Public Sub CenterForm(pobjForm As Form)
With pobjForm
.Top = (Screen.Height - .Height) / 2
.Left = (Screen.Width - .Width) / 2
End With
End Sub
Sub MyStart()
Dim First As Boolean, tmp
OpenEmpDatabase
Set Rst = gobjEmpDB.OpenRecordset("qryLNames")
Do
If IsNull(Rst(0)) = False Then
Form1.cboChooseLabel.AddItem Rst(0)
End If
The strange names, 'gobjEmpDB' etc. are those used in the tutorial I found.
The above works. Is that ADO ??
I Googled and discovered
DAO = Database Access Object
ADO = ActiveX Data Objects
Doesn't mean much to me. In Access I use
Dim db As DAO.Database
Set db = CurrentDb
Dim r As DAO.Recordset
because I was told to. Prior to that it worked without the DAO prefix. Maybe ADO would work too? Any advantages aren't obvious.
Regards, ABB
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
|