Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
prince123
Starting Member
5 Posts |
Posted - 2005-09-14 : 13:25:42
|
Hi, following is the description of scenario and problem encountered.Scenario:=========I just upsized my Access 2000 application to Access ADP. I am calling a function to create runtime query. Everything works fine. When I call DoCmd.OpenStoredProcedure I get Error: 7874.But if I go to Debug Mode and then to queries list on Project Window and press <F5> (Refresh) Button. Query name appears on the list. On debugger if play the code again. Everything works fine.Problem:========I want to refresh list of queries through code. How can I do that?Function listing is given below:Public Function CreateQuery(sQryName As String)Dim sSql As StringsSql = "SELECT TblAddress.FirmName, TblAddressDetail.Adressering, TblAddress.SirName, TblAddress.FirstName, TblAddress.MiddleName, TblAddress.Street, TblAddress.HouseNo, TblAddress.HouseArea, TblAddress.Postcode, TblAddress.City, TblLand.Country" & _ " FROM ((((TblMailMerger INNER JOIN TblContacts ON TblMailMerger.ContactID = TblContacts.ContactId) INNER JOIN TblAddress ON TblMailMerger.Category = TblAddress.ClientType) INNER JOIN TblAddressDetail ON (TblAddress.Title = TblAddressDetail.TitleCode) AND (TblAddress.TelId = TblAddressDetail.TelId)) INNER JOIN TblCountry ON TblAddress.CountryID = TblCountry.CountryId) INNER JOIN TblTypeBriefDetail ON (TblTypeBriefDetail.TelId = TblAddress.TelId) AND (TblMailMerger.BriefId = TblTypeBriefDetail.BriefId)" & _ " WHERE (((TblMailMerger.Status)=0))"sSql = "create Procedure " & sQryName & " as " & sSql & " RETURN"CurrentProject.Connection.Execute (sSql)DoCmd.OpenStoredProcedure sQryName, acViewDesignEnd FunctionAny help in this regard, will be highly appreciated. Thank you! |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-09-15 : 19:56:28
|
Please do not cross post:http://www.sqlteam.com/forums/topic.asp?topic_id=55224 |
 |
|
|
|
|
|
|