|
-
Jul 31st, 2000, 09:02 AM
#1
Thread Starter
Addicted Member
Howdy!
If anyone one has an example of how to create a data environment through code with a data report (just the connection) attached to it.
Please send it to me!!! If it can be done!
Dim De1 As DataEnvironment
Dim cmd1 As Command
Set De1 = New DataEnvironment
'I get the error - "Class does not support Automation or does not support expected interface
Set cmd1 = New Command
If there is any references I need to add, let me know
Thanx
Hyme
[Edited by hyme on 07-31-2000 at 10:21 AM]
-
Jul 31st, 2000, 09:58 AM
#2
Hyperactive Member
Hyme,
What I think you're looking for is :
Code:
Private acon1 as Connection
Private acmd1 as Command
Set acon1 = New Connection
'Setup the connection i.e. .Provider and .ConectionString
acmd1.ActiveConnection = acmd1
' acmd1.CommandText = "SQL statement or whatever"
To use the above code you will need to add a project reference to Microsoft ActiveX Data Objects 2.5 Library. Have a look at the online help or get a book and learn ADO, it's a pretty big subject. Stick with it, it's much more flexible and powerful than the DE click and play stuff.
Good luck.
That's Mr Mullet to you, you mulletless wonder.
-
Jul 31st, 2000, 10:12 AM
#3
Thread Starter
Addicted Member
My goal is to set a Data Report to a
Data Environment that changes the SQL statement through code
The Data Report Uses only the Data Environment to work.
I can pre-determine the connection, but I can't change it!
Someone please help!
Hyme
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
|