Domino 9 und frühere Versionen > ND6: Entwicklung

SQL Abfrage in LS

<< < (2/2)

koehlerbv:
Jo, da habe ich auch zu schnell geschrieben - hier die korrigierte Fassung:

defaultQuery = "SELECT DocID FROM ForeCast WHERE DocID='" & strID & "'"

Bernhard

chris2212:
 :D :D  Danke  :D :D

Jetzt geht´s

Hier der Source (falls jemand ein ähnliche "Problem"" hat)

*******************************************************
Dim session As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
   
Set db = session.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
   
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
   
Dim strID As String
   
con.ConnectTo("ForeCast")
Set qry.Connection = con
Set result.Query = qry
   
While Not(doc Is Nothing)
   strID = doc.UniversalID
   qry.SQL = "SELECT DocID FROM ForeCast WHERE DocID='" & strID & "'"
   result.Execute
   If result.IsResultSetAvailable Then
             Msgbox strID & " exists in ForeCast"
   Else
        Msgbox strID & " does not exist in ForeCast"
   End If
        Set doc = col.GetNextDocument(doc)
   Wend
result.Close(DB_CLOSE)
con.Disconnect
*******************************************************

Danke für die schnelle Hilfe !

Gruß
Christian

Hernan Cortez:
In LotusScript finde ich bei krud koncetanierten (oder wie das heisst) Gänsefüsschen das Pipe Zeichen als String-delimiter(?) immer am übersichtlichtesten:


--- Code: ---defaultQuery = |SELECT DocID FROM ForeCast WHERE DocID="| & strID & |"|

--- Ende Code ---

sollte auch gehen.

Navigation

[0] Themen-Index

[*] Vorherige Sete

Zur normalen Ansicht wechseln