what exactly are you looking to achieve? It looks like you would like an event to be triggered on some data being added to the database. Is this correct? If you can provide more information about what you are trying to do I am sure we can suggest alternative ways of doing this.
What I want to do is call a dll. The script is basally I need to call this script
Dim TCAPI, Session, TaskItem
Set TCAPI = CreateObject("Iwcltcp.TCAPI")
Set Session = TCAPI.Logon(logon, "localhost", "username", "password")
Set TaskItem = Session.OpenTaskItem(13)
The dll will be local on a windows server. I dont mind running the script in the trigger or calling a vbs file.
If this cannot be done then I can pick up an email as long as I can passed column information from the trigger (column id or order id)
Off the top of my head I can see two potential solutions here:
1. A batch process that runs every minute that identifies the new entries and sends out the emails.
2. The insert statement is being executed by some process into the table. If this is in VB then have this process send out the email.
As I said previously it is not possible to execute VB code inside a trigger so alternatives is all we can go with. I have used both above on other projects and these appear to work fine.
A batch process is something that is scheduled to run every x minutes. The process itself is quite simple i.e. find all the records that have been added since the last check and then process each of these one by one. The process will be responsible for connecting to the database and to query the database for these records. If you have a timestamp on the records added then you can use this to determine the records that have been inserted. Otherwise you could create a second table which will contain the primary key columns of your main table. An insert trigger can be created that will simply add the record to the secondary table.
The other alternative, you would need to investigate what process is inserting the information into the database and in particular into this table. The next line after the insert you could add your lines of VB code to send out the email.
thanks for your help. i have resovled my problem. i wanted to stay away from rechecking the database every few mins.
what i have have done is added if statements to my insert php pages. so when the right data matches the php pages then sends an email with the information need in teh subject. i am then pick up that email and do what i need to do.
i think this is a better way because this does not matter there the DB is (will work outside teh domain or on a non windows server.)
I agree with your choice here. Selecting the contents of a database periodically is a drain on resources. Handling the process where the VB code is adding the record into the database minimizes using the resources on your server.