Note that there are some explanatory texts on larger screens.

plurals
  1. POCall a sub using a string-variable
    primarykey
    data
    text
    <p>I have a SQL-database in which I list conditions that mails have to meet.</p> <p>For every mail that I receive the database is searched, and if the conditions of one of the records are fulfilled, another Sub shall be called for the Mail. Which Sub is to be executed is defined in the database as well.</p> <p>Everything works fine, but I am not able to call the Sub. </p> <pre><code>Sub automatik_sql() 'VERWEIS auf ActiveX Data Objects 6.1 Library notwendig' Dim olApp As Outlook.Application Dim olitem As Outlook.MailItem Set olApp = Outlook.Application Set olitem = Application.ActiveInspector.CurrentItem Dim con As ADODB.connection Dim rec As ADODB.recordset Dim MySQL As String Dim ausloeser As Boolean ausloeser = True MySQL = "SELECT MA_Index, beding_body, beding_subj, aktion FROM Mail_Automatik where (empfaenger = '" &amp; olitem.To &amp; "' and absender ='" &amp; olitem.SenderEmailAddress &amp; "')" Set con = New ADODB.connection con.Open "Provider=sqloledb; Data Source=meinedaten; Initial Catalog=STAMMDATEN; INTEGRATED SECURITY=sspi;" Set rec = con.Execute(MySQL) While Not rec.EOF If Not IsNull(rec.Fields("beding_body").Value) Then If InStr(olitem.Body, rec.Fields("beding_body").Value) = 0 Then ausloeser = False End If If Not IsNull(rec.Fields("beding_subj").Value) Then If InStr(olitem.Subject, rec.Fields("beding_subj").Value) = 0 Then ausloeser = False End If </code></pre> <p>and now i have the Problem:</p> <pre><code>If ausloeser = True Then Call rec.Fields("aktion") rec.movenext Wend End Sub </code></pre> <p>As I am working on a german-language machine I only have the error (poping up at the start of the Sub) in german: </p> <blockquote> <p>Fehler beim kompilieren: Unzulässige Verwendung einer Eigenschaft Translation: "failed to compile: illegal use of a property "</p> </blockquote> <p>Anyone have any idea?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload