From accessd at shaw.ca Tue Apr 8 00:38:40 2014 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 7 Apr 2014 23:38:40 -0600 (MDT) Subject: [dba-SQLServer] SQL joins In-Reply-To: <1395803571542.f29465dd@Nodemailer> Message-ID: <55995586.20032058.1396935520760.JavaMail.root@cds018> Hi All: I have to anyways carefully think before doing any SQL statements but with the following graphic it should be a snap. https://twitter.com/ashalynd/status/449828745495330817/photo/1/large Jim From fuller.artful at gmail.com Tue Apr 8 11:04:59 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 8 Apr 2014 12:04:59 -0400 Subject: [dba-SQLServer] SQL joins In-Reply-To: <55995586.20032058.1396935520760.JavaMail.root@cds018> References: <1395803571542.f29465dd@Nodemailer> <55995586.20032058.1396935520760.JavaMail.root@cds018> Message-ID: Only one (that I can think of) was omitted: the Range Join. I don't know offhand how to represent it graphically, but we all know what I mean: tax tables and FedEx tables are two obvious examples. On Tue, Apr 8, 2014 at 1:38 AM, Jim Lawrence wrote: > Hi All: > > I have to anyways carefully think before doing any SQL statements but with > the following graphic it should be a snap. > > https://twitter.com/ashalynd/status/449828745495330817/photo/1/large > > Jim From darryl at whittleconsulting.com.au Tue Apr 8 18:05:40 2014 From: darryl at whittleconsulting.com.au (Darryl Collins) Date: Tue, 8 Apr 2014 23:05:40 +0000 Subject: [dba-SQLServer] SQL joins In-Reply-To: <55995586.20032058.1396935520760.JavaMail.root@cds018> References: <1395803571542.f29465dd@Nodemailer> <55995586.20032058.1396935520760.JavaMail.root@cds018> Message-ID: <2342ad386faf4fc696b73b8a90d8cde2@HKXPR04MB360.apcprd04.prod.outlook.com> Yes, that is rather succinct and neat. I tend to cheat when writing SQL strings for SQL Server and just use the GUI Query Builder in Access and then copy the SQL code from there. 90% of the time is will drop right in, although there are occasionally minor syntax tweaks required. Nothing a quick trip via Notepad 'search / replace' can't fix. Amateur hour perhaps, but then again, that is closer to my SQL Server skills than 'DBA Guru' ;) Cheers Darryl. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Tuesday, 8 April 2014 3:39 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL joins Hi All: I have to anyways carefully think before doing any SQL statements but with the following graphic it should be a snap. https://twitter.com/ashalynd/status/449828745495330817/photo/1/large Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stephen at bondsoftware.co.nz Tue Apr 8 19:54:08 2014 From: stephen at bondsoftware.co.nz (Stephen Bond) Date: Wed, 09 Apr 2014 12:54:08 +1200 Subject: [dba-SQLServer] SQL joins In-Reply-To: <9C82A947767342F7B0170924E67DCA67@BondSoftware.local> References: <1395803571542.f29465dd@Nodemailer> <55995586.20032058.1396935520760.JavaMail.root@cds018> <9C82A947767342F7B0170924E67DCA67@BondSoftware.local> Message-ID: Darryl, my approach precisely. And the graphic has been printed and is on the wall. Belt and braces. Stephen Bond -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Darryl Collins Sent: Wednesday, 9 April 2014 11:15 a.m. To: Stephen Subject: Re: [dba-SQLServer] SQL joins Yes, that is rather succinct and neat. I tend to cheat when writing SQL strings for SQL Server and just use the GUI Query Builder in Access and then copy the SQL code from there. 90% of the time is will drop right in, although there are occasionally minor syntax tweaks required. Nothing a quick trip via Notepad 'search / replace' can't fix. Amateur hour perhaps, but then again, that is closer to my SQL Server skills than 'DBA Guru' ;) Cheers Darryl. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Tuesday, 8 April 2014 3:39 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL joins Hi All: I have to anyways carefully think before doing any SQL statements but with the following graphic it should be a snap. https://twitter.com/ashalynd/status/449828745495330817/photo/1/large Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From accessd at shaw.ca Wed Apr 9 00:14:19 2014 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 8 Apr 2014 23:14:19 -0600 (MDT) Subject: [dba-SQLServer] SQL joins In-Reply-To: <2342ad386faf4fc696b73b8a90d8cde2@HKXPR04MB360.apcprd04.prod.outlook.com> Message-ID: <2139566382.20851941.1397020459374.JavaMail.root@cds018> Ha ha...guilty as charged. ;-) Jim ----- Original Message ----- From: "Darryl Collins" To: "Discussion concerning MS SQL Server" Sent: Tuesday, 8 April, 2014 4:05:40 PM Subject: Re: [dba-SQLServer] SQL joins Yes, that is rather succinct and neat. I tend to cheat when writing SQL strings for SQL Server and just use the GUI Query Builder in Access and then copy the SQL code from there. 90% of the time is will drop right in, although there are occasionally minor syntax tweaks required. Nothing a quick trip via Notepad 'search / replace' can't fix. Amateur hour perhaps, but then again, that is closer to my SQL Server skills than 'DBA Guru' ;) Cheers Darryl. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Tuesday, 8 April 2014 3:39 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL joins Hi All: I have to anyways carefully think before doing any SQL statements but with the following graphic it should be a snap. https://twitter.com/ashalynd/status/449828745495330817/photo/1/large Jim _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Sun Apr 13 17:08:59 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 14 Apr 2014 10:08:59 +1200 Subject: [dba-SQLServer] Validation rules and SQL Server Message-ID: <002801cf5764$f87cfa80$e976ef80$@dalyn.co.nz> Listers, I have a 2010 database accdb file which uses DSNless connections to get recordsets for form and control sources. It have a control which is linked to tinyint field in an SQL 2008 table. I have a validation rule in the control "Is Not Null" and a Validation Text. However if I clear out the value in the field the validation rule doesn't fire. I have previously used adp's with SQL back ends and have not had this problem. Has anyone come across this before? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From fuller.artful at gmail.com Mon Apr 14 07:59:30 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 14 Apr 2014 08:59:30 -0400 Subject: [dba-SQLServer] Validation rules and SQL Server In-Reply-To: <002801cf5764$f87cfa80$e976ef80$@dalyn.co.nz> References: <002801cf5764$f87cfa80$e976ef80$@dalyn.co.nz> Message-ID: David, I haven't seen this, but my first guess would be to check whether there's a default value either on the control or in the SQL column. Failing that, maybe you could investigate further by adding a MsgBox call on the control's AfterUpdate event, and see what the value actually is after you blank the control. Arthur On Sun, Apr 13, 2014 at 6:08 PM, David Emerson wrote: > Listers, > > I have a 2010 database accdb file which uses DSNless connections to get > recordsets for form and control sources. It have a control which is linked > to tinyint field in an SQL 2008 table. I have a validation rule in the > control "Is Not Null" and a Validation Text. However if I clear out the > value in the field the validation rule doesn't fire. > > I have previously used adp's with SQL back ends and have not had this > problem. Has anyone come across this before? > > From newsgrps at dalyn.co.nz Mon Apr 14 19:03:43 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 15 Apr 2014 12:03:43 +1200 Subject: [dba-SQLServer] Adding Records to Joined Tables Message-ID: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> Listers, I am sure I have done this before but I can't work out how. I have a couple of tables (SQL 2008) that are joined. I want to be able to add records to the many side of the join. SELECT dbo.tlkpFunderServiceCodeRate.* FROM dbo.tlkpFunderServiceCodeRate INNER JOIN dbo.tlkpFunderServiceCode ON dbo.tlkpFunderServiceCodeRate.FunderServiceCodeIDNo = dbo.tlkpFunderServiceCode.FunderServiceCodeID When I create a view I am unable to add records. If I don't include the dbo.tlkpFunderServiceCode table I can enter records into the dbo.tlkpFunderServiceCodeRate table ok. The reason I want to include both tables is that I want to add a filter using a field from the dbo.tlkpFunderServiceCode table. Is this possible with the current syntax (like it is with Access tables), or do I need to include the filtering in a Where clause using an IN statement? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From newsgrps at dalyn.co.nz Mon Apr 14 19:28:48 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 15 Apr 2014 12:28:48 +1200 Subject: [dba-SQLServer] Validation rules and SQL Server In-Reply-To: References: <002801cf5764$f87cfa80$e976ef80$@dalyn.co.nz> Message-ID: <003001cf5841$ab16cb30$01446190$@dalyn.co.nz> Thanks for the guidance Arthur. The SQL table had the field set to Not Allow Nulls. Once I had cleared this the Access Form validation fired. It seems that the SQL checking fires before the Access form control checking. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Tuesday, 15 April 2014 12:59 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Validation rules and SQL Server David, I haven't seen this, but my first guess would be to check whether there's a default value either on the control or in the SQL column. Failing that, maybe you could investigate further by adding a MsgBox call on the control's AfterUpdate event, and see what the value actually is after you blank the control. Arthur On Sun, Apr 13, 2014 at 6:08 PM, David Emerson wrote: > Listers, > > I have a 2010 database accdb file which uses DSNless connections to > get recordsets for form and control sources. It have a control which > is linked to tinyint field in an SQL 2008 table. I have a validation > rule in the control "Is Not Null" and a Validation Text. However if I > clear out the value in the field the validation rule doesn't fire. > > I have previously used adp's with SQL back ends and have not had this > problem. Has anyone come across this before? > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Tue Apr 15 05:49:54 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 15 Apr 2014 06:49:54 -0400 Subject: [dba-SQLServer] Adding Records to Joined Tables In-Reply-To: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> References: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> Message-ID: David, I'm guessing that you want to do this with code rather than via a form, since the latter makes it so easy -- just your standard form+subform. Is that correct? If so, I still don't quite understand why you want to use a view. Your code will need to determine the parent PK first, then use a standard INSERT statement, passing the parent PK in, either by calling a stored procedure that accepts a parameter for the parent PK, or by building the INSERT statement in code and then executing. My preference would be the stored procedure. Please clarify why you're using a view to accomplish this. Arthur From fuller.artful at gmail.com Tue Apr 15 05:52:13 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 15 Apr 2014 06:52:13 -0400 Subject: [dba-SQLServer] Validation rules and SQL Server In-Reply-To: <003001cf5841$ab16cb30$01446190$@dalyn.co.nz> References: <002801cf5764$f87cfa80$e976ef80$@dalyn.co.nz> <003001cf5841$ab16cb30$01446190$@dalyn.co.nz> Message-ID: David, Happy to help, and glad it worked. Arthur On Mon, Apr 14, 2014 at 8:28 PM, David Emerson wrote: > Thanks for the guidance Arthur. The SQL table had the field set to Not > Allow Nulls. Once I had cleared this the Access Form validation fired. It > seems that the SQL checking fires before the Access form control checking. > > From newsgrps at dalyn.co.nz Tue Apr 15 13:51:44 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Wed, 16 Apr 2014 06:51:44 +1200 Subject: [dba-SQLServer] Adding Records to Joined Tables In-Reply-To: References: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> Message-ID: <001b01cf58db$bf45ab90$3dd102b0$@dalyn.co.nz> Arthur, In my case the form had a couple of filter fields used to filter the recordset used for the form. I didn't want a form/subform setup because the filters would have been for different main tables. Here is the solution I came up with: SELECT dbo.tlkpFunderServiceCodeRate.* FROM dbo.tlkpFunderServiceCodeRate WHERE dbo.tlkpFunderServiceCodeRate.FunderServiceCodeIDNo IN (SELECT dbo.tlkpFunderServiceCode.FunderServiceCodeID FROM dbo.tlkpFunderServiceCode WHERE (dbo.tlkpFunderServiceCode.FunderIDNo = @FunderIDNo OR @FunderIDNo = 0) AND (dbo.tlkpFunderServiceCode.FunderServiceCodeID = @FunderServiceCodeIDNo OR @FunderServiceCodeIDNo = 0)) ORDER BY dbo.tlkpFunderServiceCodeRate.FunderServCodeRateStartDate The rates link back to a code which links back to a funder. The two filters mean I could select all rates, all rates for a funder, or all rates for a code. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand Regards David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Tuesday, 15 April 2014 10:50 p.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Adding Records to Joined Tables David, I'm guessing that you want to do this with code rather than via a form, since the latter makes it so easy -- just your standard form+subform. Is that correct? If so, I still don't quite understand why you want to use a view. Your code will need to determine the parent PK first, then use a standard INSERT statement, passing the parent PK in, either by calling a stored procedure that accepts a parameter for the parent PK, or by building the INSERT statement in code and then executing. My preference would be the stored procedure. Please clarify why you're using a view to accomplish this. Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Tue Apr 15 14:53:48 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 15 Apr 2014 15:53:48 -0400 Subject: [dba-SQLServer] Adding Records to Joined Tables In-Reply-To: <001b01cf58db$bf45ab90$3dd102b0$@dalyn.co.nz> References: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> <001b01cf58db$bf45ab90$3dd102b0$@dalyn.co.nz> Message-ID: David, That appears to be an elegant solution. Since your variables use the @ prefix, I assume this code is clipped from a stored procedure, which should give you great performance despite the nested Select. Should performance become an issue, you might gain some by turning the nested Select into a table variable. But I wouldn't bother if performance is not a problem. On Tue, Apr 15, 2014 at 2:51 PM, David Emerson wrote: > Arthur, > > In my case the form had a couple of filter fields used to filter the > recordset used for the form. I didn't want a form/subform setup because > the > filters would have been for different main tables. Here is the solution I > came up with: > > SELECT dbo.tlkpFunderServiceCodeRate.* > FROM dbo.tlkpFunderServiceCodeRate > WHERE dbo.tlkpFunderServiceCodeRate.FunderServiceCodeIDNo IN > (SELECT dbo.tlkpFunderServiceCode.FunderServiceCodeID FROM > dbo.tlkpFunderServiceCode > WHERE (dbo.tlkpFunderServiceCode.FunderIDNo = @FunderIDNo > OR > @FunderIDNo = 0) AND > (dbo.tlkpFunderServiceCode.FunderServiceCodeID = > @FunderServiceCodeIDNo OR @FunderServiceCodeIDNo = 0)) > ORDER BY dbo.tlkpFunderServiceCodeRate.FunderServCodeRateStartDate > > The rates link back to a code which links back to a funder. The two > filters > mean I could select all rates, all rates for a funder, or all rates for a > code. > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand > > Regards > > David > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur > Fuller > Sent: Tuesday, 15 April 2014 10:50 p.m. > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Adding Records to Joined Tables > > David, > > I'm guessing that you want to do this with code rather than via a form, > since the latter makes it so easy -- just your standard form+subform. Is > that correct? If so, I still don't quite understand why you want to use a > view. Your code will need to determine the parent PK first, then use a > standard INSERT statement, passing the parent PK in, either by calling a > stored procedure that accepts a parameter for the parent PK, or by building > the INSERT statement in code and then executing. My preference would be the > stored procedure. > > Please clarify why you're using a view to accomplish this. > > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur From newsgrps at dalyn.co.nz Tue Apr 15 15:01:50 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Wed, 16 Apr 2014 08:01:50 +1200 Subject: [dba-SQLServer] Adding Records to Joined Tables In-Reply-To: References: <002b01cf583e$2a7e2340$7f7a69c0$@dalyn.co.nz> <001b01cf58db$bf45ab90$3dd102b0$@dalyn.co.nz> Message-ID: <001c01cf58e5$8a5d7750$9f1865f0$@dalyn.co.nz> Thanks again Arthur. Yes the code is from a stored procedure, and because the actual number of records will be relatively small there shouldn't be a problem with performance. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Wednesday, 16 April 2014 7:54 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Adding Records to Joined Tables David, That appears to be an elegant solution. Since your variables use the @ prefix, I assume this code is clipped from a stored procedure, which should give you great performance despite the nested Select. Should performance become an issue, you might gain some by turning the nested Select into a table variable. But I wouldn't bother if performance is not a problem. On Tue, Apr 15, 2014 at 2:51 PM, David Emerson wrote: > Arthur, > > In my case the form had a couple of filter fields used to filter the > recordset used for the form. I didn't want a form/subform setup > because the filters would have been for different main tables. Here > is the solution I came up with: > > SELECT dbo.tlkpFunderServiceCodeRate.* FROM > dbo.tlkpFunderServiceCodeRate WHERE > dbo.tlkpFunderServiceCodeRate.FunderServiceCodeIDNo IN > (SELECT dbo.tlkpFunderServiceCode.FunderServiceCodeID FROM > dbo.tlkpFunderServiceCode > WHERE (dbo.tlkpFunderServiceCode.FunderIDNo = > @FunderIDNo OR @FunderIDNo = 0) AND > (dbo.tlkpFunderServiceCode.FunderServiceCodeID = > @FunderServiceCodeIDNo OR @FunderServiceCodeIDNo = 0)) ORDER BY > dbo.tlkpFunderServiceCodeRate.FunderServCodeRateStartDate > > The rates link back to a code which links back to a funder. The two > filters mean I could select all rates, all rates for a funder, or all > rates for a code. > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand > > Regards > > David > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > Arthur Fuller > Sent: Tuesday, 15 April 2014 10:50 p.m. > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Adding Records to Joined Tables > > David, > > I'm guessing that you want to do this with code rather than via a > form, since the latter makes it so easy -- just your standard > form+subform. Is that correct? If so, I still don't quite understand > why you want to use a view. Your code will need to determine the > parent PK first, then use a standard INSERT statement, passing the > parent PK in, either by calling a stored procedure that accepts a > parameter for the parent PK, or by building the INSERT statement in > code and then executing. My preference would be the stored procedure. > > Please clarify why you're using a view to accomplish this. > > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 14:27:57 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 07:27:57 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters Message-ID: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From paul.hartland at googlemail.com Thu Apr 24 14:39:41 2014 From: paul.hartland at googlemail.com (Paul Hartland) Date: Thu, 24 Apr 2014 20:39:41 +0100 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> References: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> Message-ID: David, Seems strange I haven't used anything past 2003 for development, but I know what your saying works in 2003, are your tables linked into the 2010 front end ? Paul On 24 April 2014 20:27, David Emerson wrote: > Hi Listers. > > > > Access 2010 with SQL2008 BE. I have a continuous form of client details. I > already have a search combobox for finding a client name but sometimes I > may > want to filter for all clients in a city, or in a street. With an Access BE > I can right click on the rows in a continuous form and use the filter > function to filter based on a number of tests. This doesn't seem to work > with an SQL BE.. > > Does anyone have a solution for this? My only thought is to have a line of > filter controls at the top of the screen and pass these through to the > stored procedure but this seems clunky. > > > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand > > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com From accessd at shaw.ca Thu Apr 24 14:52:27 2014 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 24 Apr 2014 13:52:27 -0600 (MDT) Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> Message-ID: <1077676866.32120576.1398369147542.JavaMail.root@cds018> Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 14:57:08 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 07:57:08 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: References: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> Message-ID: <001b01cf5ff7$5fd48dc0$1f7da940$@dalyn.co.nz> Hi Paul, Yes they are linked to 2010 front end. Regards David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Friday, 25 April 2014 7:40 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, Seems strange I haven't used anything past 2003 for development, but I know what your saying works in 2003, are your tables linked into the 2010 front end ? Paul On 24 April 2014 20:27, David Emerson wrote: > Hi Listers. > > > > Access 2010 with SQL2008 BE. I have a continuous form of client > details. I already have a search combobox for finding a client name > but sometimes I may want to filter for all clients in a city, or in a > street. With an Access BE I can right click on the rows in a > continuous form and use the filter function to filter based on a > number of tests. This doesn't seem to work with an SQL BE.. > > Does anyone have a solution for this? My only thought is to have a > line of filter controls at the top of the screen and pass these > through to the stored procedure but this seems clunky. > > > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand From newsgrps at dalyn.co.nz Thu Apr 24 14:57:57 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 07:57:57 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <1077676866.32120576.1398369147542.JavaMail.root@cds018> References: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> <1077676866.32120576.1398369147542.JavaMail.root@cds018> Message-ID: <001c01cf5ff7$7ce1fe20$76a5fa60$@dalyn.co.nz> Hi Jim, Yes I would appreciate what you can find. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 15:18:00 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 08:18:00 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <1077676866.32120576.1398369147542.JavaMail.root@cds018> References: <001101cf5ff3$4c02b050$e40810f0$@dalyn.co.nz> <1077676866.32120576.1398369147542.JavaMail.root@cds018> Message-ID: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From accessd at shaw.ca Thu Apr 24 17:48:12 2014 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 24 Apr 2014 16:48:12 -0600 (MDT) Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> Message-ID: <1261544344.32253007.1398379692030.JavaMail.root@cds018> Hi David: Once a data set can be placed in a recordset then filtering should be not problem. I am not that current on the latest and greatest MS SQL DB features but to my understanding, the fastest way to extract data is through a query...or am I not understanding your question? Jim ----- Original Message ----- From: "David Emerson" To: "Discussion concerning MS SQL Server" Sent: Thursday, 24 April, 2014 1:18:00 PM Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 17:56:11 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 10:56:11 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <1261544344.32253007.1398379692030.JavaMail.root@cds018> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> Message-ID: <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> Jim, General filtering when getting a recordset is not a problem. What I am referring to is when a user right clicks in a continuous form the shortcut menu has an item called "Text Filters" as well as a number of predictive filters based on the current field. These work with an Access BE but searches on the web indicate that they don't with an SQL BE. Just trying to confirm what others might have done to get around this apparent limitation. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 10:48 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: Once a data set can be placed in a recordset then filtering should be not problem. I am not that current on the latest and greatest MS SQL DB features but to my understanding, the fastest way to extract data is through a query...or am I not understanding your question? Jim ----- Original Message ----- From: "David Emerson" To: "Discussion concerning MS SQL Server" Sent: Thursday, 24 April, 2014 1:18:00 PM Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From gmiller at sistersnet.com Thu Apr 24 18:20:44 2014 From: gmiller at sistersnet.com (Gary Miller) Date: Thu, 24 Apr 2014 16:20:44 -0700 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> Message-ID: <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> David, I have a 2010 FE linked to a 2008 SQL BE living on the internet using ODBC. The subforms are fed by dynamic recordsets that I populate on the selection of the parent record and I seem to have the 'Text Filters' available on right-click of the fields in it. I just tried a 'Contains' filter and it worked fine. Caveat is I am not using a stored procedure as such -- just a recordset call to a SQL view that I am filtering by Parent ID in the SQL statement for the subform RecordSource. Have you double-checked your AllowFilters property of the subform? Gary Miller -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 3:56 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Jim, General filtering when getting a recordset is not a problem. What I am referring to is when a user right clicks in a continuous form the shortcut menu has an item called "Text Filters" as well as a number of predictive filters based on the current field. These work with an Access BE but searches on the web indicate that they don't with an SQL BE. Just trying to confirm what others might have done to get around this apparent limitation. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 10:48 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: Once a data set can be placed in a recordset then filtering should be not problem. I am not that current on the latest and greatest MS SQL DB features but to my understanding, the fastest way to extract data is through a query...or am I not understanding your question? Jim ----- Original Message ----- From: "David Emerson" To: "Discussion concerning MS SQL Server" Sent: Thursday, 24 April, 2014 1:18:00 PM Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 18:38:05 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 11:38:05 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> Message-ID: <003701cf6016$3e031490$ba093db0$@dalyn.co.nz> Gary, Looks promising. I am using a stored procedure. Can you please give me an example of how you make the recordset call to a SQL view - when I try to replace my stored procedure name with a view name in my call it rejects it and tells me it is because it is a view!! David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 11:21 a.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, I have a 2010 FE linked to a 2008 SQL BE living on the internet using ODBC. The subforms are fed by dynamic recordsets that I populate on the selection of the parent record and I seem to have the 'Text Filters' available on right-click of the fields in it. I just tried a 'Contains' filter and it worked fine. Caveat is I am not using a stored procedure as such -- just a recordset call to a SQL view that I am filtering by Parent ID in the SQL statement for the subform RecordSource. Have you double-checked your AllowFilters property of the subform? Gary Miller -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 3:56 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Jim, General filtering when getting a recordset is not a problem. What I am referring to is when a user right clicks in a continuous form the shortcut menu has an item called "Text Filters" as well as a number of predictive filters based on the current field. These work with an Access BE but searches on the web indicate that they don't with an SQL BE. Just trying to confirm what others might have done to get around this apparent limitation. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 10:48 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: Once a data set can be placed in a recordset then filtering should be not problem. I am not that current on the latest and greatest MS SQL DB features but to my understanding, the fastest way to extract data is through a query...or am I not understanding your question? Jim ----- Original Message ----- From: "David Emerson" To: "Discussion concerning MS SQL Server" Sent: Thursday, 24 April, 2014 1:18:00 PM Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From gmiller at sistersnet.com Thu Apr 24 20:23:12 2014 From: gmiller at sistersnet.com (Gary Miller) Date: Thu, 24 Apr 2014 18:23:12 -0700 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <003701cf6016$3e031490$ba093db0$@dalyn.co.nz> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <003701cf6016$3e031490$ba093db0$@dalyn.co.nz> Message-ID: <02ba01cf6024$ed6d0db0$c8472910$@sistersnet.com> David, Here is the code in the OnOpen event of the subform. The subform resides on a tab page that cals the subform when the tab page is clicked -- not specified from the parent or populated until then. Even though the SQL references a 'qry' it is a mult-table view on the server that is just retaining the original 'qry' prefix of the name of the original query from the old Access backend. Private Sub Form_Open(Cancel As Integer) Dim SQL As String Dim lngID As Long ' Open the forms recordset based on the parent form ID lngID = Nz(Forms!frmPeople!PersonID) SQL = "SELECT * FROM qry_Quilts_andLocation" & _ " WHERE PersonID = " & lngID & " AND EventID = " & fnActiveShowID() & _ " ORDER BY EventYear DESC, quilt_name;" 'Debug.Print SQL Me.RecordSource = SQL End Sub Gary -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 4:38 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Gary, Looks promising. I am using a stored procedure. Can you please give me an example of how you make the recordset call to a SQL view - when I try to replace my stored procedure name with a view name in my call it rejects it and tells me it is because it is a view!! David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 11:21 a.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, I have a 2010 FE linked to a 2008 SQL BE living on the internet using ODBC. The subforms are fed by dynamic recordsets that I populate on the selection of the parent record and I seem to have the 'Text Filters' available on right-click of the fields in it. I just tried a 'Contains' filter and it worked fine. Caveat is I am not using a stored procedure as such -- just a recordset call to a SQL view that I am filtering by Parent ID in the SQL statement for the subform RecordSource. Have you double-checked your AllowFilters property of the subform? Gary Miller From newsgrps at dalyn.co.nz Thu Apr 24 20:35:39 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 13:35:39 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <02ba01cf6024$ed6d0db0$c8472910$@sistersnet.com> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <003701cf6016$3e031490$ba093db0$@dalyn.co.nz> <02ba01cf6024$ed6d0db0$c8472910$@sistersnet.com> Message-ID: <004901cf6026$aa5e6350$ff1b29f0$@dalyn.co.nz> Thanks Gary. Regards David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 1:23 p.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, Here is the code in the OnOpen event of the subform. The subform resides on a tab page that cals the subform when the tab page is clicked -- not specified from the parent or populated until then. Even though the SQL references a 'qry' it is a mult-table view on the server that is just retaining the original 'qry' prefix of the name of the original query from the old Access backend. Private Sub Form_Open(Cancel As Integer) Dim SQL As String Dim lngID As Long ' Open the forms recordset based on the parent form ID lngID = Nz(Forms!frmPeople!PersonID) SQL = "SELECT * FROM qry_Quilts_andLocation" & _ " WHERE PersonID = " & lngID & " AND EventID = " & fnActiveShowID() & _ " ORDER BY EventYear DESC, quilt_name;" 'Debug.Print SQL Me.RecordSource = SQL End Sub Gary -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 4:38 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Gary, Looks promising. I am using a stored procedure. Can you please give me an example of how you make the recordset call to a SQL view - when I try to replace my stored procedure name with a view name in my call it rejects it and tells me it is because it is a view!! David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 11:21 a.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, I have a 2010 FE linked to a 2008 SQL BE living on the internet using ODBC. The subforms are fed by dynamic recordsets that I populate on the selection of the parent record and I seem to have the 'Text Filters' available on right-click of the fields in it. I just tried a 'Contains' filter and it worked fine. Caveat is I am not using a stored procedure as such -- just a recordset call to a SQL view that I am filtering by Parent ID in the SQL statement for the subform RecordSource. Have you double-checked your AllowFilters property of the subform? Gary Miller _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Apr 24 21:26:15 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 25 Apr 2014 14:26:15 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> Message-ID: <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> Thanks to Gary for his help, the solution was to use linked tables or views and not a stored procedure. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 11:21 a.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, I have a 2010 FE linked to a 2008 SQL BE living on the internet using ODBC. The subforms are fed by dynamic recordsets that I populate on the selection of the parent record and I seem to have the 'Text Filters' available on right-click of the fields in it. I just tried a 'Contains' filter and it worked fine. Caveat is I am not using a stored procedure as such -- just a recordset call to a SQL view that I am filtering by Parent ID in the SQL statement for the subform RecordSource. Have you double-checked your AllowFilters property of the subform? Gary Miller -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 3:56 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Jim, General filtering when getting a recordset is not a problem. What I am referring to is when a user right clicks in a continuous form the shortcut menu has an item called "Text Filters" as well as a number of predictive filters based on the current field. These work with an Access BE but searches on the web indicate that they don't with an SQL BE. Just trying to confirm what others might have done to get around this apparent limitation. David -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 10:48 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: Once a data set can be placed in a recordset then filtering should be not problem. I am not that current on the latest and greatest MS SQL DB features but to my understanding, the fastest way to extract data is through a query...or am I not understanding your question? Jim ----- Original Message ----- From: "David Emerson" To: "Discussion concerning MS SQL Server" Sent: Thursday, 24 April, 2014 1:18:00 PM Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi Jim, Just to confirm, do I take from your reply that the built in filtering doesn't work with an SQL BE? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, 25 April 2014 7:52 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters Hi David: This is not a difficult process but it does take a bit of coding to accomplish and I posted code samples on that effort earlier this year. IMHO it would be unwise to have a synchronized connection to a SQL BE an asynchronous connect model would be my recommendation. If you would like the posts, just ask and I will see if they easy to find. Jim ----- Original Message ----- From: "David Emerson" To: "AccessDSQL" Sent: Thursday, 24 April, 2014 12:27:57 PM Subject: [dba-SQLServer] Continuous Forms and Filters Hi Listers. Access 2010 with SQL2008 BE. I have a continuous form of client details. I already have a search combobox for finding a client name but sometimes I may want to filter for all clients in a city, or in a street. With an Access BE I can right click on the rows in a continuous form and use the filter function to filter based on a number of tests. This doesn't seem to work with an SQL BE.. Does anyone have a solution for this? My only thought is to have a line of filter controls at the top of the screen and pass these through to the stored procedure but this seems clunky. Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From gmiller at sistersnet.com Fri Apr 25 01:44:19 2014 From: gmiller at sistersnet.com (Gary Miller) Date: Thu, 24 Apr 2014 23:44:19 -0700 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> Message-ID: <02cc01cf6051$c9763b20$5c62b160$@sistersnet.com> Glad it did the trick. I link the tables/views through ODBC connections but then don't populate the forms until I have a thin recordset to call. Efficient enough for the scale I'm working with even over the internet to desktops. Gary -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 7:26 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Thanks to Gary for his help, the solution was to use linked tables or views and not a stored procedure. David From listmaster at databaseadvisors.com Fri Apr 25 08:28:15 2014 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Fri, 25 Apr 2014 09:28:15 -0400 Subject: [dba-SQLServer] Administrivia - IMPORTANT Information RE: Yahoo and AOL Users Message-ID: Hi All, Recently Yahoo and AOL have changed the way they are fighting spam. On April 12 Yahoo and on Apr 22 AOL implemented a strict DMARC policy that will cause posts to mailing lists, such as ours from yahoo.com and aol.com users to be bounced by many other services. What does this mean to you, the DBA list member? 1) If you are sending from yahoo.com or aol.com, list members may not see your email. 2) If you are receiving email from the list that was sent by a yahoo.com or aol.com users, your list subscription may be put on hold because your mail server bounces these emails. 3) If you are receiving email from the list that was sent by a yahoo.com or aol.com users, these emails may be ending up in your spam folder. 4) Nothing at all will be different, if your mail server doesn't do any DMARC checking. Currently there is no easy way for DBA to fix this. Each of the 5 possible "fixes" comes with it's own set of issues. The developers of the mailing list software are currently working on a release to partially deal with these issues, but that won't be ready for a week or two. At which point, I will let you know when the lists are going down for upgrading. In the meantime, please check your spam folder for list mail. If you have any questions or concerns contact me at listmaster at databaseadvisors.com or my personal account, carbonnb at gmail.com. -- Bryan Carbonnell - listmaster at databaseadvisors.com Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "What a great ride!" From newsgrps at dalyn.co.nz Fri Apr 25 14:16:49 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Sat, 26 Apr 2014 07:16:49 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <02cc01cf6051$c9763b20$5c62b160$@sistersnet.com> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> <02cc01cf6051$c9763b20$5c62b160$@sistersnet.com> Message-ID: <002c01cf60ba$e8872bf0$b99583d0$@dalyn.co.nz> I am curious. My understanding is that when a filter is applied this way, all the records are brought across and the filtering is done by Access, not at the SQL end. Is this correct? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gary Miller Sent: Friday, 25 April 2014 6:44 p.m. To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Glad it did the trick. I link the tables/views through ODBC connections but then don't populate the forms until I have a thin recordset to call. Efficient enough for the scale I'm working with even over the internet to desktops. Gary -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 24, 2014 7:26 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Continuous Forms and Filters Thanks to Gary for his help, the solution was to use linked tables or views and not a stored procedure. David From fuller.artful at gmail.com Fri Apr 25 16:54:59 2014 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 25 Apr 2014 17:54:59 -0400 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: <002c01cf60ba$e8872bf0$b99583d0$@dalyn.co.nz> References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> <02cc01cf6051$c9763b20$5c62b160$@sistersnet.com> <002c01cf60ba$e8872bf0$b99583d0$@dalyn.co.nz> Message-ID: David, You are both right and wrong in your hypothesis. If you apply the filter in Access, the database sends all the rows to Access, which then processes them. This is why Access also offers Pass-Through-Queries (PTQs). When you create a PTQ, Access gets out of the way and sends the query directly to the db engine, which does the heavy lifting and sends only the result set. To execute a PTQ, you use the CALL keyword, as in: CALL MyQuery_ptq 'no quotes required. Given that the goal here is to allow the user to create a filtered query, then the approach I would use is to bind the form to a PTQ that returns all the rows; then when the user applies a filter, I would rewrite the PTQ's SQL statement and finally do a requery on the form. Another approach would be to write a stored procedure that accepts a number of optional parameters, then allow the user to apply the desired filter, and then rewrite the PTQ something along these lines: CALL MySproc parm1, NULL, parm3, NULL, parm5 Of course, the logic within the SP would have to be able to handle the parameters passed, and react intelligently. Arthur On Fri, Apr 25, 2014 at 3:16 PM, David Emerson wrote: > I am curious. My understanding is that when a filter is applied this way, > all the records are brought across and the filtering is done by Access, not > at the SQL end. Is this correct? > > Regards > > David Emerson > From newsgrps at dalyn.co.nz Fri Apr 25 17:40:23 2014 From: newsgrps at dalyn.co.nz (David Emerson) Date: Sat, 26 Apr 2014 10:40:23 +1200 Subject: [dba-SQLServer] Continuous Forms and Filters In-Reply-To: References: <001d01cf5ffa$4a3a6f40$deaf4dc0$@dalyn.co.nz> <1261544344.32253007.1398379692030.JavaMail.root@cds018> <003301cf6010$62f54c60$28dfe520$@dalyn.co.nz> <02ae01cf6013$d17cb5d0$74762170$@sistersnet.com> <005201cf602d$bbe86c40$33b944c0$@dalyn.co.nz> <02cc01cf6051$c9763b20$5c62b160$@sistersnet.com> <002c01cf60ba$e8872bf0$b99583d0$@dalyn.co.nz> Message-ID: <004201cf60d7$58bf2230$0a3d6690$@dalyn.co.nz> Thanks Arthur for your detailed explanation and solution suggestions - much appreciated. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Saturday, 26 April 2014 9:55 a.m. To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Continuous Forms and Filters David, You are both right and wrong in your hypothesis. If you apply the filter in Access, the database sends all the rows to Access, which then processes them. This is why Access also offers Pass-Through-Queries (PTQs). When you create a PTQ, Access gets out of the way and sends the query directly to the db engine, which does the heavy lifting and sends only the result set. To execute a PTQ, you use the CALL keyword, as in: CALL MyQuery_ptq 'no quotes required. Given that the goal here is to allow the user to create a filtered query, then the approach I would use is to bind the form to a PTQ that returns all the rows; then when the user applies a filter, I would rewrite the PTQ's SQL statement and finally do a requery on the form. Another approach would be to write a stored procedure that accepts a number of optional parameters, then allow the user to apply the desired filter, and then rewrite the PTQ something along these lines: CALL MySproc parm1, NULL, parm3, NULL, parm5 Of course, the logic within the SP would have to be able to handle the parameters passed, and react intelligently. Arthur On Fri, Apr 25, 2014 at 3:16 PM, David Emerson wrote: > I am curious. My understanding is that when a filter is applied this > way, all the records are brought across and the filtering is done by > Access, not at the SQL end. Is this correct? > > Regards > > David Emerson > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com