G
Guest
If ReturnRecords = False The
1 record is added but DLookup fails with "Runtime Error 3323 -- The query cannot be used as a row source
I recall seeing that False is really needed for an exec passthru on Googl
ElseIf ReturnRecords = True The
2 records are added and DLookup returns the index of the 2nd record adde
Neither of these 2 records appears in the table until after the DLookup statement -- strange?
End I
CurrentDb.CreateQueryDef ("ZZZZ"
Set q = CurrentDb.QueryDefs("ZZZZ"
q.Connect = "odbc;Driver={SQL Server}; Server=" & ServerName & ";Database=" & DbName & ";uid=;pwd=
q.ReturnsRecords = Tru
q.SQL = "exec spAddResource"
ID = DLookup("ResourceKey", "ZZZZ"
SET QUOTED_IDENTIFIER OFF
G
SET ANSI_NULLS OFF
G
ALTER PROCEDURE dbo.spAddResource AS
SET NOCOUNT O
INSERT INTO tblResources (ProjectID, SourceID) VALUES (7,3)
SELECT @@IDENTITY AS "ResourceKey
G
SET QUOTED_IDENTIFIER OFF
G
SET ANSI_NULLS ON
GO
1 record is added but DLookup fails with "Runtime Error 3323 -- The query cannot be used as a row source
I recall seeing that False is really needed for an exec passthru on Googl
ElseIf ReturnRecords = True The
2 records are added and DLookup returns the index of the 2nd record adde
Neither of these 2 records appears in the table until after the DLookup statement -- strange?
End I
CurrentDb.CreateQueryDef ("ZZZZ"
Set q = CurrentDb.QueryDefs("ZZZZ"
q.Connect = "odbc;Driver={SQL Server}; Server=" & ServerName & ";Database=" & DbName & ";uid=;pwd=
q.ReturnsRecords = Tru
q.SQL = "exec spAddResource"
ID = DLookup("ResourceKey", "ZZZZ"
SET QUOTED_IDENTIFIER OFF
G
SET ANSI_NULLS OFF
G
ALTER PROCEDURE dbo.spAddResource AS
SET NOCOUNT O
INSERT INTO tblResources (ProjectID, SourceID) VALUES (7,3)
SELECT @@IDENTITY AS "ResourceKey
G
SET QUOTED_IDENTIFIER OFF
G
SET ANSI_NULLS ON
GO