Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connection poblem

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
keep on getting an eror messge:
run-time eror '3709'
operation is not allowed on an object referening a closed or invalid connection
It is pointing straight to the opening of a dataenvironemnt command.
So to fix it I first test to see if the command is open
on debug it tell m hat te connection is losed.
DeAccessAdmin is the dataenvironment name
CTS is the connection name
User_Details is the ommand name
The code is a follows:
If DeAccessAdmin.CTS.state = adstateopen then
DeAccessAdmin.CTS.close
end if
If DeAccessAdmin.rsUser_Details2.state = adstateopen then
DeAccessAdmin.rsUser_Details.close
end if
DeAccessAdmin.rsUser_Details2.open 'error mesage here
.....
Funny thing is I am askng that i it is closed to close it
Anyone have ideas
?
 
SOLVED,.... Dataenviroment will allow you to open a connection once and once only... Command is a different story you can open and close to your hearts content...

If you are runing some sort of SQL statement that uses the connection then it it better to use the recordset connecting to a statement within the form or module..

In the furture hoping someone can prove this thread incorrect.. After 4 days of working with it searching the web could not find an answer except a one liner in microsoft's site
Q. Why can't I get a parameter query to work on the Data Control?
A. This is a limitation of the Data Control. It does not support parameter
queries. The Properties window lists any available non-parameter queries,
but does not list any parameter queries in the database, so it's not
possible to make the mistake of using a parameter query for a Data Control
at design time.
The work around to this limitation is to run the parameterized query into a
scratch recordset variable and then set that result into the recordset of
the Data Control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top