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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS activeX script help

Status
Not open for further replies.

balistikb

Technical User
Nov 12, 2002
177
US
I have an activeX script in a DTS that runs a query in Access 2000. I am having a problem cause everytime I run that script I have to put in the password manually. Is there a way for me to include this in my script?

Function main()
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase("\\MRH1\Vol1\Home\DMS_IT\SkillsAssesment\SkillsAssesment.mdb")
objDB.DoCmd.Openquery "qryMakeTableforExport"
objDB.CloseCurrentDatabase
objDB.Quit
main = DTSTaskExecResult_Success
End Function
 
objDB.OpenCurrentDatabase("mydb.MDB", , "password")

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
This is what I wrote and I get an error "cannot use parentheses when calling a sub"

Function main()
Dim objDB
Set objDB = CreateObject("Access.Application")
objDB.OpenCurrentDatabase ("\\MRH1\Vol1\Home\DMS_IT\SkillsAssesment\SkillsAssesment.mdb",,"7718")
objDB.DoCmd.Openquery "qryUpdateUnmatched"
objDB.CloseCurrentDatabase
objDB.Quit
main = DTSTaskExecResult_Success
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top