|
-
Oct 31st, 1999, 02:44 PM
#1
Thread Starter
Addicted Member
I Have a procedure in an activex control that when I try to call I get and "Object required" error... any ideas?
Here's the code
Activex sub:
Public Sub Repopulate()
Dim DB As Database
Dim rstRecordSet As Recordset
Dim Entete As String
Dim Data As String
Dim I As Integer
Set DB = TechGrid.dsDatabase
Set rstRecordSet = DB.OpenRecordset(TechGrid.dsRecordset, dbOpenSnapshot)
Flexgrid.Rows = 2
Flexgrid.Cols = rstRecordSet.Fields.Count
Flexgrid.FixedRows = 1
'Faire les entetes de colonnes...
For I = 0 To rstRecordSet.Fields.Count - 1
If I = 0 Then
Entete = rstRecordSet.Fields(I).Name
Else
Entete = Entete & Chr(9) & rstRecordSet.Fields(I).Name
End If
Next I
'Populer la grille
rstRecordSet.MoveFirst
Do While Not rstRecordSet.EOF
For I = 0 To rstRecordSet.Fields.Count - 1
If I = 0 Then
Data = rstRecordSet.Fields(I).Value
Else
Data = Data & Chr(9) & rstRecordSet.Fields(I).Value
End If
Next I
Loop
End Sub
Now I call my procedure as so:
TechGrid1.Repopulate
Please Help.
-
Oct 31st, 1999, 03:25 PM
#2
Lively Member
Are you calling the Sub from a seperate Program with an instance of the OCX in the Program.
If so it should work, I think.
Try creating a group project, by opening the Active Project and adding a project to it.
This will allow you to see exactly what line the error is occuring on, maybe the object required is within the OCX. This method will allow you to debug the OCX.
Hope this helps,
Steve.
-
Oct 31st, 1999, 08:22 PM
#3
Thread Starter
Addicted Member
Thank you very much.... I'l try that!
-
Nov 1st, 1999, 02:50 AM
#4
New Member
If your app is an ActiveX DLL, then from the second program you need to get a handle to the first program.
Example
Dim MyGrid
Set MyGrid = CreateObject("objectname.classname")
MyGrid.Repopulate
The project group is a good way to test, but it more tightly couples the objects, making it harder to deliver updates.
------------------
WebMan
-
Nov 1st, 1999, 09:07 AM
#5
Thread Starter
Addicted Member
HEHE... you kinda lost me there Webman...
What I'm trying to do is an activex that I can use in a .exe just as I would use msflexgrid. My activex has MsFlexGrid in it. I just want to be able to use mine without as easly as say a listbox in MsAccess Where I would just have to set it's recordsource (a property) and then call the repopulate method.
can u help
P.S.: I tried what you said SteveS but the debugger wouldn't go in my activex code.
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
|