Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 ADODB.Recordset Conn Parameters

Author  Topic 

FedeX
Starting Member

5 Posts

Posted - 2005-12-16 : 06:05:28
Hi,
I am a beginner in DTS..
I would like to connect to a DB to extract some records in a Recordset. I am using the ActiveX Script Task.

I saw some samples here in Forum and in Microsoft homepage but It does not work in my case... I am not sure how or what parameters I have to enter

One sample that I saw :


Set objADORS = CreateObject("ADODB.Recordset")

objADORS.Open "SELECT * FROM myTab", _
"PROVIDER=SQLOLEDB.1;SERVER=SERVERNAME;UID=USERNAME;PWD=PASSWORD;DATABASE=DBNAME;"

where can I define the values for SERVERNAME USERNAME PASSWORD DBNAME??

second sample

dim myConn
dim myRecordset


' instantiate the ADO objects
set myConn = CreateObject("ADODB.Connection")
set myRecordset = CreateObject("ADODB.Recordset")

' set the connection properties to point to the Northwind database,
' using the Customers table
myConn.Open = "Provider=SQLOLEDB.1;Data Source=(local); _
Initial Catalog=Northwind;user id = 'sa';password='sapassword'"

when I replace the fields with my info ..it does not work.. I need to to somthing before ??
what does "local" means?

why the parameter names between both samples are so differents ( UID vs user id) ?

If I have a connection in the same DTS package, i need anyway to make other connection in the ActiveX (MyConn.open)...

well I am confuse...so I am going zo ghelp any information to get connected to my DB...

Regards


FedeX




surendrakalekar
Posting Yak Master

120 Posts

Posted - 2005-12-16 : 06:25:03
refer...
www.connectionstring.com
www.sqldts.com


Surendra
Go to Top of Page

FedeX
Starting Member

5 Posts

Posted - 2005-12-16 : 06:45:52
Thanks Surendra,

there is no information about my problem in there. :-(
Go to Top of Page

FedeX
Starting Member

5 Posts

Posted - 2005-12-16 : 07:08:36
Well I fixed my problem using the ip address because SQL Server is not local :


'Create ADO
Set myConn = CreateObject("ADODB.Connection")
Set objADORS = CreateObject("ADODB.Recordset")


' set the connection properties to point to theDB

myConn.Open = "Provider=SQLOLEDB.1;Data Source=168.167.2.1;Initial Catalog=myDB ;user id = 'admin';password='admin' "

objADORS.Open "SELECT * FROM MyTab", myConn

FedeX
Go to Top of Page
   

- Advertisement -