![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have a connection object created called "connection 2" that connects with the user name and password to the proper database. I am tring to do the following: set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADORS.Open "SELECT * FROM SpamLogs", objCnn, adOpenKeyset, adLockOptimistic but its not working, i get an arguments of the wrong time with the recordset opening. i also tried the following: set objADOCnn = CreateObject("ADODB.Connection") set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADOCnn.Provider="sqloledb" objADOCnn.Properties("Initial Catalog")=objCnn.Catalog objADOCnn.Properties("Data Source")=objCnn.Datasource objADOCnn.Properties("User ID") = objCnn.UserId objADOCnn.Properties("Password") = objCnn.Password 'objADOCnn.Properties("Database") = objCnn.Database objADOCnn.Open objADORS.Open "SELECT * FROM SpamLogs", objADOCnn, adOpenKeyset, adLockOptimistic but this fails on the .open command. (i belive its not getting the password). Any suggestions? Thanks |
#3
| |||
| |||
|
|
You cannot use connections in this way. You could rip the details from a connection and use that in your ADO code though (except for the password property if used) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Ben" <ben_1_ AT hotmail DOT com> wrote in message news 72F7A11-AC54-4FAE-9C52-471778CF8B92 (AT) microsoft (DOT) com...Hello, I have a connection object created called "connection 2" that connects with the user name and password to the proper database. I am tring to do the following: set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADORS.Open "SELECT * FROM SpamLogs", objCnn, adOpenKeyset, adLockOptimistic but its not working, i get an arguments of the wrong time with the recordset opening. i also tried the following: set objADOCnn = CreateObject("ADODB.Connection") set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADOCnn.Provider="sqloledb" objADOCnn.Properties("Initial Catalog")=objCnn.Catalog objADOCnn.Properties("Data Source")=objCnn.Datasource objADOCnn.Properties("User ID") = objCnn.UserId objADOCnn.Properties("Password") = objCnn.Password 'objADOCnn.Properties("Database") = objCnn.Database objADOCnn.Open objADORS.Open "SELECT * FROM SpamLogs", objADOCnn, adOpenKeyset, adLockOptimistic but this fails on the .open command. (i belive its not getting the password). Any suggestions? Thanks |
#4
| |||
| |||
|
|
Thanks Allan, but the reason I was attempting this is so the code doesnt have to have the password coded in plain text. I guess since only admin and authorized users can read the control it will be ok. Is there any other way around it? Ben "Allan Mitchell" wrote: You cannot use connections in this way. You could rip the details from a connection and use that in your ADO code though (except for the password property if used) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Ben" <ben_1_ AT hotmail DOT com> wrote in message news 72F7A11-AC54-4FAE-9C52-471778CF8B92 (AT) microsoft (DOT) com...Hello, I have a connection object created called "connection 2" that connects with the user name and password to the proper database. I am tring to do the following: set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADORS.Open "SELECT * FROM SpamLogs", objCnn, adOpenKeyset, adLockOptimistic but its not working, i get an arguments of the wrong time with the recordset opening. i also tried the following: set objADOCnn = CreateObject("ADODB.Connection") set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADOCnn.Provider="sqloledb" objADOCnn.Properties("Initial Catalog")=objCnn.Catalog objADOCnn.Properties("Data Source")=objCnn.Datasource objADOCnn.Properties("User ID") = objCnn.UserId objADOCnn.Properties("Password") = objCnn.Password 'objADOCnn.Properties("Database") = objCnn.Database objADOCnn.Open objADORS.Open "SELECT * FROM SpamLogs", objADOCnn, adOpenKeyset, adLockOptimistic but this fails on the .open command. (i belive its not getting the password). Any suggestions? Thanks |
#5
| |||
| |||
|
|
Not really. Why do you have the need to break out into ADO? Can DTS out of the box not cut it? -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Ben" <ben_1_ AT hotmail DOT com> wrote in message news:3A6B9B8E-FDAE-4115-BF0C-3D1F13A3B78E (AT) microsoft (DOT) com... Thanks Allan, but the reason I was attempting this is so the code doesnt have to have the password coded in plain text. I guess since only admin and authorized users can read the control it will be ok. Is there any other way around it? Ben "Allan Mitchell" wrote: You cannot use connections in this way. You could rip the details from a connection and use that in your ADO code though (except for the password property if used) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - You thought DTS was good. here we show you the new stuff. www.konesans.com - Consultancy from the people who know "Ben" <ben_1_ AT hotmail DOT com> wrote in message news 72F7A11-AC54-4FAE-9C52-471778CF8B92 (AT) microsoft (DOT) com...Hello, I have a connection object created called "connection 2" that connects with the user name and password to the proper database. I am tring to do the following: set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADORS.Open "SELECT * FROM SpamLogs", objCnn, adOpenKeyset, adLockOptimistic but its not working, i get an arguments of the wrong time with the recordset opening. i also tried the following: set objADOCnn = CreateObject("ADODB.Connection") set objCnn = DTSGlobalVariables.Parent.Connections("Connection 2") Set objADORS = CreateObject("ADODB.Recordset") objADOCnn.Provider="sqloledb" objADOCnn.Properties("Initial Catalog")=objCnn.Catalog objADOCnn.Properties("Data Source")=objCnn.Datasource objADOCnn.Properties("User ID") = objCnn.UserId objADOCnn.Properties("Password") = objCnn.Password 'objADOCnn.Properties("Database") = objCnn.Database objADOCnn.Open objADORS.Open "SELECT * FROM SpamLogs", objADOCnn, adOpenKeyset, adLockOptimistic but this fails on the .open command. (i belive its not getting the password). Any suggestions? Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |