RE: Active X connect to SQL 2000
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 9 Jan 2006 23:01:18 +0000 (UTC)
popol (popol@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
> Here is a piece of code (running as an ActiveX task of a DTS)
>
> set cnx = CreateObject("ADODB.Connection")
> cnx.provider = "sqloledb"
> cnx.open "(local)","Stat", "Alice"
> cnx.DefaultDatabase = "Stat"
cnx.ConnectionString = "Provider=SQLOLED;Trusted_connection=Yes;" & _
"Server=xxx;Database=xxx";
If you are connecting to the local server, you don't have to specify
the server, as (local) is the default.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- RE: Active X connect to SQL 2000
- From: Erland Sommarskog
- RE: Active X connect to SQL 2000
- Prev by Date: ystem.Data.OleDb.OleDbException executing update command: "cannot be a zero-length string"
- Next by Date: databasefile locked after close , cant do file operations on it.
- Previous by thread: RE: Active X connect to SQL 2000
- Next by thread: System.Data.OleDb.OleDbException executing update command: "cannot be a zero-length string"
- Index(es):
Relevant Pages
|
Loading