Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a dll from a DTS ActiveX Script

Status
Not open for further replies.

datras

Programmer
Jun 6, 2001
28
0
0
DK
Hi Out There
I have tried to call a dll from a DTS ActiveX Script without any success. I have not been able to find an example on how to do it so this is my pure guess – and it is not good enough. Could anybody enlighten me please?

DATRAS:)

The error is: Class not defined: fitALK

' Visual Basic ActiveX Script
Function Main()
Dim con
Dim ALKdll
Dim test


set con = CreateObject("ADODB.Connection")
Con.Open = "Provider=SQLOLEDB.1;Integrated Security=SSPI; " _
& " Persist Security Info=False;Initial Catalog=DATRAS;Data Source=OWL"


Set ALKdll = New fitALK.clsfitALK

test = ALKdll.fitALK(con)


Main = DTSTaskExecResult_Success

End Function
 
Try something like this . . .

Dim DllToLoad

Set DllToLoad = CreateObject("DllName.clsDllCls")
Call DllToLoad.DllFunction(Parameter)
Set DllToLoad = Nothing

"All I ask is the chance to prove that money can't make me happy." - Spike Milligan
 
Hi tb
Thanks for your reply. As you can see I never programmed in VBscript before. I have tried your suggestion however, I get the error message; Type mismatch: 'ALKdll.ALK'. I can't see what I do wrong. The dll I call is a function returning a boolean.... and it works in VB.

Could you help me once more...%-)





Function Main()
Dim con
Dim ALKdll

set con = CreateObject("ADODB.Connection")
Con.Open ("Provider=SQLOLEDB.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=DATRAS;Data Source=OWL")

Set ALKdll = CreateObject("fitALK.clsfitALK")

call ALKdll.ALK(Con)

Set ALKdll = Nothing


Main = DTSTaskExecResult_Success

End Function
 
Try something like this for the connection . . .

Set conn = CreateObject("ADODB.Connection")
conn.provider="sqloledb"
conn.CommandTimeout = 0
conn.ConnectionTimeout = 240

'Connect to server and set Database
conn.open "IP Address", "Login Name", "Login Password"
conn.DefaultDatabase = "Database to use"


[flowerface]

"All I ask is the chance to prove that money can't make me happy." - Spike Milligan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top