Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Sunday, March 25, 2012

ActiveX Script Task - Help!

I have a script that is run in Excel or Access that automatically runs the code I have cut/pasted below. I attempted to cut/paste into an activeX task, but doesn't work. Would anyone be able to convert this to vbscript?
Thank you in advance for your help,
clutch
Attribute VB_Name = "CD-1291"
Option Compare Database
Option Explicit
Public Function CD1291()
On Error GoTo CD1291_Err
Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d As String, L1, L2, sd As Date
d = Application.CurrentProject.Path
If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
Y = Year(Now() - 1)
M1 = Month(Now() - 1)
If M1 < 10 Then
M1 = "0" & M1
End If
M2 = Month(Now() - 1)
If M2 < 10 Then
M2 = "0" & M2
End If
D1 = Day(Now() - 1)
If D1 < 10 Then
D1 = "0" & D1
End If
D2 = Day(Now() - 1)
If D2 < 10 Then
D2 = "0" & D2
End If
'MsgBox Y & "-" & M1 & "-" & D1
p = Application.CurrentProject.Path
''' MSL
Open p & "\CD1291.msl" For Output As #1
Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID '" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 & "0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
Print #1, "CLOSE"
Print #1, "RUN '" & p & "\CD1291.bat'"
Print #1, "EXIT"
Close #1
''' MOD
Open p & "\CD1291.mod" For Output As #1
Print #1, "MFWMOD12"
Print #1, "~Description"
Print #1, "Premier Bankcard, Inc."
Print #1, ""
Print #1, "~Settings"
Print #1, "M/D/Y"
Print #1, "50"
Print #1, "."
Print #1, "0"
Print #1, "1"
Print #1, "1"
Print #1, ","
Print #1, "0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "Y"
Print #1, "~ExtendedSettings"
Print #1, "42"
Print #1, "N"
Print #1, "(Null)"
Print #1, "1"
Print #1, "1"
Print #1, "128128255"
Print #1, "128,32,96"
Print #1, "255,0,255"
Print #1, "160,0,224"
Print #1, "64128128"
Print #1, "255,0,128"
Print #1, "128128128"
Print #1, "85,85,255"
Print #1, "128,0,128"
Print #1, "193,0,193"
Print #1, "255115115"
Print #1, "128,64,255"
Print #1, "0,128,0"
Print #1, "128,64,64"
Print #1, "255,0,0"
Print #1, "255191255"
Print #1, "255255255"
Print #1, "225225225"
Print #1, "151151151"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "12"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "8"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "~TableField"
Print #1, "Acct #"
Print #1, "16"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "16"
Print #1, "3"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Acct #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Pymt Date"
Print #1, "10"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "10"
Print #1, "4"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "5"
Print #1, "0"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Pymt Date"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Payment"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "19"
Print #1, "5"
Print #1, "N"
Print #1, "N"
Print #1, "19"
Print #1, "5"
Print #1, "0"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Payment"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Amount"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "16"
Print #1, "6"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "53"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Amount"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Strat ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "7"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "70"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Strat ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Line"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "8"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "80"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Line"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Actn ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "9"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "86"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Actn ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr #"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "10"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "96"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr Data"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "11"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "108"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr Data"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float %"
Print #1, "18"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "5"
Print #1, "12"
Print #1, "N"
Print #1, "N"
Print #1, "5"
Print #1, "5"
Print #1, "0"
Print #1, "119"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float %"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Q Prio"
Print #1, "2"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "2"
Print #1, "13"
Print #1, "N"
Print #1, "N"
Print #1, "2"
Print #1, "5"
Print #1, "2"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Q Prio"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "3"
Print #1, "14"
Print #1, "N"
Print #1, "N"
Print #1, "3"
Print #1, "5"
Print #1, "2"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Rpt"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "7"
Print #1, "1"
Print #1, "N"
Print #1, "N"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Rpt"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Date"
Print #1, "8"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "D"
Print #1, "0"
Print #1, "12"
Print #1, "2"
Print #1, "N"
Print #1, "N"
Print #1, "14"
Print #1, "0"
Print #1, "0"
Print #1, "107"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Date"
Print #1, "3"
Print #1, "N"
Print #1, "1"
Print #1, "1"
Print #1, "~Level"
Print #1, "0"
Print #1, ""
Print #1, "1"
Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA FIRST PREMIER BANK -FD- 01/09/04 PAGE 1 "
Print #1, "2"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "0"
Print #1, "2"
Print #1, "Page Header"
Print #1, "N"
Print #1, "N"
Print #1, "~Level"
Print #1, "5"
Print #1, "???????????"
Print #1, "3"
Print #1, "5149860001000015 2004/01/09 5.00 5.00 0002 0009 0001 0000 0000 100 "
Print #1, " QUEUE PRIO FLOAT CYCL "
Print #1, " 00 011 "
Print #1, "12"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "5"
Print #1, "2"
Print #1, "Detail"
Print #1, "N"
Print #1, "N"
Print #1, "~PageSetup"
Print #1, "1"
Print #1, "256"
Print #1, "10"
Print #1, "50"
Print #1, "50"
Print #1, "2"
Print #1, "Y"
Print #1, "Y"
Print #1, "Y"
Print #1, ""
Print #1, "~PageSetupExtended"
Print #1, "1"
Print #1, "Y"
Print #1, "~End"
Close #1
'''PRJ
Open p & "\CD1291.prj" For Output As #1
Print #1, "MFWPRJ01"
Print #1, "[RefreshDDR]"
Print #1, "[InputFile]"
Print #1, p & "\CD1291.RPT"
Print #1, "[ModelFile]"
Print #1, p & "\CD1291.mod"
Print #1, "[ViewTable]"
Print #1, "[SummaryNoChart]"
Print #1, "[Author]"
Print #1, "[Description]"
Print #1, "[ASCII]"
Print #1, "[End]"
Close #1
''' BAT
Open p & "\CD1291.bat" For Output As #1
Print #1, "@.echo off"
Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
Print #1, "del " & p & "\CD1291.TMP"
Close #1
'''Execute
Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl /E")
Pause (30)
Loop
Do Until Dir(p & "\CD1291.TMP") = ""
DoEvents
Loop
Pause (5)
If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyzer.exe " & p & "\CD1291.prj " & p & "\CD1291.ASC")
Pause (5)
L1 = 1
Do Until L1 = L2
Open p & "\CD1291.ASC" For Random As #1
L1 = LOF(1)
Close #1
Pause (5)
Open p & "\CD1291.ASC" For Random As #1
L2 = LOF(1)
Close #1
Loop
Pause (5)
If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
End Function
You are going to have some very hard work cut out for you here. There is no
application class in VBScripting. There is no DIR() function. There is no
Kill function. You may want to transfer code to VB.net and then have DTS run
an application.
Andrew C. Madsen
Information Architect
Harley-Davidson Motor Company
"clutch" <clutch@.discussions.microsoft.com> wrote in message
news:974122A0-6D23-4C82-BA82-2FCBAF8D2716@.microsoft.com...
> I have a script that is run in Excel or Access that automatically runs the
code I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
> Thank you in advance for your help,
> clutch
> Attribute VB_Name = "CD-1291"
> Option Compare Database
> Option Explicit
> Public Function CD1291()
> On Error GoTo CD1291_Err
> Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d
As String, L1, L2, sd As Date
>
> d = Application.CurrentProject.Path
> If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
> If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
> If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
> If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
> If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
> If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
> Y = Year(Now() - 1)
> M1 = Month(Now() - 1)
> If M1 < 10 Then
> M1 = "0" & M1
> End If
> M2 = Month(Now() - 1)
> If M2 < 10 Then
> M2 = "0" & M2
> End If
> D1 = Day(Now() - 1)
> If D1 < 10 Then
> D1 = "0" & D1
> End If
> D2 = Day(Now() - 1)
> If D2 < 10 Then
> D2 = "0" & D2
> End If
> 'MsgBox Y & "-" & M1 & "-" & D1
> p = Application.CurrentProject.Path
> ''' MSL
> Open p & "\CD1291.msl" For Output As #1
> Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID
'" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 &
"0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
> Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
> Print #1, "CLOSE"
> Print #1, "RUN '" & p & "\CD1291.bat'"
> Print #1, "EXIT"
> Close #1
> ''' MOD
> Open p & "\CD1291.mod" For Output As #1
> Print #1, "MFWMOD12"
> Print #1, "~Description"
> Print #1, "Premier Bankcard, Inc."
> Print #1, ""
> Print #1, "~Settings"
> Print #1, "M/D/Y"
> Print #1, "50"
> Print #1, "."
> Print #1, "0"
> Print #1, "1"
> Print #1, "1"
> Print #1, ","
> Print #1, "0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "Y"
> Print #1, "~ExtendedSettings"
> Print #1, "42"
> Print #1, "N"
> Print #1, "(Null)"
> Print #1, "1"
> Print #1, "1"
> Print #1, "128128255"
> Print #1, "128,32,96"
> Print #1, "255,0,255"
> Print #1, "160,0,224"
> Print #1, "64128128"
> Print #1, "255,0,128"
> Print #1, "128128128"
> Print #1, "85,85,255"
> Print #1, "128,0,128"
> Print #1, "193,0,193"
> Print #1, "255115115"
> Print #1, "128,64,255"
> Print #1, "0,128,0"
> Print #1, "128,64,64"
> Print #1, "255,0,0"
> Print #1, "255191255"
> Print #1, "255255255"
> Print #1, "225225225"
> Print #1, "151151151"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "12"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "8"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "~TableField"
> Print #1, "Acct #"
> Print #1, "16"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "16"
> Print #1, "3"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Acct #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Pymt Date"
> Print #1, "10"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "10"
> Print #1, "4"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "5"
> Print #1, "0"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Pymt Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Payment"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "19"
> Print #1, "5"
> Print #1, "N"
> Print #1, "N"
> Print #1, "19"
> Print #1, "5"
> Print #1, "0"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Payment"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Amount"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "16"
> Print #1, "6"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "53"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Amount"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Strat ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "7"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "70"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Strat ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Line"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "8"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "80"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Line"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Actn ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "9"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "86"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Actn ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr #"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "10"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "96"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr Data"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "11"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "108"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr Data"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float %"
> Print #1, "18"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "5"
> Print #1, "12"
> Print #1, "N"
> Print #1, "N"
> Print #1, "5"
> Print #1, "5"
> Print #1, "0"
> Print #1, "119"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float %"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Q Prio"
> Print #1, "2"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "2"
> Print #1, "13"
> Print #1, "N"
> Print #1, "N"
> Print #1, "2"
> Print #1, "5"
> Print #1, "2"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Q Prio"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "3"
> Print #1, "14"
> Print #1, "N"
> Print #1, "N"
> Print #1, "3"
> Print #1, "5"
> Print #1, "2"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Rpt"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "7"
> Print #1, "1"
> Print #1, "N"
> Print #1, "N"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Rpt"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Date"
> Print #1, "8"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "D"
> Print #1, "0"
> Print #1, "12"
> Print #1, "2"
> Print #1, "N"
> Print #1, "N"
> Print #1, "14"
> Print #1, "0"
> Print #1, "0"
> Print #1, "107"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "1"
> Print #1, "1"
> Print #1, "~Level"
> Print #1, "0"
> Print #1, ""
> Print #1, "1"
> Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
> Print #1, "2"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "0"
> Print #1, "2"
> Print #1, "Page Header"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~Level"
> Print #1, "5"
> Print #1, ""
> Print #1, "3"
> Print #1, "5149860001000015 2004/01/09 5.00
5.00 0002 0009 0001 0000 0000 100
"
> Print #1, " QUEUE PRIO FLOAT CYCL
"
> Print #1, " 00 011
"
> Print #1, "12"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "5"
> Print #1, "2"
> Print #1, "Detail"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~PageSetup"
> Print #1, "1"
> Print #1, "256"
> Print #1, "10"
> Print #1, "50"
> Print #1, "50"
> Print #1, "2"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, ""
> Print #1, "~PageSetupExtended"
> Print #1, "1"
> Print #1, "Y"
> Print #1, "~End"
> Close #1
>
> '''PRJ
> Open p & "\CD1291.prj" For Output As #1
> Print #1, "MFWPRJ01"
> Print #1, "[RefreshDDR]"
> Print #1, "[InputFile]"
> Print #1, p & "\CD1291.RPT"
> Print #1, "[ModelFile]"
> Print #1, p & "\CD1291.mod"
> Print #1, "[ViewTable]"
> Print #1, "[SummaryNoChart]"
> Print #1, "[Author]"
> Print #1, "[Description]"
> Print #1, "[ASCII]"
> Print #1, "[End]"
> Close #1
>
> ''' BAT
> Open p & "\CD1291.bat" For Output As #1
> Print #1, "@.echo off"
> Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
> Print #1, "del " & p & "\CD1291.TMP"
> Close #1
> '''Execute
> Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
> Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl
/E")
> Pause (30)
> Loop
> Do Until Dir(p & "\CD1291.TMP") = ""
> DoEvents
> Loop
> Pause (5)
> If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
> Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyzer.exe " & p &
"\CD1291.prj " & p & "\CD1291.ASC")
> Pause (5)
> L1 = 1
> Do Until L1 = L2
> Open p & "\CD1291.ASC" For Random As #1
> L1 = LOF(1)
> Close #1
> Pause (5)
> Open p & "\CD1291.ASC" For Random As #1
> L2 = LOF(1)
> Close #1
> Loop
> Pause (5)
>
> If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
> If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
> If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
> If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
> If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
> If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
>
> End Function
>
>

