|
-
Nov 6th, 2000, 05:25 PM
#1
Thread Starter
New Member
Here's a little problem that is really bugging me, I hope someone has had it before.
I'm using a data enviroment with one or more commands as the source for data reports, it all works fine until I try to set the connection string of the DEconnection and the command text of the DEcommand programatically. This generates an error "method 'item' of object 'commands' failed". If I use the on error resume next and repeat the command text it works ok - but it's not very elegant. Hope one of you gurus out there can help.
-
Nov 7th, 2000, 09:14 AM
#2
Addicted Member
Make sure that the fields in your dataenvironment command are the same as the new sql string you are placing.
also, after you have set the new datasource name, try
dim strnewcon as string
deconnection.properties("Data Source").value equals (my equal sign does not work) "C:\database\data.mdb"
strnewcon equals deconnection.connectionstring
deconnection.connectionstring equals strnewcon
looks weird but at times it solves problems.
-
Nov 7th, 2000, 11:28 AM
#3
Thread Starter
New Member
Thanks for the help, it didn't work but it put me in the right direction. The problem turned out to be the DEconnection.ConnectionString. The ConnectionString property can only be set at run time, while the ConnectionSource property can only be set at design time. The Conection String is made up of 2 parts (the connection string first then the connection source appended).
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
|