Odd SQLOLEDB Connection behavior 
Author Message
 Odd SQLOLEDB Connection behavior

I am running VB6.0 with service pack 5 on a Windows 2000
Pro machine.  My SQL database is SQL 7.
I am making an ADO connection using the SQLOLEDB provider
to connect to the master database to create a new database
at runtime.  When I'm finished, I close the connection and
set it to nothing.  Then I make a new connection using
SQLOLEDB to the database I just created to add tables.  
The problem is that these new tables are getting created
in master, not my new database.  I understand that
SQLOLEDB allows only one connection.  But any ideas why
this is happening?  Is SQLOLEDB caching the connection
somewhere?
If I end my application and connect directly to the new
database, there are no issues.

I have also been able to work around this issue by
explicitly telling sql "CREATE TABLE
<database>.<owner>.<tablename>



Sun, 27 Jun 2004 00:32:16 GMT
 Odd SQLOLEDB Connection behavior

Hi,

How do you do that. It should work fine if you do it in a
way you are writing. Check connection string.

Val

Quote:
>-----Original Message-----
>I am running VB6.0 with service pack 5 on a Windows 2000
>Pro machine.  My SQL database is SQL 7.
>I am making an ADO connection using the SQLOLEDB provider
>to connect to the master database to create a new
database
>at runtime.  When I'm finished, I close the connection
and
>set it to nothing.  Then I make a new connection using
>SQLOLEDB to the database I just created to add tables.  
>The problem is that these new tables are getting created
>in master, not my new database.  I understand that
>SQLOLEDB allows only one connection.  But any ideas why
>this is happening?  Is SQLOLEDB caching the connection
>somewhere?
>If I end my application and connect directly to the new
>database, there are no issues.

>I have also been able to work around this issue by
>explicitly telling sql "CREATE TABLE
><database>.<owner>.<tablename>
>.



Sun, 27 Jun 2004 01:04:26 GMT
 Odd SQLOLEDB Connection behavior
Hi Cameron,

You can try to set the ADO connection 's DefaultDatabase property to the
new database you created. Hope this help!

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Mon, 28 Jun 2004 14:51:40 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Odd behavior from queries using GROUP BY with CASE

2. Odd behavior with dynamic property

3. Odd behavior in SQL Server 7

4. Odd subselect in target list behavior WRT aggregation

5. MSSQL 6.5 odd behavior

6. Odd behavior with Enterprise Manager through a firewall

7. SH_PAGE lock without SH_INTENT and other odd behavior

8. odd behavior with datetime passed to sp

9. Odd Behavior with Temp Procedure

10. Odd behavior with SUSER_SNAME

11. Odd behavior when filling a DataSet from an XSD Mapping Schema

12. Odd UPDATE Behavior


 
Powered by phpBB® Forum Software