|
|
Archives of the TeradataForum
Message Posted: Tue, 23 Feb 2010 @ 12:58:56 GMT
Subj: | | Re: Using macros and Excel |
|
From: | | dilin.joy |
Didier,
Here is the sample script:
Dim cnt1 As Object
Set cnt1 = CreateObject("ADODB.Connection")
Dim rst1 As Object
Set rst1 = CreateObject("ADODB.Recordset")
Dim stSQL1 As String
Const stCon1 As String = "DSN=Devlog"
cnt1.ConnectionString = stCon1
s1 = "modify user " + ActiveSheet.Range("B3").Value + " as release password lock; "
stSQL1 = s1
cnt1.Open
cnt1.CommandTimeout = 1000
rst1.Open stSQL1, cnt1
MsgBox "Unlocking the Password"
By changing the object names (like cnt1 to cnt 2, rst1 to rst 2, etc you can keep on adding different SQL functions with in Private Sub
function and End Sub (CommandButton1_Click() is a function)
Thanks, Dilin
| |