SQL Connection Problems 
Author Message
 SQL Connection Problems

It sounds like your object has either failed to open or has passed out
of scope.  Did you declare your connection variables outside of the
FormLoad routine so that the object stays in scope once the
FormLoad routine closes?
Quote:

>I have a Visual Basic v5.0 application that opens a connection to a SQL
>Server 6.5 database.  This connection process occurs in the Form_Load
>routine of my startup form.  I have declared any variables associated with
>the connection as public.
>When I click my designed search button to execute a SELECT query, I receive
>run-time error:

>        Object invalid or no longer used.

>This errors happens on the OpenRecordset line where I am attempting to
>perform the recordset creation.

>I would like to keep the connection to the database open until the
>application closes instead of having to establish a connection whenever I
>perform my select.

>I'm new at SQL Server technology, so any help would be greatly appriciated.

>Thanks!

>.... Kirk



Thu, 14 Mar 2002 03:00:00 GMT  
 SQL Connection Problems
I have declared the connection variables in a module called PUBLIC.BAS.  The
variables are public.

When I enter the Form_Load routine, I don't have to declare the variables.
However, when I execute my search routine via a command button on the form,
I get the error.

Thanks!

Quote:

>It sounds like your object has either failed to open or has passed out
>of scope.  Did you declare your connection variables outside of the
>FormLoad routine so that the object stays in scope once the
>FormLoad routine closes?


>>I have a Visual Basic v5.0 application that opens a connection to a SQL
>>Server 6.5 database.  This connection process occurs in the Form_Load
>>routine of my startup form.  I have declared any variables associated with
>>the connection as public.
>>When I click my designed search button to execute a SELECT query, I
receive
>>run-time error:

>>        Object invalid or no longer used.

>>This errors happens on the OpenRecordset line where I am attempting to
>>perform the recordset creation.

>>I would like to keep the connection to the database open until the
>>application closes instead of having to establish a connection whenever I
>>perform my select.

>>I'm new at SQL Server technology, so any help would be greatly
appriciated.

>>Thanks!

>>.... Kirk



Fri, 15 Mar 2002 03:00:00 GMT  
 SQL Connection Problems
I declared my connection objects in a module called PUBLIC.BAS and I
declared them using the Public statement.

Thanks!

Quote:

>It sounds like your object has either failed to open or has passed out
>of scope.  Did you declare your connection variables outside of the
>FormLoad routine so that the object stays in scope once the
>FormLoad routine closes?


>>I have a Visual Basic v5.0 application that opens a connection to a SQL
>>Server 6.5 database.  This connection process occurs in the Form_Load
>>routine of my startup form.  I have declared any variables associated with
>>the connection as public.
>>When I click my designed search button to execute a SELECT query, I
receive
>>run-time error:

>>        Object invalid or no longer used.

>>This errors happens on the OpenRecordset line where I am attempting to
>>perform the recordset creation.

>>I would like to keep the connection to the database open until the
>>application closes instead of having to establish a connection whenever I
>>perform my select.

>>I'm new at SQL Server technology, so any help would be greatly
appriciated.

>>Thanks!

>>.... Kirk



Fri, 15 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SQL Connection Problem

2. CR.NET SQL connection problems

3. SQL connection problem

4. SQL Server connection problems

5. Connection problems to SQL server database

6. DAO to SQL 7 Connection problem

7. Win95 Client/SQL Server/DSN connection problems

8. Problem with closing and/or orphaned SQL Server Connections

9. SQL-Server / Visual Basic connections problem

10. VB4 and ODBC connection to SQL SERVER problem

11. Problem creating an SQL Server trigger from ADO connection in VB

12. ODBC/SQL Server Connection Problems!! Please Help

 

 
Powered by phpBB® Forum Software