ActiveX Script Task - Help!

I have a script that is run in Excel or Access that automatically runs the c
ode I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
Thank you in advance for your help,
clutch
Attribute VB_Name = "CD-1291"
Option Compare Database
Option Explicit
Public Function CD1291()
On Error GoTo CD1291_Err
Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d A
s String, L1, L2, sd As Date
d = Application.CurrentProject.Path
If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
Y = Year(Now() - 1)
M1 = Month(Now() - 1)
If M1 < 10 Then
M1 = "0" & M1
End If
M2 = Month(Now() - 1)
If M2 < 10 Then
M2 = "0" & M2
End If
D1 = Day(Now() - 1)
If D1 < 10 Then
D1 = "0" & D1
End If
D2 = Day(Now() - 1)
If D2 < 10 Then
D2 = "0" & D2
End If
'MsgBox Y & "-" & M1 & "-" & D1
p = Application.CurrentProject.Path
''' MSL
Open p & "\CD1291.msl" For Output As #1
Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID '" & Y
& M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 & "0" &
Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
Print #1, "CLOSE"
Print #1, "RUN '" & p & "\CD1291.bat'"
Print #1, "EXIT"
Close #1
''' MOD
Open p & "\CD1291.mod" For Output As #1
Print #1, "MFWMOD12"
Print #1, "~Description"
Print #1, "Premier Bankcard, Inc."
Print #1, ""
Print #1, "~Settings"
Print #1, "M/D/Y"
Print #1, "50"
Print #1, "."
Print #1, "0"
Print #1, "1"
Print #1, "1"
Print #1, ","
Print #1, "0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "Y"
Print #1, "~ExtendedSettings"
Print #1, "42"
Print #1, "N"
Print #1, "(Null)"
Print #1, "1"
Print #1, "1"
Print #1, "128128255"
Print #1, "128,32,96"
Print #1, "255,0,255"
Print #1, "160,0,224"
Print #1, "64128128"
Print #1, "255,0,128"
Print #1, "128128128"
Print #1, "85,85,255"
Print #1, "128,0,128"
Print #1, "193,0,193"
Print #1, "255115115"
Print #1, "128,64,255"
Print #1, "0,128,0"
Print #1, "128,64,64"
Print #1, "255,0,0"
Print #1, "255191255"
Print #1, "255255255"
Print #1, "225225225"
Print #1, "151151151"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "12"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "N"
Print #1, "N"
Print #1, "8"
Print #1, "Verdana"
Print #1, "0,0,0"
Print #1, "N"
Print #1, "~TableField"
Print #1, "Acct #"
Print #1, "16"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "16"
Print #1, "3"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Acct #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Pymt Date"
Print #1, "10"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "10"
Print #1, "4"
Print #1, "N"
Print #1, "N"
Print #1, "10"
Print #1, "5"
Print #1, "0"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Pymt Date"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Payment"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "19"
Print #1, "5"
Print #1, "N"
Print #1, "N"
Print #1, "19"
Print #1, "5"
Print #1, "0"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Payment"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Amount"
Print #1, "18"
Print #1, "2"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "16"
Print #1, "6"
Print #1, "N"
Print #1, "N"
Print #1, "16"
Print #1, "5"
Print #1, "0"
Print #1, "53"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Amount"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Strat ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "7"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "70"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Strat ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Line"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "8"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "80"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Line"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Actn ID"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "9"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "86"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Actn ID"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr #"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "10"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "96"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr #"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Ltr Data"
Print #1, "4"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "4"
Print #1, "11"
Print #1, "N"
Print #1, "N"
Print #1, "4"
Print #1, "5"
Print #1, "0"
Print #1, "108"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Ltr Data"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float %"
Print #1, "18"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "N"
Print #1, "0"
Print #1, "5"
Print #1, "12"
Print #1, "N"
Print #1, "N"
Print #1, "5"
Print #1, "5"
Print #1, "0"
Print #1, "119"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float %"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Q Prio"
Print #1, "2"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "2"
Print #1, "13"
Print #1, "N"
Print #1, "N"
Print #1, "2"
Print #1, "5"
Print #1, "2"
Print #1, "18"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Q Prio"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "3"
Print #1, "14"
Print #1, "N"
Print #1, "N"
Print #1, "3"
Print #1, "5"
Print #1, "2"
Print #1, "30"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Float Cycle"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Rpt"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "C"
Print #1, "0"
Print #1, "7"
Print #1, "1"
Print #1, "N"
Print #1, "N"
Print #1, "7"
Print #1, "0"
Print #1, "0"
Print #1, "0"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Rpt"
Print #1, "3"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~TableField"
Print #1, "Date"
Print #1, "8"
Print #1, "0"
Print #1, "0"
Print #1, "1"
Print #1, "D"
Print #1, "0"
Print #1, "12"
Print #1, "2"
Print #1, "N"
Print #1, "N"
Print #1, "14"
Print #1, "0"
Print #1, "0"
Print #1, "107"
Print #1, "N"
Print #1, "~TableFieldExtended"
Print #1, "Date"
Print #1, "3"
Print #1, "N"
Print #1, "1"
Print #1, "1"
Print #1, "~Level"
Print #1, "0"
Print #1, ""
Print #1, "1"
Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
Print #1, "2"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "0"
Print #1, "2"
Print #1, "Page Header"
Print #1, "N"
Print #1, "N"
Print #1, "~Level"
Print #1, "5"
Print #1, "???????????"
Print #1, "3"
Print #1, "5149860001000015 2004/01/09 5.00 5
.00 0002 0009 0001 0000 0000 100
"
Print #1, " QUEUE PRIO FLOAT CYCL
"
Print #1, " 00 011
"
Print #1, "12"
Print #1, "0"
Print #1, "N"
Print #1, "0"
Print #1, "0"
Print #1, "~LevelExtended"
Print #1, "5"
Print #1, "2"
Print #1, "Detail"
Print #1, "N"
Print #1, "N"
Print #1, "~PageSetup"
Print #1, "1"
Print #1, "256"
Print #1, "10"
Print #1, "50"
Print #1, "50"
Print #1, "2"
Print #1, "Y"
Print #1, "Y"
Print #1, "Y"
Print #1, ""
Print #1, "~PageSetupExtended"
Print #1, "1"
Print #1, "Y"
Print #1, "~End"
Close #1
'''PRJ
Open p & "\CD1291.prj" For Output As #1
Print #1, "MFWPRJ01"
Print #1, "[RefreshDDR]"
Print #1, "[InputFile]"
Print #1, p & "\CD1291.RPT"
Print #1, "[ModelFile]"
Print #1, p & "\CD1291.mod"
Print #1, "[ViewTable]"
Print #1, "[SummaryNoChart]"
Print #1, "[Author]"
Print #1, "[Description]"
Print #1, "[ASCII]"
Print #1, "[End]"
Close #1
''' BAT
Open p & "\CD1291.bat" For Output As #1
Print #1, "@.echo off"
Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
Print #1, "del " & p & "\CD1291.TMP"
Close #1
'''Execute
Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl /E")
Pause (30)
Loop
Do Until Dir(p & "\CD1291.TMP") = ""
DoEvents
Loop
Pause (5)
If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyz
er.exe " & p & "\
CD1291.prj " & p & "\CD1291.ASC")
Pause (5)
L1 = 1
Do Until L1 = L2
Open p & "\CD1291.ASC" For Random As #1
L1 = LOF(1)
Close #1
Pause (5)
Open p & "\CD1291.ASC" For Random As #1
L2 = LOF(1)
Close #1
Loop
Pause (5)
If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
End FunctionYou are going to have some very hard work cut out for you here. There is no
application class in VBScripting. There is no DIR() function. There is no
Kill function. You may want to transfer code to VB.net and then have DTS run
an application.
Andrew C. Madsen
Information Architect
Harley-Davidson Motor Company
"clutch" <clutch@.discussions.microsoft.com> wrote in message
news:974122A0-6D23-4C82-BA82-2FCBAF8D2716@.microsoft.com...
> I have a script that is run in Excel or Access that automatically runs the
code I have cut/pasted below. I attempted to cut/paste into an activeX task,
but doesn't work. Would anyone be able to convert this to vbscript?
> Thank you in advance for your help,
> clutch
> Attribute VB_Name = "CD-1291"
> Option Compare Database
> Option Explicit
> Public Function CD1291()
> On Error GoTo CD1291_Err
> Dim Y As String, M1 As String, M2 As String, D1 As String, D2 As String, d
As String, L1, L2, sd As Date
>
> d = Application.CurrentProject.Path
> If Dir(d & "\CD1291.msl") <> "" Then Kill (d & "\CD1291.msl")
> If Dir(d & "\CD1291.bat") <> "" Then Kill (d & "\CD1291.bat")
> If Dir(d & "\CD1291.mod") <> "" Then Kill (d & "\CD1291.mod")
> If Dir(d & "\CD1291.prj") <> "" Then Kill (d & "\CD1291.prj")
> If Dir(d & "\CD1291.RPT") <> "" Then Kill (d & "\CD1291.RPT")
> If Dir(d & "\CD1291.TMP") <> "" Then Kill (d & "\CD1291.TMP")
> Y = Year(Now() - 1)
> M1 = Month(Now() - 1)
> If M1 < 10 Then
> M1 = "0" & M1
> End If
> M2 = Month(Now() - 1)
> If M2 < 10 Then
> M2 = "0" & M2
> End If
> D1 = Day(Now() - 1)
> If D1 < 10 Then
> D1 = "0" & D1
> End If
> D2 = Day(Now() - 1)
> If D2 < 10 Then
> D2 = "0" & D2
> End If
> 'MsgBox Y & "-" & M1 & "-" & D1
> p = Application.CurrentProject.Path
> ''' MSL
> Open p & "\CD1291.msl" For Output As #1
> Print #1, "OPENTOPIC SERVERID 'OARS' TOPICNAME '5625' TOPICVERSIONID
'" & Y & M1 & D1 & "001001' TOPICITEM 'CD-1291 1853 SYS E=" & M2 & D2 &
"0" & Right(Y, 1) + 1 & "' REPORTID 'CD-1291' EXACTTOPICITEM"
> Print #1, "EXPORT ASCII FILE '" & p & "\CD1291.TMP' ALL GROUP ''"
> Print #1, "CLOSE"
> Print #1, "RUN '" & p & "\CD1291.bat'"
> Print #1, "EXIT"
> Close #1
> ''' MOD
> Open p & "\CD1291.mod" For Output As #1
> Print #1, "MFWMOD12"
> Print #1, "~Description"
> Print #1, "Premier Bankcard, Inc."
> Print #1, ""
> Print #1, "~Settings"
> Print #1, "M/D/Y"
> Print #1, "50"
> Print #1, "."
> Print #1, "0"
> Print #1, "1"
> Print #1, "1"
> Print #1, ","
> Print #1, "0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "Y"
> Print #1, "~ExtendedSettings"
> Print #1, "42"
> Print #1, "N"
> Print #1, "(Null)"
> Print #1, "1"
> Print #1, "1"
> Print #1, "128128255"
> Print #1, "128,32,96"
> Print #1, "255,0,255"
> Print #1, "160,0,224"
> Print #1, "64128128"
> Print #1, "255,0,128"
> Print #1, "128128128"
> Print #1, "85,85,255"
> Print #1, "128,0,128"
> Print #1, "193,0,193"
> Print #1, "255115115"
> Print #1, "128,64,255"
> Print #1, "0,128,0"
> Print #1, "128,64,64"
> Print #1, "255,0,0"
> Print #1, "255191255"
> Print #1, "255255255"
> Print #1, "225225225"
> Print #1, "151151151"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "12"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "N"
> Print #1, "N"
> Print #1, "8"
> Print #1, "Verdana"
> Print #1, "0,0,0"
> Print #1, "N"
> Print #1, "~TableField"
> Print #1, "Acct #"
> Print #1, "16"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "16"
> Print #1, "3"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Acct #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Pymt Date"
> Print #1, "10"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "10"
> Print #1, "4"
> Print #1, "N"
> Print #1, "N"
> Print #1, "10"
> Print #1, "5"
> Print #1, "0"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Pymt Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Payment"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "19"
> Print #1, "5"
> Print #1, "N"
> Print #1, "N"
> Print #1, "19"
> Print #1, "5"
> Print #1, "0"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Payment"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Amount"
> Print #1, "18"
> Print #1, "2"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "16"
> Print #1, "6"
> Print #1, "N"
> Print #1, "N"
> Print #1, "16"
> Print #1, "5"
> Print #1, "0"
> Print #1, "53"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Amount"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Strat ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "7"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "70"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Strat ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Line"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "8"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "80"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Line"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Actn ID"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "9"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "86"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Actn ID"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr #"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "10"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "96"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr #"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Ltr Data"
> Print #1, "4"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "4"
> Print #1, "11"
> Print #1, "N"
> Print #1, "N"
> Print #1, "4"
> Print #1, "5"
> Print #1, "0"
> Print #1, "108"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Ltr Data"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float %"
> Print #1, "18"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "N"
> Print #1, "0"
> Print #1, "5"
> Print #1, "12"
> Print #1, "N"
> Print #1, "N"
> Print #1, "5"
> Print #1, "5"
> Print #1, "0"
> Print #1, "119"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float %"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Q Prio"
> Print #1, "2"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "2"
> Print #1, "13"
> Print #1, "N"
> Print #1, "N"
> Print #1, "2"
> Print #1, "5"
> Print #1, "2"
> Print #1, "18"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Q Prio"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "3"
> Print #1, "14"
> Print #1, "N"
> Print #1, "N"
> Print #1, "3"
> Print #1, "5"
> Print #1, "2"
> Print #1, "30"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Float Cycle"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Rpt"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "C"
> Print #1, "0"
> Print #1, "7"
> Print #1, "1"
> Print #1, "N"
> Print #1, "N"
> Print #1, "7"
> Print #1, "0"
> Print #1, "0"
> Print #1, "0"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Rpt"
> Print #1, "3"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~TableField"
> Print #1, "Date"
> Print #1, "8"
> Print #1, "0"
> Print #1, "0"
> Print #1, "1"
> Print #1, "D"
> Print #1, "0"
> Print #1, "12"
> Print #1, "2"
> Print #1, "N"
> Print #1, "N"
> Print #1, "14"
> Print #1, "0"
> Print #1, "0"
> Print #1, "107"
> Print #1, "N"
> Print #1, "~TableFieldExtended"
> Print #1, "Date"
> Print #1, "3"
> Print #1, "N"
> Print #1, "1"
> Print #1, "1"
> Print #1, "~Level"
> Print #1, "0"
> Print #1, ""
> Print #1, "1"
> Print #1, "CD-1291 1108/ AVAILABLE FUNDS ACCOUNT DATA
FIRST PREMIER BANK -FD- 01/09/04 PAGE 1
"
> Print #1, "2"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "0"
> Print #1, "2"
> Print #1, "Page Header"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~Level"
> Print #1, "5"
> Print #1, ""
> Print #1, "3"
> Print #1, "5149860001000015 2004/01/09 5.00
5.00 0002 0009 0001 0000 0000 100
"
> Print #1, " QUEUE PRIO FLOAT CYCL
"
> Print #1, " 00 011
"
> Print #1, "12"
> Print #1, "0"
> Print #1, "N"
> Print #1, "0"
> Print #1, "0"
> Print #1, "~LevelExtended"
> Print #1, "5"
> Print #1, "2"
> Print #1, "Detail"
> Print #1, "N"
> Print #1, "N"
> Print #1, "~PageSetup"
> Print #1, "1"
> Print #1, "256"
> Print #1, "10"
> Print #1, "50"
> Print #1, "50"
> Print #1, "2"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, "Y"
> Print #1, ""
> Print #1, "~PageSetupExtended"
> Print #1, "1"
> Print #1, "Y"
> Print #1, "~End"
> Close #1
>
> '''PRJ
> Open p & "\CD1291.prj" For Output As #1
> Print #1, "MFWPRJ01"
> Print #1, "[RefreshDDR]"
> Print #1, "[InputFile]"
> Print #1, p & "\CD1291.RPT"
> Print #1, "[ModelFile]"
> Print #1, p & "\CD1291.mod"
> Print #1, "[ViewTable]"
> Print #1, "[SummaryNoChart]"
> Print #1, "[Author]"
> Print #1, "[Description]"
> Print #1, "[ASCII]"
> Print #1, "[End]"
> Close #1
>
> ''' BAT
> Open p & "\CD1291.bat" For Output As #1
> Print #1, "@.echo off"
> Print #1, "copy " & p & "\CD1291.TMP " & p & "\CD1291.RPT"
> Print #1, "del " & p & "\CD1291.TMP"
> Close #1
> '''Execute
> Do Until Dir(p & "\CD1291.TMP") <> "" Or Dir(p & "\CD1291.RPT") <> ""
> Shell ("C:\Program Files\Mobius\DDR\rdswin.exe " & p & "\CD1291.msl
/E")
> Pause (30)
> Loop
> Do Until Dir(p & "\CD1291.TMP") = ""
> DoEvents
> Loop
> Pause (5)
> If Dir("C:\CD1291.ASC") <> "" Then Kill ("C:\CD1291.ASC")
> Shell ("C:\Program Files\Mobius\DocuAnalyzer\program\analyz
er.exe " & p &
"\CD1291.prj " & p & "\CD1291.ASC")
> Pause (5)
> L1 = 1
> Do Until L1 = L2
> Open p & "\CD1291.ASC" For Random As #1
> L1 = LOF(1)
> Close #1
> Pause (5)
> Open p & "\CD1291.ASC" For Random As #1
> L2 = LOF(1)
> Close #1
> Loop
> Pause (5)
>
> If Dir(p & "\CD1291.msl") <> "" Then Kill (p & "\CD1291.msl")
> If Dir(p & "\CD1291.bat") <> "" Then Kill (p & "\CD1291.bat")
> If Dir(p & "\CD1291.mod") <> "" Then Kill (p & "\CD1291.mod")
> If Dir(p & "\CD1291.prj") <> "" Then Kill (p & "\CD1291.prj")
> If Dir(p & "\CD1291.RPT") <> "" Then Kill (p & "\CD1291.RPT")
> If Dir(p & "\CD1291.TMP") <> "" Then Kill (p & "\CD1291.TMP")
>
> End Function
>
>

Monday, March 19, 2012

Active directory linked server access!

I got a linked server to retrieve information from our Active Directory. Using a stored procedure that accesses the linked server I update a table. The procedure works!

But when I try to run it from a task, it does not work.

Does someone know, which permission has to be configured and where?

Depending on the impersonation defined on the linked server, the service account running SQL Server Agent needs to have access to the Active directory information. Normally this is done by using a domain account as the service account for SQL Server Agent.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Active Directory groups / Permissions problems

We have a large group of users that need read access to a certain report folder. We have added the active directory group to the permissions for the entire folder, and all the reports inherit the folder's permissions.

About 75% of the people in the group CAN access the reports just fine. About 25 people cannot - they get the typical"The permissions granted to user 'DOMAIN\user' are insufficient for performing this operation."

Could someone point me in the right direction for debugging this problem? Is this a bug in Microsoft, or is this a "common" configuration problem where I can look at a couple of logs and change a couple of settings?

Any tips would be greatly appreciated

Sue

HiSue,

Do you use xp system? If so, you have to use impersonation, while on IIS6
and above you can use a domain account for the AppPool.

#Understanding ASP.NET Impersonation Security - Rick Strahl's Web Log
http://west-wind.com/weblog/posts/2153.aspx

Hope this helps.

|||

Rex:

Thank you for the tip. I do use IIS6, and the Reports Server web site, installed by the Reporting Services installer, already uses Impersonation.

Itried to change my application pool identity to a network service account, and it comes back saying I can't even browse the site, due to "Service Unavailable". The event logs seem to indicate that that service account doesn't have some security policy rights on the system, but I tried adding that account to "Log on Locally", "Log on as Service" and "Log on from Network" and none of that works.

We have also discovered that the domain group account that we added for security is listed in Active Directory as a "Distribution" type group and not a "Security" type group. I don't know if this makes a difference, but I'm going to see if we have a security group for these people.

Thanks
Sue

Active Directory and Stored Procedures

I have a need to access the active directory from a stored

procedure. I am certain that CLR is the answer but I am having a

hard time finding and example and I am a true newbie to AD and CLR.

Has anyone ever attempted to do this? I would love to see an example in VB if possible.It's certainly feasible to use SQLCLR to access AD. However, depending on how you plan to use the data coming from AD, it's not necessarily the most convenient approach. Instead of connecting to AD from managed code, you might want to consider linking to your AD store from
within SQL Server (see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/joining_heterogeneous_data.asp,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/creating_and_executing_a_view.asp,
and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/creating_a_heterogeneous_join_between_sql_server_and_active_directory.asp for details). This would allow you to create joins directly to AD-sourced views, which may better suit your use of AD data from a stored procedure.|||Thank you, I had seen the first link and had started working with it.

I now have to find a way to convert the SID from a byte array so I can

store it in my application. I am only storing the SID and will

make "round trips" to the AD for all user information.

I appreciate your help.

Rick

Sunday, March 11, 2012

Active directory and RServices

Is it possible to access Active Directory and read user data who run the report.
Thx.Shouldn't need to. There is a global User!userid that you can use in your
report.
Use the expression builder and you will see it listed (plus other
potentially useful globals)
Bruce L-C
<AG>; "NLB d.d." <AGNLBdd@.discussions.microsoft.com> wrote in message
news:1DCB51E5-8D07-407C-A40A-B9A8347FE7FE@.microsoft.com...
> Is it possible to access Active Directory and read user data who run the
report.
> Thx.|||Yes i use userid, but i need to know user name and other useful information from AD. Maybe you use extrenal class to read needed data from AD.
Aleš
"Bruce Loehle-Conger" wrote:
> Shouldn't need to. There is a global User!userid that you can use in your
> report.
> Use the expression builder and you will see it listed (plus other
> potentially useful globals)
> Bruce L-C
> <AG>; "NLB d.d." <AGNLBdd@.discussions.microsoft.com> wrote in message
> news:1DCB51E5-8D07-407C-A40A-B9A8347FE7FE@.microsoft.com...
> > Is it possible to access Active Directory and read user data who run the
> report.
> >
> > Thx.
>
>|||You can create a dataset using OLE-DB provider for Microsoft Directory
Services (built into RS 2000) and query the AD as follows:
select name, mail from 'LDAP://DC=US,DC=corp,DC=xyz,DC=com' where
objectCategory='user' and department = 'Data Warehousing'
Refer to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_12_94fn.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/sql_dialect.asp
for details on LDAP SQL dialect.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
<AG>; "NLB d.d." <AGNLBdd@.discussions.microsoft.com> wrote in message
news:63F05F64-2295-4EB6-B73A-9ACA97C68221@.microsoft.com...
> Yes i use userid, but i need to know user name and other useful
information from AD. Maybe you use extrenal class to read needed data from
AD.
> Aleš
> "Bruce Loehle-Conger" wrote:
> > Shouldn't need to. There is a global User!userid that you can use in
your
> > report.
> >
> > Use the expression builder and you will see it listed (plus other
> > potentially useful globals)
> >
> > Bruce L-C
> >
> > <AG>; "NLB d.d." <AGNLBdd@.discussions.microsoft.com> wrote in message
> > news:1DCB51E5-8D07-407C-A40A-B9A8347FE7FE@.microsoft.com...
> > > Is it possible to access Active Directory and read user data who run
the
> > report.
> > >
> > > Thx.
> >
> >
> >

Active Directory access in SSIS

Does anyone have any examples of setting up a connection manager in SSIS to read information from Microsoft Active Directory? I would like to retrieve a list of users and populate them into a SQL Server table.

Thanks!
Harry

BOL has an example for a script task but it should be fairly straight forward to convert it to a script component. There is also an OLEDB driver for active directory that should be able to be used directly from the OLEDB source (although I don't know whether anyone has actually tried using it yet).

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/dtsref9/html/a88fefbb-9ea2-4a86-b836-e71315bac68e.htm

HTH,

Matt

Activating MSDE for remote Access

I'm finding that when I install MSDE, by default no protocols are enabled
for remote access. I've found that I can use the SQL Server Network Utility
to enable the TCP/IP protocol and then the MSDE instance is accessible from
remote workstations.
But how can I do this without having the SQL Server Client Tools installed?
Is there a command line or configuration option I can use?
Thanks for your help,
Joe Geretz
I think I found it. DISABLENETWORKPROTOCOLS=0.
- Joe Geretz -
"Joseph Geretz" <jgeretz@.nospam.com> wrote in message
news:uoPxQ8DYEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I'm finding that when I install MSDE, by default no protocols are enabled
> for remote access. I've found that I can use the SQL Server Network
Utility
> to enable the TCP/IP protocol and then the MSDE instance is accessible
from
> remote workstations.
> But how can I do this without having the SQL Server Client Tools
installed?
> Is there a command line or configuration option I can use?
> Thanks for your help,
> Joe Geretz
>
|||But how would I do this after the instance is already installed? I can't
rely on SQL Server Client Tools because presumably, they won't exist locally
on the MSDE box.
Thanks for your help,
- Joe Geretz -
"Joseph Geretz" <jgeretz@.nospam.com> wrote in message
news:ucsgMAEYEHA.716@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> I think I found it. DISABLENETWORKPROTOCOLS=0.
> - Joe Geretz -
> "Joseph Geretz" <jgeretz@.nospam.com> wrote in message
> news:uoPxQ8DYEHA.3300@.TK2MSFTNGP09.phx.gbl...
enabled
> Utility
> from
> installed?
>
|||Program Files\Microsoft SQL Server\80\Tools\Binn\SVRNETCN.exe
Enable tcp/ip and restart MSDE
David P. Lurie
"Joseph Geretz" <jgeretz@.nospam.com> wrote in message
news:e$2DuCEYEHA.3988@.tk2msftngp13.phx.gbl...
> But how would I do this after the instance is already installed? I can't
> rely on SQL Server Client Tools because presumably, they won't exist
locally
> on the MSDE box.
>
|||hi Joseph,
"Joseph Geretz" <jgeretz@.nospam.com> ha scritto nel messaggio
news:e$2DuCEYEHA.3988@.tk2msftngp13.phx.gbl...
> But how would I do this after the instance is already installed? I can't
> rely on SQL Server Client Tools because presumably, they won't exist
locally
> on the MSDE box.
on the box where MSDE has been installed, the Server Network Tools will be
alwayse available (as David already pointed out), and the Client Network
Tools (cliconfg.exe) too...
on all client, only the Client Network Tools will be available, installed by
MDAC...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thank David and Andrea!
I hadn't noticed that these tools are actually installed with MSDE. This is
great, exactly what I'll need.
Thanks,
- Joe Geretz -
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:2kladsF3m4fmU1@.uni-berlin.de...
> hi Joseph,
> "Joseph Geretz" <jgeretz@.nospam.com> ha scritto nel messaggio
> news:e$2DuCEYEHA.3988@.tk2msftngp13.phx.gbl...
> locally
> on the box where MSDE has been installed, the Server Network Tools will be
> alwayse available (as David already pointed out), and the Client Network
> Tools (cliconfg.exe) too...
> on all client, only the Client Network Tools will be available, installed
by
> MDAC...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>

Tuesday, March 6, 2012

Acessing SSAS

Hi,

i am developing a BI project for a client with SQL Server 2005. I am able to access the Database Engine on my client's server through Management Studio using a specific account but i can't acess Analyis Services or Integration Services because i can only connect through Windows Authentication (all options on the connect window are greyed out) and my user is not a domain user.

How can i solve this?

Best Regards,

Tiago

Are you certain that SSAS and SSIS are online and that your login has permissions.

acess I/O File

Is it possible to access a file (for example, to write in a text file)
with transact-sql?.
I've create a stored procedure and I'd like to write in a log file
some traces depends on the result of the statements executed in this
stored procedure.
ThanksHere's one method:

ALTER PROC WriteToLog
@.Message varchar(100)
AS
DECLARE @.Command varchar(255)
BEGIN TRAN
-- ensure only one process writes to the log at a time
EXEC sp_getapplock
@.Resource = 'MyLog.txt',
@.lockmode = 'Exclusive'
SET @.Command = 'ECHO ' +
@.Message +
' >>"C:\MyLog.txt"'
EXEC master..xp_cmdshell @.Command, NO_OUTPUT
EXEC sp_releaseapplock @.Resource = 'MyLog.txt'
COMMIT
GO

EXEC WriteToLog 'Test message'

--
Hope this helps.

Dan Guzman
SQL Server MVP

--------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------

"Bego?a" <bego_colomer@.yahoo.es> wrote in message
news:c04c2a85.0311180409.4631ec98@.posting.google.c om...
> Is it possible to access a file (for example, to write in a text file)
> with transact-sql?.
> I've create a stored procedure and I'd like to write in a log file
> some traces depends on the result of the statements executed in this
> stored procedure.
> Thanks

Acess and VB

Hi all,
If I have a form created on MS Access, could I copy it exactly the same form to VB form, so that users could exactly perform operations the same on Access form?
thanks again for caring
Any suggestion and comments would be Acceptable

Suggestion: Go to an MS Access forum.

Acess 2003 connection problem to SQL Server

I have a small group who uses Access 2003 to connect to SQL Server. The
users run XP pro and Access 2003. A common DSN is created on each user’s
box. They are connecting to a box with Windows 2000 Standard Svc Pack 4 &
SQL Server 2000 Standard Svc Pack 3a. They are linking to the SQL Server
tables. We are using windows authentication.
The two users are not able to access SQL Server at the same time. The error
message they are receiving is:
Microsoft Office Access
Could not execute query; could not find liked table.
[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name
‘dbo.MAIN. (#208)
Interesting though is that if the user drops the e linked table and try to
relink it the objects that appear are from the Master database.
I verified the Group the users belong to have the correct default database
set.
I am at a loss and any help or hints to get me going in the right direction
would be appreciated.
It will work better for you if you ditched the DSNs and wrote VBA/DAO
code to relink the tables. You can supply ODBC connection string
information directly when the application loads, and delete the
TableDef objects when the application closes. You supply a source
table name, and the name of the link in the FE separately. This way
you pick up any schema changes to the underlying tables, which
invalidates old links. You can get the correct connection string from
http://able-consulting.com/ADO_Conn.htm. I recommend using DAO for
this instead of ADOX because there have been problems in the past with
linked tables coming in read-only.
--Mary
On Thu, 12 Aug 2004 09:21:02 -0700, "T Man"
<TMan@.discussions.microsoft.com> wrote:

>I have a small group who uses Access 2003 to connect to SQL Server. The
>users run XP pro and Access 2003. A common DSN is created on each users
>box. They are connecting to a box with Windows 2000 Standard Svc Pack 4 &
>SQL Server 2000 Standard Svc Pack 3a. They are linking to the SQL Server
>tables. We are using windows authentication.
>The two users are not able to access SQL Server at the same time. The error
>message they are receiving is:
>Microsoft Office Access
>Could not execute query; could not find liked table.
>[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name
>dbo.MAIN. (#208)
>
>Interesting though is that if the user drops the e linked table and try to
>relink it the objects that appear are from the Master database.
>I verified the Group the users belong to have the correct default database
>set.
>I am at a loss and any help or hints to get me going in the right direction
>would be appreciated.
|||Mary,
I am confused regarding the stance on the usage of DAO... In an email to
another user it appears you do not favor the use of DAO...
(At this point in time, DAO 3.6 is truly ancient...), however, in this case
it appears preferred.
Is it OK for linking, but not OK to perform updates ? Just want to know the
difference.
Thanks
"Mary Chipman" <mchip@.online.microsoft.com> wrote in message
news:s0oph0tv4tkue147148v4qccketajvdetj@.4ax.com... [vbcol=seagreen]
> It will work better for you if you ditched the DSNs and wrote VBA/DAO
> code to relink the tables. You can supply ODBC connection string
> information directly when the application loads, and delete the
> TableDef objects when the application closes. You supply a source
> table name, and the name of the link in the FE separately. This way
> you pick up any schema changes to the underlying tables, which
> invalidates old links. You can get the correct connection string from
> http://able-consulting.com/ADO_Conn.htm. I recommend using DAO for
> this instead of ADOX because there have been problems in the past with
> linked tables coming in read-only.
> --Mary
> On Thu, 12 Aug 2004 09:21:02 -0700, "T Man"
> <TMan@.discussions.microsoft.com> wrote:
&[vbcol=seagreen]
error[vbcol=seagreen]
to[vbcol=seagreen]
database[vbcol=seagreen]
direction
>

Saturday, February 25, 2012

Account to access SQL

What is the best way of accessing a sql server on a live server? shall I use Integrated windows or use a special user account? If I use a user account, what are the needed priviledges to give it?

thank you

Well, the real answers to those questions are: "It depends." Froma practical standpoint, choosing Windows authentication vs. SQLauthentication is going to come down to what your needs are and what'sgoing to provide the smallest attack surface whilst meeting thoseneeds.
The needed privileges are also going to vary from application toapplication. Personally, I shoot for not allowing anything butexecute permissions on the stored procedures that the app needs tofunction, and nothing else. That gives me a stong, well-definedAPI for the database that allows me to control (to an extent) how thedatabase is used. Again, YMMV depending on the needs of yourapplication.

Friday, February 24, 2012

Access-SQL Serv Autonumber

I have an Access database that was upsized. Access F/E, S2k back. I cannot
update tables that I had to create an index for the upsize. All my queries
come back with "cannot insert null" into index field. Access calls it
Autonumber and we never have to do anything else.
I'm gusssing there is a constraint problem ? Where should I start looking.
Its a primary key field, unique, indenty=1. I thought that defined it as
Autonumber.
Help !You need to set the datatype on the SQL Server to Int. Then check the
checkbox that says 'Identity' field in the Manage indexes dialog.
"Stuart" wrote:

> I have an Access database that was upsized. Access F/E, S2k back. I cannot
> update tables that I had to create an index for the upsize. All my queries
> come back with "cannot insert null" into index field. Access calls it
> Autonumber and we never have to do anything else.
> I'm gusssing there is a constraint problem ? Where should I start looking.
> Its a primary key field, unique, indenty=1. I thought that defined it as
> Autonumber.
> Help !

Access-SQL Serv Autonumber

I have an Access database that was upsized. Access F/E, S2k back. I cannot
update tables that I had to create an index for the upsize. All my queries
come back with "cannot insert null" into index field. Access calls it
Autonumber and we never have to do anything else.
I'm gusssing there is a constraint problem ? Where should I start looking.
Its a primary key field, unique, indenty=1. I thought that defined it as
Autonumber.
Help !
You need to set the datatype on the SQL Server to Int. Then check the
checkbox that says 'Identity' field in the Manage indexes dialog.
"Stuart" wrote:

> I have an Access database that was upsized. Access F/E, S2k back. I cannot
> update tables that I had to create an index for the upsize. All my queries
> come back with "cannot insert null" into index field. Access calls it
> Autonumber and we never have to do anything else.
> I'm gusssing there is a constraint problem ? Where should I start looking.
> Its a primary key field, unique, indenty=1. I thought that defined it as
> Autonumber.
> Help !

access-SQL ODBC link

> Hello,
> I am using trusted windows user connection to SQL
server.
> I created an ODBC link from Access to SQL server. I am
> able to modify data in tables through SQL Enterprise
> Manager however I am not able to modify them in Access.
> What is missing?You need to create a primary key or unique index on any SQLS tables
you want to modify from Access.
--mary
On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>server.|||Why do I have to do that? And if my primary key is based
on many columns will that cuse any problem?
>--Original Message--
>You need to create a primary key or unique index on any
SQLS tables
>you want to modify from Access.
>--mary
>On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
><anonymous@.discussions.microsoft.com> wrote:
>
Access.[vbcol=seagreen]
>.
>|||Why? because it won't work if you don't. Access can't locate the row
on the server, update it, and guarantee data integrity if the table
doesn't have a PK. If your PK is based on too many columns, then you
should consider a surrogate PK. A good starting point would be
"Database Design for Mere Mortals: A Hands-On Guide to Relational
Database Design" by Mike Hernandez.
--Mary
On Sun, 18 Apr 2004 17:58:46 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Why do I have to do that? And if my primary key is based
>on many columns will that cuse any problem?
>SQLS tables
>Access.

access-SQL ODBC link

> Hello,
> I am using trusted windows user connection to SQL
server.
> I created an ODBC link from Access to SQL server. I am
> able to modify data in tables through SQL Enterprise
> Manager however I am not able to modify them in Access.
> What is missing?
You need to create a primary key or unique index on any SQLS tables
you want to modify from Access.
--mary
On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>server.
|||Why do I have to do that? And if my primary key is based
on many columns will that cuse any problem?
>--Original Message--
>You need to create a primary key or unique index on any
SQLS tables[vbcol=seagreen]
>you want to modify from Access.
>--mary
>On Sat, 17 Apr 2004 13:34:26 -0700, "JIM.H."
><anonymous@.discussions.microsoft.com> wrote:
Access.
>.
>
|||Why? because it won't work if you don't. Access can't locate the row
on the server, update it, and guarantee data integrity if the table
doesn't have a PK. If your PK is based on too many columns, then you
should consider a surrogate PK. A good starting point would be
"Database Design for Mere Mortals: A Hands-On Guide to Relational
Database Design" by Mike Hernandez.
--Mary
On Sun, 18 Apr 2004 17:58:46 -0700, "JIM.H."
<anonymous@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>Why do I have to do that? And if my primary key is based
>on many columns will that cuse any problem?
>SQLS tables
>Access.

Access's LAST aggregate function equivalent

Hi,
I am porting an Access application that uses the LAST
aggregate function to SQL Server 7.0. I would like to know
if there is any equivalent to the LAST function in SQL
Server 7.0. I've been looking in the documentation and I
haven't found anything. The problem I'm running into is
that I have to use a LAST-kind of function since the last
record in the group doesn't have anything else to locate
it by. It may be the MAX record, but there are cases where
it won't be. I also can't use SUM, since that last record
is already a SUM of all previous records in that group. If
anyone can help, it would be greatly appreciated.
Thanks in advance,
StephanHello Stephan !
Just post your TSQL code so we can post you how you could avoid using LAST.
(Also DDl, sample data and estimated query result would be helpful)
Jens Süßmeyer.
"Stephan Desmoulin" <sdesmoulin@.huimfg.com> schrieb im Newsbeitrag
news:029f01c37952$cc57a140$a101280a@.phx.gbl...
> Hi,
> I am porting an Access application that uses the LAST
> aggregate function to SQL Server 7.0. I would like to know
> if there is any equivalent to the LAST function in SQL
> Server 7.0. I've been looking in the documentation and I
> haven't found anything. The problem I'm running into is
> that I have to use a LAST-kind of function since the last
> record in the group doesn't have anything else to locate
> it by. It may be the MAX record, but there are cases where
> it won't be. I also can't use SUM, since that last record
> is already a SUM of all previous records in that group. If
> anyone can help, it would be greatly appreciated.
> Thanks in advance,
> Stephan|||Unfortunately, I can't post expected results since the
data I'm running off of in SQL Server is several months
older than the data in Access. The SQL statement looks
like this:
SET DATEFIRST 6
SELECT fldBHSCustID, MAX(fldBHSRunDate), LAST
(fldBHSExtPrice)
FROM tblBklgHistSum
GROUP BY fldBHSCustID, DATEADD(d, 7 - DATEPART(dw,
fldBHSRunDate), fldBHSRunDate)
ORDER BY fldBHSCustID
The calculation with the dates is used to group the
results in one-week chunks with the week end date always
being a Friday. Note that the LAST function isn't actually
there in my query, it's what I would like to use.
The data kind of looks like this:
CustID RunDate ExtPrice
-- -- --
1 9/9/2003 123
1 9/10/2003 123
1 9/11/2003 123
1 9/12/2003 123
2 9/11/2003 450
2 9/12/2003 423
3 9/10/2003 12
3 9/11/2003 45
3 9/11/2003 64
3 9/12/2003 78
The trouble as this sample data shows, is that the
ExtPrice field is fairly random and I only want to use the
very last value entered.
Thanks for the help,
Stephan
>--Original Message--
>Hi,
>I am porting an Access application that uses the LAST
>aggregate function to SQL Server 7.0. I would like to
know
>if there is any equivalent to the LAST function in SQL
>Server 7.0. I've been looking in the documentation and I
>haven't found anything. The problem I'm running into is
>that I have to use a LAST-kind of function since the last
>record in the group doesn't have anything else to locate
>it by. It may be the MAX record, but there are cases
where
>it won't be. I also can't use SUM, since that last record
>is already a SUM of all previous records in that group.
If
>anyone can help, it would be greatly appreciated.
>Thanks in advance,
>Stephan
>.
>|||This is a nice example of one of the problems with the "LAST aggregate". You
didn't tell us the primary key but it would appear that there can be more
than one "last" extprice (because your table allows more than one price on
the same Rundate). If that is the case which price do you choose? The
following query gives the MAX, LAST extprice.
Tip: You can use the DATEDIFF function as shown to avoid any dependency on
the DATEFIRST setting.
Another tip: Get rid of those horrid "tbl" and "fld" prefixes. SQL has
columns not fields. And we know it's a column because it's in a table!
CREATE TABLE tblBklgHistSum (custid INTEGER, rundate DATETIME, extprice
INTEGER, PRIMARY KEY (custid, rundate, extprice))
INSERT INTO tblBklgHistSum VALUES (1, '20030909', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030910', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030911', 123)
INSERT INTO tblBklgHistSum VALUES (1, '20030912', 123)
INSERT INTO tblBklgHistSum VALUES (2, '20030911', 450)
INSERT INTO tblBklgHistSum VALUES (2, '20030912', 423)
INSERT INTO tblBklgHistSum VALUES (3, '20030910', 12)
INSERT INTO tblBklgHistSum VALUES (3, '20030911', 45)
INSERT INTO tblBklgHistSum VALUES (3, '20030911', 64)
INSERT INTO tblBklgHistSum VALUES (3, '20030912', 78)
SELECT T.custid, T.rundate,
MAX(T.extprice) AS extprice
FROM tblBklgHistSum AS T
JOIN
(SELECT custid,
MAX(rundate) AS rundate
FROM tblBklgHistSum
GROUP BY custid,
FLOOR(DATEDIFF(DAY,'20000101',rundate)/7)) AS M
ON T.custid = M.custid AND T.rundate = M.rundate
GROUP BY T.custid, T.rundate
--
David Portas
--
Please reply only to the newsgroup
--

Access-like Automation in SQL Server 2005?

I'm a newbie to SQL Server, trying to make the leap from Access because I'm starting out grow it for my needs. I have a lot of automation stuff in Access where it does a query/code driven process for us via a macro. Sometimes the output is a report, or a form with assembled data that we use. I'm wondering if SQL Server 2005 is capable of doing automation of processes like these as well. Even if it's not necessarily a macro, something I can program, compile and have use off of my SQL Server database to do the tasks that the Access macro did.This is one of those sticky kinds of questions...

SQL Server has lots of tools/toys. You can automate all of them, with varying degrees of effort. It depends on what tools you are using, and what results you want to achieve.

You can actually use SQL Server in place of Jet and continue using Microsoft Access. Jet is the default database engine provided with Microsoft Access, but the Microsoft Access GUI can actually use any ODBC database engine.

Micrsoft Access presents a "one stop shop" with environment, data engine, etc all in one package. Microsoft SQL Server provides more powerful data storage/management/manipulation tools, but little or nothing in the way of "front end" tools. SQL Server is much better for the "heavy lifting" of your data, but it really doesn't provide anything in the way of a user interface.

-PatP

Accessing WMI using sp_OACreate

Does nayone have any insight into how to access WMI using sp_OACreate?You might want to look at Dan's reply to your original post.
Andrew J. Kelly SQL MVP
"John Barr" <JohnBarr@.discussions.microsoft.com> wrote in message
news:72B28D56-DB4D-451E-921C-E0F8FF1144BA@.microsoft.com...
> Does nayone have any insight into how to access WMI using sp_OACreate?