From accessd at shaw.ca Fri Apr 1 00:00:18 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 31 Mar 2011 22:00:18 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <201103312301.p2VN0u1M028069@databaseadvisors.com> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> Message-ID: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Our clock numbering system was invented by the ancient Symmerians, 3000+ years ago, so why should we change now? It is simple as everything is calculated on 12s and 60s... |-P Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter I remember when New Zealand went metric with its currency back in the '70s. A friend was going overseas and was told by another friend that we were changing over to metric time next and was asked if could he bring back a metric watch. -- Stuart On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > Metric dates...hmm... 10 days per week, then? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > > ______________________________________________________________________ > ______ ___________ > > Note: This e-mail is subject to the disclaimer contained at the bottom > of this message. > ______________________________________________________________________ > ______ ___________ > > > > Hi Rocky, > > To avoid these sort of issues I use dateserial on each and every date > I process in SQL / VBA to make sure they line up correctly. Also from > memory the VBE treats all dates passed in VBA as American format as > default, regardless of the PC's regional setting. Coming from the land > of "dd-mm-yyyy" as standard it is an issue I need to deal with a lot. > > Now, if only you pesky Americans got with the program, used a proper > date format and just swallowed your pride and admit the French were > right and adopt the (far superior) metric system it would make life > for the rest of the planet much easier. ;) > > cheers > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > discussion and problem solving' Subject: Re: [AccessD] Un-American > Date Filter > > Doug: > > When I change the code to > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > And > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > the sql statement still comes out: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate > >= #31/03/2011# AND DueDate <= #07/04/2011# > > And still no date filtering. > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > Hi Rocky: > > I've dealt with this in the past by forcing the date format to > mm/dd/yy in the SQL, something like: > > WHERE DueDate >= Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > Doug > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > wrote: > Dear List: > > I create a temp table > using a SQL statement I construct in code to > incorporate various > filter - one of which is a date filter. > > Works well here but when I > send it to the user in Bahrain who's > regional setting is (I assume > from the screen shot he sent) English > U.K. where the date format is > dd/mm/yyyy it fails. ?I set my regional > settings on my box to U.K. > and sure enough it fails - returns all > records with no date > filtering. > > Here's the SQL statement that creates the table: > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue > ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand ?WHERE DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed to > filter out any record in tblDemand where the Due > Date is outside of > the range March 31 to April 7. ?But it don't. > > When I look in > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > doesn't this work? ?Should I be using some kind of different > syntax > for this filter? > > MTIA > > > Rocky Smolin > > Beach Access Software > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > www.bchacc.com > > > > > > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ______________________________________________________________________ > ______ ___________ > > The information transmitted in this message and its attachments (if > any) is intended only for the person or entity to which it is > addressed. The message may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, > or taking of any action in reliance upon this information, by persons > or entities other than the intended recipient is prohibited. > > If you have received this in error, please contact the sender and > delete this e-mail and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, > disclose or distribute the information contained in this e-mail and > any attached files, with the permission of the sender. > > This message has been scanned for viruses. > ______________________________________________________________________ > ______ ___________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Fri Apr 1 00:10:28 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Fri, 1 Apr 2011 18:10:28 +1300 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: <759994F1FF5140A1B7081212566A9630@HAL9005><201103312301.p2VN0u1M028069@databaseadvisors.com> Message-ID: Rocky, I always convert dates in code to Long. That way it always works regardless of the locale. I find it simpler like that. ... WHERE DueDate >= " & CLng(Me.txtGEDueDate) & " AND DueDate <= " & CLng(Me.txtLEDueDate) Or preferably... ... WHERE DueDate Between " & CLng(Me.txtGEDueDate) & " And " & CLng(Me.txtLEDueDate) Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, April 01, 2011 12:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Un-American Date Filter When I change the code to "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" And "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" the sql statement still comes out: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# And still no date filtering. From stuart at lexacorp.com.pg Fri Apr 1 00:30:47 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:30:47 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, , <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> Message-ID: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > From stuart at lexacorp.com.pg Fri Apr 1 00:36:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:36:51 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg>, <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Message-ID: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Simple - if you have six digits on each hand. or even better five limbs in total with 12 fingers/toes on each. :-) -- Stuart On 31 Mar 2011 at 22:00, Jim Lawrence wrote: > Our clock numbering system was invented by the ancient Symmerians, > 3000+ years ago, so why should we change now? It is simple as > everything is calculated on 12s and 60s... |-P > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > I remember when New Zealand went metric with its currency back in the > '70s. > > A friend was going overseas and was told by another friend that we > were changing over to metric time next and was asked if could he bring > back a metric watch. > > -- > Stuart > > > On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > > > Metric dates...hmm... 10 days per week, then? > > > > Rocky > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > > > ____________________________________________________________________ > > __ ______ ___________ > > > > Note: This e-mail is subject to the disclaimer contained at the > > bottom of this message. > > ____________________________________________________________________ > > __ ______ ___________ > > > > > > > > Hi Rocky, > > > > To avoid these sort of issues I use dateserial on each and every > > date I process in SQL / VBA to make sure they line up correctly. > > Also from memory the VBE treats all dates passed in VBA as American > > format as default, regardless of the PC's regional setting. Coming > > from the land of "dd-mm-yyyy" as standard it is an issue I need to > > deal with a lot. > > > > Now, if only you pesky Americans got with the program, used a proper > > date format and just swallowed your pride and admit the French were > > right and adopt the (far superior) metric system it would make life > > for the rest of the planet much easier. ;) > > > > cheers > > Darryl. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > > discussion and problem solving' Subject: Re: [AccessD] Un-American > > Date Filter > > > > Doug: > > > > When I change the code to > > > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > > > And > > > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > > > the sql statement still comes out: > > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE > > DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > > > And still no date filtering. > > > > R > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug > > Steele Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > Hi Rocky: > > > > I've dealt with this in the past by forcing the date format to > > mm/dd/yy in the SQL, something like: > > > > WHERE DueDate >= > > Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > > > Doug > > > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > > wrote: > Dear List: > > I create a temp > > table using a SQL statement I construct in code to > incorporate > > various filter - one of which is a date filter. > > Works well here > > but when I send it to the user in Bahrain who's > regional setting > > is (I assume from the screen shot he sent) English > U.K. where the > > date format is dd/mm/yyyy it fails. ?I set my regional > settings on > > my box to U.K. and sure enough it fails - returns all > records with > > no date filtering. > > Here's the SQL statement that creates the > > table: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, > > DueDate, > QuantityDue > ) SELECT tblDemand.PartNumber, > > tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue > > FROM tblDemand ?WHERE DueDate > > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed > > > >to > > filter out any record in tblDemand where the Due > Date is outside > > of the range March 31 to April 7. ?But it don't. > > When I look in > > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > > doesn't this work? ?Should I be using some kind of different > > > syntax for this filter? > > MTIA > > > Rocky Smolin > > Beach Access > > Software > > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > > www.bchacc.com > > > > > > > > > > > > -- > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > > http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > ____________________________________________________________________ > > __ ______ ___________ > > > > The information transmitted in this message and its attachments (if > > any) is intended only for the person or entity to which it is > > addressed. The message may contain confidential and/or privileged > > material. Any review, retransmission, dissemination or other use of, > > or taking of any action in reliance upon this information, by > > persons or entities other than the intended recipient is prohibited. > > > > If you have received this in error, please contact the sender and > > delete this e-mail and associated material from any computer. > > > > The intended recipient of this e-mail may only use, reproduce, > > disclose or distribute the information contained in this e-mail and > > any attached files, with the permission of the sender. > > > > This message has been scanned for viruses. > > ____________________________________________________________________ > > __ ______ ___________ > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:38:39 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:38:39 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: Yes, you bet. In Canada, April Fool's day rules!! Doug On Thu, Mar 31, 2011 at 10:30 PM, Stuart McLachlan wrote: > dd Mmm yyyy .... in sequential order. ?(?) > > You mean "01 Apr 2011" ?comes before "01 Jan 2011" ?in your calendar? > > -- > Stuart > > On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > >> Actually, our government (federal and provincial) uses yyyymmdd which >> sorts as a string, a number or as a date without any translation. The >> other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there >> is never any confusion between month and day...and again everything is >> in sequential order. >> >> Jim >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:43:16 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:43:16 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Message-ID: Well, Jim Lawrence & I are directly in line with the output from Fukushima Daiichi, so that's a distinct possibility for the future. On Thu, Mar 31, 2011 at 10:36 PM, Stuart McLachlan wrote: > Simple - ?if you have six digits on each hand. > > or even better five limbs in total with 12 fingers/toes on each. From davidmcafee at gmail.com Fri Apr 1 09:31:45 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 07:31:45 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> References: <757F90EAE81B4D8587C1948BA52F0E6D@nant> <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> Message-ID: That's how I do it Sent from my Droid phone. On Mar 31, 2011 9:46 PM, "Jim Lawrence" wrote: > How does everyone connect to their data on their SQL server? > > I have never done any other method than by passing parameters and calling > the appropriate SP. Does everyone else actually just send sql strings? > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, March 31, 2011 3:40 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Un-American Date Filter > > That is, unless the backend may be SQL Server, in which case, the > delimiter is a single quote. We used to run into that issue in .Net, > so we built a function to return the date string formatted with the > correct delimiter depending on which database was in use. Easy enough > to create a function to format any date to US format as well. > > Charlotte Foust > > On Thu, Mar 31, 2011 at 2:58 PM, Shamil Salakhetdinov > wrote: >> Hi Rocky -- > >> Of course date string used in SQL expression in American format should be >> enclosed in a pair of '#' symbols - #04/01/2011# .... >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 10:47:26 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 1 Apr 2011 08:47:26 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: <152C372724D34FF3BA3B91793BA65146@creativesystemdesigns.com> It was a date format for human viewing; a number delimitated by letters and then numbers again...found to be the best standard and for easy reading, because of its symmetry and order. OTOH if given a date like 03/06/11, no one will ever know whether it is referring to the Mar 06 1911 or 03 Jun 1911 or Mar 06 2011 or 03 Jun 2011. Worked on a government project to bring all the old data into the computers. When I left 6 months later they were still working on it. With no standards and mixed formats many dates had to be interpeted by manually going through related files. I understand that people are still working on the project and that was almost 15 years ago. ;-) We know of a friend who is tasked with translating of church records which go back over a thousand years...too bad there were no stanadrds in the parishes. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 10:31 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 1 12:37:43 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 01 Apr 2011 19:37:43 +0200 Subject: [AccessD] Un-American Date Filter Message-ID: Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From davidmcafee at gmail.com Fri Apr 1 13:37:04 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 11:37:04 -0700 Subject: [AccessD] Weird issues with one user Message-ID: I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub From iggy at nanaimo.ark.com Fri Apr 1 16:31:40 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Fri, 01 Apr 2011 13:31:40 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D96443C.9090400@nanaimo.ark.com> Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. From rockysmolin at bchacc.com Fri Apr 1 15:56:51 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 13:56:51 -0700 Subject: [AccessD] Can it be done? In-Reply-To: References: Message-ID: <3E670D818042446CB0D4BC865203BB45@HAL9005> Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 1 16:00:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 14:00:02 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: Message-ID: <352C74FE2635434CA41704AD49475FAB@HAL9005> Demonstrating once again why I've been on this list for lo these many years. I'm going to be doing a lot of scheduling work for this client over in Bahrain in the coming months - Creating a whole shop floor scheduling and control system for them - very date intensive. "I pity the fool who's not a member of AccessD" - Mr. T. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 01, 2011 10:38 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Un-American Date Filter Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Fri Apr 1 16:03:15 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Fri, 1 Apr 2011 14:03:15 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: References: Message-ID: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Hi David, A couple of suggestions that might help you determine if your Modal idea is in fact the problem. In form frm_002D_Company open event try setting focus to an enabled control, this should bring it to the front. Since you you have a parameter declared to pass the name of the calling form, perhaps you could add code to hide the calling form in the on load or on open event of frm_002D_Company and then un hide it on form close. HTH Bill -------------------------------------------------- From: "David McAfee" Sent: Friday, April 01, 2011 11:37 AM To: "Access Developers discussion and problem solving" Subject: [AccessD] Weird issues with one user I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 1 16:06:29 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:06:29 -0500 Subject: [AccessD] Can it be done? In-Reply-To: <3E670D818042446CB0D4BC865203BB45@HAL9005> References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Glad it worked perfectly for you! That's what I like to hear about my sample systems. ;) I wonder if MS ever looked at it. Years ago this came up, it was Susan that wanted it, because she was copying and pasting data from the web into an Access form, and wanted the form to always be on top. MS's knowledge base had an article using a form timer... I submitted my solution to them, never heard back. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 01, 2011 3:57 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Can it be done? Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ssharkins at gmail.com Fri Apr 1 16:19:00 2011 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 1 Apr 2011 17:19:00 -0400 Subject: [AccessD] Can it be done? References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > From DWUTKA at Marlow.com Fri Apr 1 16:21:40 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:21:40 -0500 Subject: [AccessD] Can it be done? In-Reply-To: References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: That is true, we did! LOL. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 01, 2011 4:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From df.waters at comcast.net Fri Apr 1 16:24:59 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 1 Apr 2011 16:24:59 -0500 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> References: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <007301cbf0b3$41e65f20$c5b31d60$@comcast.net> Boy do I agree with this! I only occasionally create a pivot query. So, I just start with one I've already done and keep tweaking it until it does what I want. It's the fastest way for me. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Friday, April 01, 2011 4:32 PM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 1 23:54:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 00:54:06 -0400 Subject: [AccessD] Word document merge Message-ID: <4D96ABEE.3050501@colbyconsulting.com> I am setting up a word document merge. The document has a "parent / child" or parent / detail format. This is a state document and it needs to look like they give it to me. FName LName From date From time From time From date From time From time From date From time From time Pickup time Return time Signature The form has room for three date time parts, the rest is just once per document. Is this possible with Mail Merge? Do I need to "automate" this by pushing the data into it a field at a time? The form will be filled out and printed, then faxed - or printed to a fax printer. On that note, can I insert a signature picture somehow? TIA for any assistance in this. -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Sat Apr 2 00:11:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 02 Apr 2011 15:11:55 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D96ABEE.3050501@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com> Message-ID: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Are these "one-off" documents, or do you process several in one run? -- Stuart On 2 Apr 2011 at 0:54, jwcolby wrote: > I am setting up a word document merge. The document has a "parent / > child" or parent / detail format. This is a state document and it > needs to look like they give it to me. > > FName LName > > From date From time From time > From date From time From time > From date From time From time > > Pickup time Return time > > Signature > > The form has room for three date time parts, the rest is just once per > document. > > Is this possible with Mail Merge? Do I need to "automate" this by > pushing the data into it a field at a time? > > The form will be filled out and printed, then faxed - or printed to a > fax printer. > > On that note, can I insert a signature picture somehow? > > TIA for any assistance in this. > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 09:48:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 10:48:54 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com> <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Message-ID: <4D973756.2030605@colbyconsulting.com> Stuart, > Are these "one-off" documents, or do you process several in one run? I am starting to check inmates out of the local camp for AA meetings, church and the like. This is the checkout document that I have to fill out for each time I check someone out. So I will be filling out a checkout parent/child recordset for each inmate for each time I will check them out. I can never check out more than three inmates at a time, so I might fill out for one inmate for church, and two for an AA meeting on Tuesday. Like that. Actually I eventually figured it out. I am using bookmarks and inserting data in the bookmarks. I think the way it will work is that I will have a button on the form where I fill out the data. fill one "checkout", print it, do the next, print it. I have to sign these and then fax them to the prison. I would like to eventually have a signature gif which I insert into the document, and eventually fax them straight out of my machine. John W. Colby www.ColbyConsulting.com On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > Are these "one-off" documents, or do you process several in one run? > From stuart at lexacorp.com.pg Sat Apr 2 09:57:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 03 Apr 2011 00:57:24 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D973756.2030605@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> Message-ID: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) Do you need to insert the signature at print time, or can you just put it in the blank template document? I generally do the latter. -- Stuart On 2 Apr 2011 at 10:48, jwcolby wrote: > Stuart, > > > Are these "one-off" documents, or do you process several in one > run? > > I am starting to check inmates out of the local camp for AA meetings, > church and the like. This is the checkout document that I have to > fill out for each time I check someone out. So I will be filling out > a checkout parent/child recordset for each inmate for each time I will > check them out. I can never check out more than three inmates at a > time, so I might fill out for one inmate for church, and two for an AA > meeting on Tuesday. Like that. > > Actually I eventually figured it out. I am using bookmarks and > inserting data in the bookmarks. I think the way it will work is that > I will have a button on the form where I fill out the data. fill one > "checkout", print it, do the next, print it. > > I have to sign these and then fax them to the prison. I would like to > eventually have a signature gif which I insert into the document, and > eventually fax them straight out of my machine. > > John W. Colby > www.ColbyConsulting.com > > On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > > Are these "one-off" documents, or do you process several in one run? > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 10:20:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:20:47 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> Message-ID: <4D973ECF.7070301@colbyconsulting.com> Well... I am intending to share the app so "at print time" is the best solution. John W. Colby www.ColbyConsulting.com On 4/2/2011 10:57 AM, Stuart McLachlan wrote: > That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) > > Do you need to insert the signature at print time, or can you just put it in the blank template > document? I generally do the latter. > From jwcolby at colbyconsulting.com Sat Apr 2 10:37:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:37:07 -0400 Subject: [AccessD] datatype Time(7) precision Message-ID: <4D9742A3.8050002@colbyconsulting.com> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. -- John W. Colby www.ColbyConsulting.com From iggy at nanaimo.ark.com Sat Apr 2 11:55:30 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Sat, 02 Apr 2011 08:55:30 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D975502.6050102@nanaimo.ark.com> Hey All This is incredible if it wasn't so sad. Been fooling around with the Pivot Tables in Access 2003. I had originally installed the OCW11.dll for Access 2003 in the reference library. Finally found Microsoft's "Programming Pivot Table Reports in Access 2002." All the goodies for programmatically controlling the Pivot Table with Access VBA. Spent the last couple of hours trying their examples. Some worked fine, with others part of it would work other parts wouldn't and with some the examples it just crashed (type mismatch, this property can't be used with this object etc. etc. etc.). Farted around trying to figure out what it was I was doing wrong. Finally the "DUH" light went on, I noticed the Dim Pivot Table properties were preceded with OWC10, eg. Pt as OCW10.PivotTable I had changed these to OCW11. I switched to the OCW10.dll for Access 2002 and changed the OCW11 back to OCW10, and low and behold eveything worked beautifully. Who in they right mind would provide something like this to the developer, without a warning, I am baffled. The time I have wasted over the last couple of days I could have by now designed my own pseudo pivot table. Hey Zeus!!!! From gustav at cactus.dk Sat Apr 2 11:49:59 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 02 Apr 2011 18:49:59 +0200 Subject: [AccessD] datatype Time(7) precision Message-ID: Hi John That should influence the fractions of a second only: http://msdn.microsoft.com/en-us/library/bb677243.aspx Specifies the number of digits for the fractional part of the seconds. This can be an integer from 0 to 7. The default fractional precision is 7 (100ns). As Access out of the box doesn't support fractions of seconds, you must be facing another issue. /gustav >>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07 >>> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. From jwcolby at colbyconsulting.com Sat Apr 2 13:19:14 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 14:19:14 -0400 Subject: [AccessD] datatype Time(7) precision In-Reply-To: References: Message-ID: <4D9768A2.7000105@colbyconsulting.com> As it turns out, it is a driver issue. Using vanilla ODBC rather than the native SQL Server causes the (data entry) issue to go away. John W. Colby www.ColbyConsulting.com On 4/2/2011 12:49 PM, Gustav Brock wrote: > Hi John > > That should influence the fractions of a second only: > > http://msdn.microsoft.com/en-us/library/bb677243.aspx > Specifies the number of digits for the fractional part of the seconds. > This can be an integer from 0 to 7. > The default fractional precision is 7 (100ns). > > As Access out of the box doesn't support fractions of seconds, you must be facing another issue. > > /gustav > > >>>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07>>> > What does the (7) really mean? Is it possible to manipulate that number to determine how many > seconds / milliseconds etc that SQL server is expecting to be entered? > > Im am trying to enter time in Access and I am currently required to enter the seconds part > > hh:mm:ss > > 08:00:00 > > If I don't enter the seconds SQL Server complains as I try to store the field. > > > From gustav at cactus.dk Sun Apr 3 07:45:20 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 03 Apr 2011 14:45:20 +0200 Subject: [AccessD] Rapid Application Development: LightSwitch Beta 2 Message-ID: Hi all Here is a better, though still brief, introduction to the new beta: http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/threads Click at the top under Announcements the topic: Visual Studio LightSwitch Beta 2 Released with Go Live License! .. We'd also like to announce that Beta 2 comes with a "Go Live" license which means you can now start using Visual Studio LightSwitch for production projects /gustav >>> gustav at cactus.dk 03-04-2011 11:07 >>> Hi members of "VS2010 SP1 club" Then those interested in true RAD may proceed obtaining the recent LightSwitch Beta 2 which requires VS2010 SP1: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=cff6c4ef-a29a-4c82-9a59-8a3bbb65ec3d The Beta 1 must be uninstalled first. Apart from many minor improvements "too numerous to mention" as the team tells, an interesting new feature is direct deployment to Windows/SQL Azure. Also, the Visual Studio LightSwitch Beta 2 Training Kit: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=AC1D8EB5-AC8E-45D5-B1E3-EFB8E4E3EBD1 /gustav >>> shamil at smsconsulting.spb.ru 02-04-2011 16:26:55 >>> Hi Gustav at al, <<< So I did and ran the SP1 again. This time - as everything was downloaded - it took about an hour to finish. >>> Yes, I have also got to the "VS2010 SP1 club" today. :) Setup went smoothly and took a bit more than an hour.... Thank you. -- Shamil From rockysmolin at bchacc.com Sun Apr 3 10:05:52 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 3 Apr 2011 08:05:52 -0700 Subject: [AccessD] Solution in Search of a Problem Message-ID: I got a .pages file from a friend and, of course, couldn't open it. It was made on a (shudder) Mac. I got this tip from the web, though on opening it. Save the .pages file, change the extension to .zip, double click to unzip. In the zip file there will be a file called preview.pdf which will be the .pages doc converted to pdf. Walla! Rocky From Darryl.Collins at iag.com.au Sun Apr 3 20:02:54 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Mon, 4 Apr 2011 11:02:54 +1000 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <201104040103.p34133uS024641@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Pivot tables in Access are so insipid and fiddly that almost anyone who needs to use PTs seriously end up using Excel anyway, and either hooks Excel into the database or pushes the source out of the database into an Excel workbook / template which then automatically produces the PT using code. Best of both world then. Excel's PT ability is far superior to what is native in Access. My advice would be that using Excel is still the better approach. Of course your milage may vary depending on what you want to do. Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Saturday, 2 April 2011 8:32 AM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From rusty.hammond at cpiqpc.com Mon Apr 4 10:02:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 4 Apr 2011 10:02:44 -0500 Subject: [AccessD] Windows Terminal Services and RemoteApp - nice Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE117@CPIEMAIL-EVS1.CPIQPC.NET> A nice little introduction to Windows terminal services and the newer RemoteApp feature from FMS. Gives the ability to connect to a Terminal Server session and only show the app(s) you want the user to see. http://www.fmsinc.com/MicrosoftAccess/terminal-services/remoteapp.htm Rusty Hammond IT Dept. - B-20 Senior Developer CPI Qualified Plan Consultants, Inc. (620) 793-8473 ext. 416 rusty.hammond at cpiqpc.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From bheygood at abestsystems.com Mon Apr 4 14:06:54 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:06:54 -0700 Subject: [AccessD] datatype Time(7) precision In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <8BC8D7BC2C9840278F464D0A8CF5B340@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:08:37 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:08:37 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:09:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:09:01 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <0D38443FD37B4E6AAF674630AD1040E7@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From davidmcafee at gmail.com Mon Apr 4 14:58:26 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 4 Apr 2011 12:58:26 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: <5F016B3563E9447A81D7A3AFE217A357@BPCS> References: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Message-ID: I added the set focus. I also noticed that AutoCenter was off, so I turned that on. I put out an update and the user said that it worked, so I'm not sure which one fixed it, but it is fixed. Thanks. David On Fri, Apr 1, 2011 at 2:03 PM, Bill Patten wrote: > Hi David, > > A couple of suggestions that might help you determine if your Modal idea is > in fact the problem. > > In form frm_002D_Company open event try setting focus to an enabled > control, this should bring it to the front. > > Since you you have a parameter declared to pass the name of the calling > form, perhaps you could add code to hide the calling form in the on load or > on open event > of frm_002D_Company and then un hide it on form close. > > HTH > > > Bill > -------------------------------------------------- > From: "David McAfee" > Sent: Friday, April 01, 2011 11:37 AM > To: "Access Developers discussion and problem solving" > > Subject: [AccessD] Weird issues with one user > > I've been struggling with this issue for the last couple of days and it is > driving me nuts. > > The user didn't have problems until they were given a newer computer. > The computer has Vista as the OS and Access2007. > > I have some forms that were originally created in Access 2000, and another > created in (I believe Access 2003). > > Now that they have the new computer, when the user clicks on cmdLocationAdd > (or Edit), Access seems to lock up. > > What I believe is happening is that the form 002D is opening up in modal > mode, but not on top of the form that is calling it. > > I can't recreate it on my machine (also a Vista box with A2007). > > I checked our references and they both match: > > Visual Basic for Applications > Microsoft Access 12.0 Object Library > OLE Automation > Microsoft ActiveX Data Objects 2.1 Library > Microsoft DAO 3.6 Object Library > > Any ideas? > > Here are the related subs: > > > The A2003 calls a form on an OnClick event: > > Private Sub cmdLocationAdd_Click() > Dim strOpenArgs As String > strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & > Me.lstCompaniesFound.Column(1) > 'Debug.Print strOpenArgs > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return > Form | Return Field | CompanyName > End Sub > > Private Sub cmdLocationEdit_Click() > Dim strOpenArgs As String > 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | > strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & > Me.lstCompaniesFound.Column(1) '2 = Edit > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > Me.lstCompanyLocations.Requery > End Sub > > > Private Sub Form_Load() > On Error GoTo Form_Load_Error > 'Dim errNum As Double, errDesc As String, errLine As Integer > > If Not IsNull(Me.OpenArgs) Then > Dim arrX As Variant > arrX = Split(Me.OpenArgs, "|") > intMode = arrX(0) > Select Case intMode > Case 1 'Add Mode > Me.txtCompanyID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Addition" > Me.Caption = "New Address Entry" > 'Hide listbox & cmd button as we don't have an AddressID yet > Me.lstAddtionalInfo.Visible = False > Me.cmdAddAddtionalInfo.Visible = False > Me.cmdEditAddtionalInfo.Visible = False > Me.cmdDelAddtionalInfo.Visible = False > ' Show fields below, so we can write to the appropriate fields > when we append this record > Me.txtPhone.Visible = True > Me.txtfax.Visible = True > Me.txtemail.Visible = True > > Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") > Case 2 'Edit Mode > Me.txtAddrID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Edit" > Me.Caption = "Company Address Edit" > 'Show listbox & cmd button as we now have an AddressID > Me.lstAddtionalInfo.Visible = True > Me.cmdAddAddtionalInfo.Visible = True > Me.cmdEditAddtionalInfo.Visible = True > Me.cmdDelAddtionalInfo.Visible = True > 'No need to show these fields as we have the listbox available > Me.txtPhone.Visible = False > Me.txtfax.Visible = False > Me.txtemail.Visible = False > FillAddress (Me.txtAddrID) > 'Fill Phone/fax/email info: > Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " > & Me.txtAddrID > Case Else > 'Trap code removed > End Select > strReturnForm = arrX(2) 'Parameter 3, the form that we will return the > data to > strReturnField = arrX(3) 'Parameter 4, the field in the above form that > data will return to > Else > 'Do stuff when opened without OpenArgs > End If > > End Sub > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Mon Apr 4 15:20:51 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 13:20:51 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a local > drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading the > resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I still am > not able to use it. > > It's very important as I, like most of you, need to replicate a clients > setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another instance of > MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 16:05:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:05:45 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: References: , , Message-ID: <4D9A32A9.25393.377FC767@stuart.lexacorp.com.pg> I agree with Charlotte completely. That's exactly what I do. Use UNC paths, not mappings, store your development and production paths somewhere in te FE and include a re-link procress to switch between development and production BEs. Triggering the rellink can be controlled in all sorts of ways, including fully automated by checking the location of the FE on startup. -- Stuart On 4 Apr 2011 at 13:20, Charlotte Foust wrote: > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a local > drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading the > resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I still am > not able to > use it. > > It's very important as I, like most of you, need to > replicate a clients > setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another instance of > MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheygood at abestsystems.com Mon Apr 4 16:24:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 14:24:39 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <41760139BA5C46879CDDA9E6D324546D@Seven> Thanks for the response. The client is dictating which drive I have to use. Yes, I tried to set some looser permissions from the properties dialog. Lately sometimes it "sticks" and the changes I made are there next time I check. And sometimes not. Irregardless, I can't write to files in that folder. Error = You do not have permissions..... -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Mapped Drive Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a > local drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading > the resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I > still am not able to use it. > > It's very important as I, like most of you, need to replicate a > clients setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another > instance of MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Mon Apr 4 16:31:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:31:38 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: <41760139BA5C46879CDDA9E6D324546D@Seven> References: , , <41760139BA5C46879CDDA9E6D324546D@Seven> Message-ID: <4D9A38BA.25221.37977B2B@stuart.lexacorp.com.pg> Permissions on a folder are whihcever are the more severe between direct and shared. You need to set appropriate permissions on the actual folder in Explorer as well in the Sharing dialog. -- Stuart On 4 Apr 2011 at 14:24, b heygood wrote: > Thanks for the response. > The client is dictating which drive I have to use. > > Yes, I tried to set some looser permissions from the properties > dialog. Lately sometimes it "sticks" and the changes I made are there > next time I check. And sometimes not. Irregardless, I can't write to > files in that folder. Error = You do not have permissions..... > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Mapped Drive > > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a > local drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading > the resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I > still am not able to > use it. > > It's very important as I, like most of you, need to > replicate a > clients setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another > instance of MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 17:54:16 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 18:54:16 -0400 Subject: [AccessD] Error 3027 Message-ID: <000001cbf31b$3b72b1b0$b2581510$@com> Hello, I wanted to fill a Query with AddNew and Update. But I get the error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." What can I do to fix this problem? TIA. Saludos Actuary Ralf Lister La Paz, Bolivia From stuart at lexacorp.com.pg Mon Apr 4 18:04:12 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:04:12 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000001cbf31b$3b72b1b0$b2581510$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> Message-ID: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Hard to say without seeing the query, but a common reason for a query being RO is that it doesn't include the PK of the table you are trying to update. -- Stuart On 4 Apr 2011 at 18:54, Ralf Lister wrote: > Hello, > > > > I wanted to fill a Query with AddNew and Update. But I get the error > message " Error 3027 at run time./ You can't update. The database a/o > object is "read only"." What can I do to fix this problem? > > > > TIA. > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 18:06:06 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 11:06:06 +1200 Subject: [AccessD] Archives Down Message-ID: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From charlotte.foust at gmail.com Mon Apr 4 18:24:28 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 16:24:28 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 18:49:34 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:49:34 +1000 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com>, <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg>, Message-ID: <4D9A590E.11612.3815C21C@stuart.lexacorp.com.pg> I assumed that the query was the source of a DAO.recordset in VBA. But I was wrong once before, it's conceivable that I am again. -- Stuart On 4 Apr 2011 at 16:24, Charlotte Foust wrote: > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 19:42:32 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 20:42:32 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: <000501cbf32a$5b411900$11c34b00$@com> Thank you all for your help. Charlotte, I`m gathering information data about one person, make some calculations and save this calculations in the fields of a query by Set dbs = CurrentDb Set rst = dbs.OpenRecordset("qryBeneficiosAlt") With rst .AddNew ![FechaCalculo] = Now ![Nombre] = gstrNombre ![Beneficiario] = gstrBeneficiario ![Edad] = gintEdad ![Sexo] = gstrSexo ![Densidad] = gintDensidad ![TasaActualUSD] = gsngTasaActualUSD ![TasaCompUSD] = gsngTasaCompUSD ![CC] = gsngCC ' CC = Compensacion de Cotizaciones ![PBR] = gsngPBR ' PBR = Pension Base Referencial ![LimSolInf] = gsngLimSolInf ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial ![PR] = gsngPR ' Porcentaje Referencial ![BeneficiosAltPension] = gsngBeneficiosAltPension ![ValorAportes] = gsngValorAportes ![GF] = gsngGF .Update End With to be able to make a report on this very query as a Control Source. After printing the report I delete the data in the query with "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. But at "AddNew I get this error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 From stuart at lexacorp.com.pg Mon Apr 4 20:28:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 11:28:51 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> Message-ID: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > .AddNew > > ![FechaCalculo] = Now > > ![Nombre] = gstrNombre > > ![Beneficiario] = gstrBeneficiario > > ![Edad] = gintEdad > > ![Sexo] = gstrSexo > > ![Densidad] = gintDensidad > > ![TasaActualUSD] = gsngTasaActualUSD > > ![TasaCompUSD] = gsngTasaCompUSD > > ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ![LimSolInf] = gsngLimSolInf > > ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ![PR] = gsngPR ' Porcentaje Referencial > > ![BeneficiosAltPension] = gsngBeneficiosAltPension > > ![ValorAportes] = gsngValorAportes > > ![GF] = gsngGF > > .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > > _____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 20:38:48 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 13:38:48 +1200 Subject: [AccessD] Creating ADE's in Access 2010 Message-ID: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Darryl.Collins at iag.com.au Mon Apr 4 20:54:32 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 11:54:32 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <201104050154.p351seYM014934@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hey, that is good to know. So this will create an A2003 version MDE that will run on both A2003 and A2007/10? I will try this at home later and see what happens. Nice if it works like I think it should and much easier than doing it the 'proper' way. cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, 5 April 2011 11:39 AM To: accessd at databaseadvisors.com Subject: [AccessD] Creating ADE's in Access 2010 For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Mon Apr 4 21:03:06 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 12:03:06 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <201104050154.p351seYM014934@databaseadvisors.com> References: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz>, <201104050154.p351seYM014934@databaseadvisors.com> Message-ID: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > From Darryl.Collins at iag.com.au Mon Apr 4 21:51:26 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 12:51:26 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Message-ID: <201104050251.p352pXOH017248@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am been largely ok with forward compatibility so far, although there has been some issues between 2003 and 2007. Might be fun to try this out though and see what happens with a 2007 'mde' in A2003 etc. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, 5 April 2011 12:03 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Creating ADE's in Access 2010 Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Gustav at cactus.dk Tue Apr 5 05:35:25 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 05 Apr 2011 12:35:25 +0200 Subject: [AccessD] Windows 8, Metro and modern UI Message-ID: Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screenshots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experience/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-revealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wallpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-transportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav From accessd at shaw.ca Tue Apr 5 12:47:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 5 Apr 2011 10:47:38 -0700 Subject: [AccessD] [dba-Tech] Windows 8, Metro and modern UI In-Reply-To: References: Message-ID: <0B83A3EE0FDC4839B506AFFA025B107D@creativesystemdesigns.com> Hi Gustav: The new designs looks (more like sounds) really interesting. I like that they are going more towards a flat and clean design with an emphasis on transitions. The only issues, especially if you are working with web based applications is the font options. There is only so much you can do with half dozen standard internal fonts you will find on every computer/browser as even the most fancy CSS has it limitations...and just downloading font images is not the answer if you application is going international. I have been working with this coding to allow a wider range of fonts to be deployed but there has to be a judicious trade off in performance and there is a limited set of size options. http://www.960development.com/how-to-write-cross-browser-font-face-syntax/ Jim -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, April 05, 2011 3:35 AM To: accessd at databaseadvisors.com; dba-tech at databaseadvisors.com Subject: [dba-Tech] Windows 8, Metro and modern UI Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screen shots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experi ence/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-r evealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wa llpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-tra nsportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com From EdTesiny at oasas.state.ny.us Tue Apr 5 14:22:18 2011 From: EdTesiny at oasas.state.ny.us (Tesiny, Ed) Date: Tue, 5 Apr 2011 15:22:18 -0400 Subject: [AccessD] Archives Down In-Reply-To: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> References: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: Nope, looks like it's down Ed Tesiny EdTesiny at oasas.state.ny.us -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, April 04, 2011 7:06 PM To: Access Developers discussion and problem solving Subject: [AccessD] Archives Down Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 5 15:02:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 15:02:26 -0500 Subject: [AccessD] Query grid question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From charlotte.foust at gmail.com Tue Apr 5 15:49:01 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:49:01 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> <000501cbf32a$5b411900$11c34b00$@com> Message-ID: You actually want to add data to tables, so why try to use the query to do so? In any case, if it isn't updateable it's usually because of the structure of the query. However, in your case, depending on the version of Access you're using, you haven't declared a recordset type, so your recordset may be a snapshot, which is not updatable by definition, regardless of whether the query is. Charlotte Foust On Mon, Apr 4, 2011 at 5:42 PM, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations ?and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > ? ?.AddNew > > ? ?![FechaCalculo] = Now > > ? ?![Nombre] = gstrNombre > > ? ?![Beneficiario] = gstrBeneficiario > > ? ?![Edad] = gintEdad > > ? ?![Sexo] = gstrSexo > > ? ?![Densidad] = gintDensidad > > ? ?![TasaActualUSD] = gsngTasaActualUSD > > ? ?![TasaCompUSD] = gsngTasaCompUSD > > ? ?![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ? ?![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ? ?![LimSolInf] = gsngLimSolInf > > ? ?![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ? ?![PR] = gsngPR ' Porcentaje Referencial > > ? ?![BeneficiosAltPension] = gsngBeneficiosAltPension > > ? ?![ValorAportes] = gsngValorAportes > > ? ?![GF] = gsngGF > > ? ?.Update > > End With > > > > to be able to make a report on this very query as a Control Source. After > printing the report I delete the data in the query with "DoCmd.RunSQL > "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You can't > update. The database a/o ?object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust > Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > > > Another possible reason is a multiple table query. ?Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: >> Hard to say without seeing the query, but a common reason for a query > being RO is that it >> doesn't include the PK of the table you are trying to update. >> >> -- >> Stuart >> >> On 4 Apr 2011 at 18:54, Ralf Lister wrote: >> >>> Hello, >>> >>> >>> >>> I wanted to fill a Query with AddNew and Update. But I get the error >>> message " Error 3027 at run time./ You can't update. The database a/o >>> object is "read only"." What can I do to fix this problem? >>> >>> >>> >>> TIA. >>> >>> >>> >>> Saludos >>> >>> Actuary Ralf Lister >>> >>> La Paz, Bolivia >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > ?_____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 5 15:50:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:50:15 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Tue Apr 5 16:03:30 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 16:03:30 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Here is a good example SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM WHERE Groups.Name like "MANIFOLD *" and Groups.Name not like "* AREA" and Groups.GroupingType="CGRP" and Members.ChildPTYPE="COMP" and Members.PID=Groups.PID and CM.PID=Members.ChildPID ORDER BY Members.ChildPID, Groups.Name; -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 3:50 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rlister at actuarial-files.com Tue Apr 5 17:50:03 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 18:50:03 -0400 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Message-ID: <000601cbf3e3$cedce560$6c96b020$@com> Thanks a lot Stuart, The SQL is: SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, tblWerte.BeneficiosAltPension, tblDisposiciones.GF FROM tblWerte, tblDisposiciones; Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations? and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > >???? .AddNew > >???? ![FechaCalculo] = Now > >???? ![Nombre] = gstrNombre > >???? ![Beneficiario] = gstrBeneficiario > >???? ![Edad] = gintEdad > >???? ![Sexo] = gstrSexo > >???? ![Densidad] = gintDensidad > >???? ![TasaActualUSD] = gsngTasaActualUSD > >???? ![TasaCompUSD] = gsngTasaCompUSD > >???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > >???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial > >???? ![LimSolInf] = gsngLimSolInf > >???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > >???? ![PR] = gsngPR ' Porcentaje Referencial > >???? ![BeneficiosAltPension] = gsngBeneficiosAltPension > >???? ![ValorAportes] = gsngValorAportes > >???? ![GF] = gsngGF > >???? .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o? object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query.? Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > >?? _____? > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:07:43 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:07:43 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000601cbf3e3$cedce560$6c96b020$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Tue Apr 5 18:16:11 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 19:16:11 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: <000d01cbf3e7$74facea0$5ef06be0$@com> Thank's Charlotte, Thank's a lot for your help. I wouldn't have found this silly error with your help. I'll join now the tables. Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Martes, 05 de Abril de 2011 07:08 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3553 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:19:03 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:19:03 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 5 22:54:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 05 Apr 2011 23:54:53 -0400 Subject: [AccessD] Autonumber when? Message-ID: <4D9BE40D.8050502@colbyconsulting.com> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From rusty.hammond at cpiqpc.com Tue Apr 5 23:02:58 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 5 Apr 2011 23:02:58 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Hi John, Do the following: .Update .BookMark = .LastModified mlngLogID = !PLSL_ID HTH Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 10:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Wed Apr 6 05:09:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 06:09:49 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C3BED.1000700@colbyconsulting.com> Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From ab-mi at post3.tele.dk Wed Apr 6 05:52:23 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 12:52:23 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <953E20402FC54D7AABE4F2578153A13D@abpc> Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. With rs .AddNew .!PLSL_IDPLSUSR = mlngIDUser .!PLSL_FE = CurrentProject.Name .!PLSL_Login = blnLogIn .!PLSL_WorkstationID = CurrentMachineName() On Error Resume Next .Update mlngLogID = .!PLSL_ID If Err Then mlngLogID = .!PLSL_ID End If .Close End With Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 12:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Wed Apr 6 06:06:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 13:06:52 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John How about: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 05:54 >>> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 06:57:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:57:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C5532.4060906@colbyconsulting.com> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > From jwcolby at colbyconsulting.com Wed Apr 6 06:58:01 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:58:01 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <953E20402FC54D7AABE4F2578153A13D@abpc> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <953E20402FC54D7AABE4F2578153A13D@abpc> Message-ID: <4D9C5549.2050804@colbyconsulting.com> Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> From Gustav at cactus.dk Wed Apr 6 07:44:24 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 14:44:24 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John No, it was not the same. It works! /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 13:57 >>> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? From Chester_Kaup at kindermorgan.com Wed Apr 6 07:38:28 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 6 Apr 2011 07:38:28 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> The grid is completely empty except for the two tables. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 6:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From ab-mi at post3.tele.dk Wed Apr 6 07:52:21 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 14:52:21 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5549.2050804@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><953E20402FC54D7AABE4F2578153A13D@abpc> <4D9C5549.2050804@colbyconsulting.com> Message-ID: <14A5B079377C4684B1473AEB5D140AAE@abpc> Ok, I see. Then try a MoveLast after the Update and before reading the new autonumber, i.e. With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .MoveLast mlngLogID = !PLSL_ID .Close End With Works for me. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 13:58 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Wed Apr 6 08:17:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 06:17:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: I don't know if this helps, but I always call @@IDENTITY in SQL to get the last PKID. Sent from my Droid phone. On Apr 5, 2011 8:56 PM, "jwcolby" wrote: > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 6 08:24:38 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 09:24:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <07790084744342A6AF9FAE17F48AF13D@XPS> John, You may find the following helpful: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6 -4e13-8876-f6e5faae8dba/ It pretty much covers what has already been said, but goes through some of the in's and out's of why one approach works or doesn't. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 11:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:25:29 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:25:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5532.4060906@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 08:25:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:25:45 -0400 Subject: [AccessD] I need help Message-ID: <4D9C69D9.6060702@colbyconsulting.com> In NC where I live, volunteers can check certain inmates out of prison for up to 6 hours for activities like church, AA meetings or pretty much anything legal. I have the required certification to do this and I am writing an application to assist volunteers such as myself in filling out leave pass requests for prison inmates. There is a web search site that anyone can use to search for and observe the information about inmates. I am inserting the URL complete with a random inmate selected. Watch for word wrap. http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=0012345&searchOffenderId=0012345&listurl=pagelistoffendersearchresults&listpage=1 What I need assistance with is reading the info at the very top of the Offender Info in order to extract this and automatically fill in a record in Access. IOW I search for and find an inmate, then I press a button and suck the info in that top area into a record. This will save a fair amount of typing. The problem is I have no idea how to do this. If I view the HTML I find an XML table that holds this stuff but how do I drill down to that area reliably, then extract the info? Preferably without doing it i some code intensive string manipulation way. I already have two other volunteers requesting my program, which I will be making available for free to any volunteers who do checkouts. I am trying to make this as user friendly as possible. Any help is much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 08:34:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:34:07 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C6BCF.1020100@colbyconsulting.com> Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against > a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > From rusty.hammond at cpiqpc.com Wed Apr 6 08:47:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 08:47:44 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> When you set your recordset are you using the dbSeeChanges option? You're code should look something like this: dim db as database dim rs as recordset set db=CurrentDB() set rs = db.openrecordset("tblName", dbOpenDynaset, dbSeeChanges) With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .BookMark = .LastModified mlngLogID = !PLSL_ID .Close End With -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 5:10 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From ab-mi at post3.tele.dk Wed Apr 6 08:49:57 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 15:49:57 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From mwp.reid at qub.ac.uk Wed Apr 6 08:50:21 2011 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 6 Apr 2011 14:50:21 +0100 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <631CF83223105545BF43EFB52CB08295470B44F4C7@EX2K7-VIRT-2.ads.qub.ac.uk> Might help http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6-4e13-8876-f6e5faae8dba/ Martin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 06 April 2011 14:34 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error > check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:58:42 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:58:42 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond Sent: Wednesday, April 06, 2011 9:50 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autonumber when? >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:01:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:01:04 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C7220.3060606@colbyconsulting.com> Lambert, I am actually doing *both*. The code needs to function for an MDB BE or an SQL BE. By testing BEFORE the save it works for DAO, the test AFTER the save (is supposed to) works for SQL. For whatever reason it doesn't work for the sql be. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:25 AM, Heenan, Lambert wrote: > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 6 09:01:47 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 10:01:47 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: As I said, look again John. You have... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With But Gustav (and me if I'd been quick enough) suggests... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. Lambert From jwcolby at colbyconsulting.com Wed Apr 6 09:06:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:06:59 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7383.4080009@colbyconsulting.com> Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? From jwcolby at colbyconsulting.com Wed Apr 6 09:15:41 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:15:41 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C758D.30905@colbyconsulting.com> It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Apr 6 09:19:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:19:34 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <4D9C7676.1000303@colbyconsulting.com> If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert From rusty.hammond at cpiqpc.com Wed Apr 6 09:21:02 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:21:02 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Yeah, there's something about linked SQL tables you have to set the recordset bookmark to the lastmodified record, after the update, before you can read the autonumber value when creating new records. It should work for both linked SQL tables and tables in an mdb so trying to read the value before the update isn't really necessary. Martin sent this link earlier that talks about it: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- 66a6-4e13-8876-f6e5faae8dba/ I've had this code running in an application for several years in Access 97 and 2003. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Wed Apr 6 09:38:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 10:38:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> John, A little code cleanup: Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Should be: Exit_mPLSLogin: On Error Resume Next If Not (rs Is Nothing) Then rs.Close Set rs = Nothing End If Exit Function Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:41:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:41:28 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7B98.9000909@colbyconsulting.com> It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, before > you can read the autonumber value when creating new records. It should > work for both linked SQL tables and tables in an mdb so trying to read > the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From jwcolby at colbyconsulting.com Wed Apr 6 09:45:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:45:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> Message-ID: <4D9C7C79.4070406@colbyconsulting.com> LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? From rusty.hammond at cpiqpc.com Wed Apr 6 09:46:37 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:46:37 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, now I remember what's going on. I had to go to Access 97 Developer's Handbook (page 269)to refresh my memory (page 1540 of the Access 2000 Developer's Handbook volume 1). You mentioned it in your original post that SQL doesn't create the autonumber value until after the record is created. When using the AddNew method on a Dynaset-type recordset, as soon as you do .Update, that new record gets added to the end of the recordset and is NOT the current record. To get to that new record, you use the .LastModified property of the recordset. You can use either of the following methods to get to the new record: .BookMark = .LastModified OR .Move 0, .LastModified Then get the value of the ID field. The nice thing is it works with either a linked SQL table or Access table. You new code should look like the following (I've rem'ed out your existing lines so you can see the changes): ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() 'Take out the following two lines - get the ID value after the Update - RustyH 'On Error Resume Next 'mlngLogID = !PLSL_ID .Update 'Added the following line - RustyH .BookMark = .LastModified 'If Err Then mlngLogID = !PLSL_ID 'End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Wed Apr 6 09:57:51 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:57:51 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7B98.9000909@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7B98.9000909@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12D@CPIEMAIL-EVS1.CPIQPC.NET> Because the record isn't actually saved to the table until you do .Update. It's like creating a new record on a data entry form or directly in the table. You can click the AddNew button and enter data in the fields but until you move to another record or hit the Save Record button, the record isn't saved yet. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:41 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, > before you can read the autonumber value when creating new records. > It should work for both linked SQL tables and tables in an mdb so > trying to read the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c84 > 5- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in > Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As > DAO.Recordset Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or > review by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:12:57 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:12:57 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7676.1000303@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:20 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:17:50 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:17:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: Although that theory may get blown out of the water as Err should in fact retain its value even after the .Update statement. I just checked with this Sub Err_Test() Dim n As Long On Error Resume Next n = 10 / 0 n = 10 Debug.Print n, Err.Number End Sub Which outputs 10, 11 (as error 11 is Div by zero). But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 06, 2011 11:13 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert From Gustav at cactus.dk Wed Apr 6 10:41:41 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 17:41:41 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi Lambert I found out that you read out the value from the record you were at before calling .AddNew. That fooled me. But no error was raised which is what fooled JC. However, Rusty described how to do it with .LastModified which method I tested with success. /gustav >>> Lambert.Heenan at chartisinsurance.com 06-04-2011 17:17 >>> But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. From ab-mi at post3.tele.dk Wed Apr 6 10:31:25 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 17:31:25 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C758D.30905@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> <4D9C758D.30905@colbyconsulting.com> Message-ID: Correct. The identity column I used has a clustered PK. If that's not the case then you could open the recordset using a sql ordering by PLSL_ID and using the dbOpenDynaset, dbSeeChanges option. As for another record being inserted before moving last: if that's a risk then you should make the insert calling a sp in SQL Server. In this sp you can use SCOPE_IDENTITY() to get the last identity ("autonumber") value created by the procedure. (Don't use @@IDENTITY for this, since it might eventually return an identity value created by a trigger for your table.) Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 16:16 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 6 10:39:32 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 6 Apr 2011 08:39:32 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Wed Apr 6 10:43:50 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 11:43:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7C79.4070406@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> <4D9C7C79.4070406@colbyconsulting.com> Message-ID: <1751F81B42C84B468378B7D3CEC911A2@XPS> John, Don't remember exactly why, but it was important not to attempt the close if the object variable was already nothing, so therefore the check. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:45 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 14:45:22 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 15:45:22 -0400 Subject: [AccessD] IE search for table Message-ID: <4D9CC2D2.60402@colbyconsulting.com> Function mSearchTable() Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And Len(strOffenderInfo) = 0 Then strOffenderInfo = strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And Len(strMostRecent) = 0 Then strMostRecent = strInnerText End If End If Next varTable Debug.Print strOffenderInfo Debug.Print strMostRecent Cleanup: Set varTable = Nothing: Set varTables = Nothing 'objIE.Quit 'Set objIE = Nothing End Function -- John W. Colby www.ColbyConsulting.com From kismert at gmail.com Wed Apr 6 15:13:46 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 6 Apr 2011 15:13:46 -0500 Subject: [AccessD] Autonumber when? Message-ID: > > jwcolby > ... > The code needs to work whether going to an MDB or SQL BE. The code works > fine for an MDB BE but fails for a SQL BE. > ... > John, This is probably what you are trying to avoid, but I'll say it anyway: You should write separate code to handle the MDB and SQL Server BEs. First, the obvious: Jet and SQL Server are very different. * It is unlikely that this is the only variation you will have to account for throughout your code * Variations in code make it harder to test * When you do want to use SQL Server-specific features, like stored procedures, you will have to split the code anyway * I have a personal distaste of "On Error Resume Next" coding, which I use only for object cleanup code where there is literally nothing to raise an error to. All told, the cost and effort to make a large existing code base generic will likely exceed the cost of just splitting it neatly into libraries that support each database type. Plus, you get more modular, flexible, testable code. Again, this is what you are trying to avoid, but I felt I should say it, anyway. -Ken From jwcolby at colbyconsulting.com Wed Apr 6 15:38:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 16:38:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9CCF35.3030705@colbyconsulting.com> I hear you Ken. I have written a framework for MDB BEs. It is very large, and has tons of functionality, and was never intended to run against SQL Server simply because nobody was using that back when I wrote it. Now I am trying to use it for a SQL Server back end. It is not just a simple case of "write a library for this and a library for that. Additionally I need it to work where this table (or set of tables) is kept in an MDB and that one is moved to SQL. I write frameworks. The framework does a ton of stuff which is handled automatically. It handles the not in list and the dbl click of combos for example. The dbl click of a combo opens a form and moves to the record that the combo is displaying. Classes instantiate classes which instantiate classes. I am just not sure that "writing separate libs" is a viable option. It would mean a complete rewrite of the framework and then a complete rewrite of the FE. John W. Colby www.ColbyConsulting.com On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >> jwcolby >> ... >> The code needs to work whether going to an MDB or SQL BE. The code works >> fine for an MDB BE but fails for a SQL BE. >> ... >> > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken From davidmcafee at gmail.com Wed Apr 6 15:58:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 13:58:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9CCF35.3030705@colbyconsulting.com> References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: Perfect time to rewrite it for "unbound" >:P On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > On 4/6/2011 4:13 PM, Kenneth Ismert wrote: > >> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >>> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I >> use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries >> that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 6 16:20:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:20:08 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: <4D9CD908.8050904@colbyconsulting.com> ;) John W. Colby www.ColbyConsulting.com On 4/6/2011 4:58 PM, David McAfee wrote: > Perfect time to rewrite it for "unbound">:P > > > On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >>> >>>> jwcolby >>>> ... >>>> The code needs to work whether going to an MDB or SQL BE. The code works >>>> fine for an MDB BE but fails for a SQL BE. >>>> ... >>>> >>>> >>> John, >>> >>> This is probably what you are trying to avoid, but I'll say it anyway: >>> >>> You should write separate code to handle the MDB and SQL Server BEs. >>> >>> First, the obvious: Jet and SQL Server are very different. >>> * It is unlikely that this is the only variation you will have to account >>> for throughout your code >>> * Variations in code make it harder to test >>> * When you do want to use SQL Server-specific features, like stored >>> procedures, you will have to split the code anyway >>> * I have a personal distaste of "On Error Resume Next" coding, which I >>> use >>> only for object cleanup code where there is literally nothing to raise an >>> error to. >>> >>> All told, the cost and effort to make a large existing code base generic >>> will likely exceed the cost of just splitting it neatly into libraries >>> that >>> support each database type. >>> >>> Plus, you get more modular, flexible, testable code. >>> >>> Again, this is what you are trying to avoid, but I felt I should say it, >>> anyway. >>> >>> -Ken >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at colbyconsulting.com Wed Apr 6 16:23:21 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:23:21 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CD9C9.7090909@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 16:25:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:25:39 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CDA53.2090800@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From Chester_Kaup at kindermorgan.com Thu Apr 7 07:41:44 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 7 Apr 2011 07:41:44 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB04055@houex1.kindermorgan.com> The query runs OK. The number of returned records is the same as what I would call a normal query. Something like this. SELECT GroupMaster.Name, dbo_DSS_CompletionMaster.PID, ConfigMaster.WellName FROM dbo_DSS_CompletionMaster INNER JOIN (ConfigMaster INNER JOIN GroupMaster ON ConfigMaster.PID = GroupMaster.PID) ON dbo_DSS_CompletionMaster.PID = ConfigMaster.ChildPID WHERE (((GroupMaster.Name) Like "Manifold*" And (GroupMaster.Name) Not Like "*Area")); -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 06, 2011 10:40 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 7 16:47:24 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 7 Apr 2011 14:47:24 -0700 Subject: [AccessD] E Mail hyperlink In-Reply-To: <4D9C69D9.6060702@colbyconsulting.com> References: <4D9C69D9.6060702@colbyconsulting.com> Message-ID: Hello, I using Access 2003 to create a contact database. I am trying to create a field (which is currently text) in a table (or the related form) which acts as hyperlink to the email address which is typed in there for each contact. i.e. we want to be able to click on the field and have it open to new mail message. Can you tell me how to do this please? I have gotten so far as to be able to right click on the control and edit hyperlink to indicate that it is an email address, but then it wants me to type in the address. I can't do this for all 5K+. Other than just leaving the data in text and automating Outlook via vba when clicking the control.... Just seems like I should be able to do this. bob heygood From stuart at lexacorp.com.pg Thu Apr 7 17:09:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 08 Apr 2011 08:09:55 +1000 Subject: [AccessD] E Mail hyperlink In-Reply-To: References: <4D9C69D9.6060702@colbyconsulting.com>, Message-ID: <4D9E3633.21526.A28319F@stuart.lexacorp.com.pg> Sub txtEmail_DoubleClick() Docmd.SendObject vbSendNoObject,,,txtEmail,,,,,True, End Sub On 7 Apr 2011 at 14:47, b heygood wrote: > Hello, I using Access 2003 to create a contact database. I am trying > to create a field (which is currently text) in a table (or the related > form) which acts as hyperlink to the email address which is typed in > there for each contact. i.e. we want to be able to click on the field > and have it open to new mail message. Can you tell me how to do this > please? > > I have gotten so far as to be able to right click on the control and > edit hyperlink to indicate that it is an email address, but then it > wants me to type in the address. I can't do this for all 5K+. > > Other than just leaving the data in text and automating Outlook via > vba when clicking the control.... Just seems like I should be able to > do this. > > bob heygood > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Apr 7 21:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 07 Apr 2011 22:46:37 -0400 Subject: [AccessD] data validation Message-ID: <4D9E770D.5030102@colbyconsulting.com> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Apr 8 02:27:38 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 08 Apr 2011 09:27:38 +0200 Subject: [AccessD] data validation Message-ID: Hi John I think a lot depends on your user interface. We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. /gustav >>> jwcolby at colbyconsulting.com 08-04-2011 04:46 >>> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From adtp at airtelmail.in Fri Apr 8 04:06:55 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Fri, 8 Apr 2011 14:36:55 +0530 Subject: [AccessD] data validation References: <4D9E770D.5030102@colbyconsulting.com> Message-ID: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> J.C., In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). Best wishes, A.D.Tejpal ------------ Brief Description (Sample Db: DentalAppointments) ========================= This sample db demonstrates Appointments Planner for a dental clinic having two chairs. The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. Caution - (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open & use the sample db. (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. Version - Access 2000 file format Reference - DAO 3.6 ======================================= ----- Original Message ----- From: jwcolby To: Access Developers discussion and problem solving Sent: Friday, April 08, 2011 08:16 Subject: [AccessD] data validation Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 8 08:00:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:00:48 -0400 Subject: [AccessD] data validation In-Reply-To: References: Message-ID: <4D9F0700.7050109@colbyconsulting.com> Thanks Gustav. I haven't wrapped my mind around the "how to" do adjustments. The data is entered into a main form (pass request) sub form (request detail), with the request detail being a continuous form. AFAICT I can't write back to the subform controls because (AFAIK) doing so writes that value into every record. I would have to write them back to the table using SQL and then requery the subform to show the changes. An additional issue is that these forms are bound to SQL Server data through linked tables. I too am looking at using the recordset clone, however one of the issues I am trying to work around is that if I move to binding the form to an ADO recordset, then the RecordsetClone property becomes non-functional. I am going to put this in the "ToDo" file I think and get some other, less... "complicated" issues handled first. John W. Colby www.ColbyConsulting.com On 4/8/2011 3:27 AM, Gustav Brock wrote: > Hi John > > I think a lot depends on your user interface. > > We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. > If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. > > The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. > > /gustav > > >>>> jwcolby at colbyconsulting.com 08-04-2011 04:46>>> > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to > check the details against itself, with a collection to hold the time classes. Time classes have > code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > From jwcolby at colbyconsulting.com Fri Apr 8 08:21:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:21:34 -0400 Subject: [AccessD] data validation In-Reply-To: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> References: <4D9E770D.5030102@colbyconsulting.com> <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> Message-ID: <4D9F0BDE.9010700@colbyconsulting.com> Thanks A.D. These time slots are entirely determined by the user, and can be any length. Basically the user decides "I will be in this location from time X to time Y". The times have to be non-overlapping to other time slots and entirely contained within the pass request times. I actually have a function that takes a pair of data points, each data point consisting of PK, time from and time to and returns a boolean true if they collide. It was written to handle comparing two records. John W. Colby www.ColbyConsulting.com On 4/8/2011 5:06 AM, A.D. Tejpal wrote: > J.C., > > In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: > http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 > > The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. > > When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. > > You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). > > A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). > > Best wishes, > A.D.Tejpal > ------------ > > Brief Description > (Sample Db: DentalAppointments) > ========================= > This sample db demonstrates Appointments Planner for a dental clinic having two chairs. > > The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. > > If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). > > Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. > > Caution - > (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open& use the sample db. > > (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. > > Version - Access 2000 file format > > Reference - DAO 3.6 > ======================================= > > ----- Original Message ----- > From: jwcolby > To: Access Developers discussion and problem solving > Sent: Friday, April 08, 2011 08:16 > Subject: [AccessD] data validation > > > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > -- > John W. Colby > www.ColbyConsulting.com From gustav at cactus.dk Sat Apr 9 03:54:55 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 09 Apr 2011 10:54:55 +0200 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Message-ID: Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug From accessd at shaw.ca Sat Apr 9 20:35:29 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 9 Apr 2011 18:35:29 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! In-Reply-To: References: Message-ID: Hi Gustav: Thanks for posting this. There is a fix/patch for all application other than those using VBA (C++ and .Net) and having installed Windowss7 SP1. Currently there is no solution. http://support.microsoft.com/kb/2517589 This is a major major type ADO error and it may very put an end to a large project I am working on. :-( I think I am going to have a couple of beer tonight and not even think about computers...two months of work shot and no work-around. Most of my large clients (they are banks but I do not program for them just hardware) are still using XP so I am sure they are aware of this issue and how interested will they now be in considering an upgrade? Such an error would mean millions to them. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 09, 2011 1:55 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissue s/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From listmaster at databaseadvisors.com Sat Apr 9 20:50:16 2011 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sat, 9 Apr 2011 21:50:16 -0400 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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 bill_patten at embarqmail.com Sun Apr 10 01:14:18 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 9 Apr 2011 23:14:18 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Resent after meltdown. In-Reply-To: References: Message-ID: <67E0822B933B446893A4CD21E01864DF@BPCS> Thanks for the update Gustav, Finally showing that the problem effected more than dot net and 32/64 client issues helps, and had I known that 2 weeks ago would have probably saved me some time. I am lucky, I only have 2 clients using my ADP's at this time. Both are fully developed and are just in a maintenance mode so I don't have to work on them very much. The problem with both clients was solved by transferring the application to one of my XP machines, decompiling, and recompiling in the XP Machine and shipping to the clients. I still don't understand why some PC's worked and some didn't but now they all work. Since my machine caused the problem, (Win 7 64 SP1) I don't think I should bill my clients so I'm sure I can send the bill for 10 hours of trouble shooting and testing to Microsoft. Ya Think? Bill -------------------------------------------------- From: "Gustav Brock" Sent: Saturday, April 09, 2011 1:54 AM To: Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Sun Apr 10 12:39:16 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 10 Apr 2011 10:39:16 -0700 Subject: [AccessD] OT - Home networking question Message-ID: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug From accessd at shaw.ca Sun Apr 10 13:32:00 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 10 Apr 2011 11:32:00 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <188AEE9832FD4C49B6748669D96F689E@creativesystemdesigns.com> Hi Doug: Off the top, as you appears to be using a simple work-group type network, with no servers, the first things to check if a computer is not seeing the network, would be one of three items: 1. The workgroup name has to be the same on all your computers. 2. The IP range has to be the same i.e. 192.168.177.xxx where xxx is a different value for every computer on the network. (Note: the value 177 can be any number but it also must be consistent network wide) 3. The subnet mask usually defaults to 255.255.255.0...check for a key-in error. If these items are checked and are consistent then we have to look at the router configuration and whether you are using your ISP as your domain controller which will make it a whole different ball of wax. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 10:39 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Sun Apr 10 13:34:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sun, 10 Apr 2011 13:34:19 -0500 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: Download nbtscan http://www.softpedia.com/progDownload/nbtscan-Download-100891.html Rename the .exe downloaded to nbtscan.exe (get rid of the version numbers in the file name) Then, from a command prompt, run: Nbtscan 192.168.0.1-255 (where this would be if the IP of your machine is 192.168.0.x (otherwise change the first three numbers to that of your network) You'll then get a list of IP addresses on your network. However, if you actually have 3 routers plugged into the hub, you may have 3 separate routers, each with their own subnet. If the routers don't know what's on the other routers, then you may not be able to communicate between networks..... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 12:39 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Sun Apr 10 17:46:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 11 Apr 2011 08:46:38 +1000 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Mon Apr 11 11:17:08 2011 From: jedi at charm.net (Michael Bahr) Date: Mon, 11 Apr 2011 12:17:08 -0400 (EDT) Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> What Stuart suggest is a much better design. For the home, in most cases, you only need 1 router right after the modem. Then everybody else connects to the router either through wireless or switches to extend the ethernet. 1. Replace the hub with a router. 2. Replace the 3 routers (behind the hub) with switches--not hubs. Mike > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable > modem and > hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 11:27:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:27:10 -0400 Subject: [AccessD] New Language In-Reply-To: <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> Message-ID: <4DA32BDE.4020100@colbyconsulting.com> My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > From dw-murphy at cox.net Mon Apr 11 11:52:12 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 09:52:12 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <003c01cbf868$d4127de0$7c3779a0$@cox.net> Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 11:57:17 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:57:17 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> Message-ID: <4DA332ED.5040905@colbyconsulting.com> 3) Make sure your switches are gigabit! John W. Colby www.ColbyConsulting.com On 4/11/2011 12:17 PM, Michael Bahr wrote: > What Stuart suggest is a much better design. For the home, in most cases, > you only need 1 router right after the modem. Then everybody else > connects to the router either through wireless or switches to extend the > ethernet. > > 1. Replace the hub with a router. > 2. Replace the 3 routers (behind the hub) with switches--not hubs. > > Mike > >> Are you sure that your terminology if correct? >> >> It would make more sense if you has one router attached to your cable >> modem and >> hubs/switches connected to that router from the three locations. >> >> Can you give us the make/model numbers of these devices? >> >> -- >> Stuart >> >> >> On 10 Apr 2011 at 10:39, Doug Murphy wrote: >> >>> Folks, >>> >>> I know there are several members of this group who are knowledgeable >>> about computer networking. We have a network in our home/offices that >>> has evolved over time. The basic configuration is that out of our >>> cable modem there is an Ethernet hub. 3 cables come out of this hub >>> and go to routers, one in my office in one part of the house, one in >>> my wife's office, and one to our wifi. These have been added as >>> requirements came about so this probably isn't the best configuration. >>> At the present we don't use the network to access machines in other >>> parts of the system. I have several in my office that access each >>> other, but they are on the same router. I do want to stay with the >>> wired systems to the offices. We just added a home security system >>> that can be monitored over the network. It is connected to my router >>> as it is closest to the box. I can access the system by typing in it's >>> IP address. Now I am trying to access it from other points in the >>> network and the IP is not visible. As you can probably tell I am >>> network challenged. I think what I need to do is find the IP address >>> of the security system from outside my router. How can this be done? >>> >>> Thanks >>> >>> Doug >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From kismert at gmail.com Mon Apr 11 12:10:29 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 12:10:29 -0500 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] Message-ID: John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > From accessd at shaw.ca Mon Apr 11 12:32:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 10:32:07 -0700 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: Excellent summary and words (code) to live by. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Monday, April 11, 2011 10:10 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: Autonumber when?] John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 12:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 13:47:23 -0400 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: <4DA33EAB.70505@colbyconsulting.com> Ken, I understand the reasoning and all however... because the code is no longer contained within the object that needs it, you now open yourself up to the old "I need to modify this method... oops... that change breaks something else that uses the code". Class programming exists for a reason. Placing code in the object that needs the code exists for a reason. Black box programming exists for a reason. The reason in many cases is to prevent exactly this kind of interaction when we accidentally change a piece of code used in many places and break one of those places. Yes, there are instances where lots of different things need the exact same code, and yes, I have been known to call module functions from classes, but it truly is a questionable practice in most cases. John W. Colby www.ColbyConsulting.com On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > John, All: > > I'm going to expand a little on what I'm trying to get at. This post really > isn't advice on what you should do. And it certainly isn't criticism. > > I have been returning to the old Lisp idea of functional programming: > libraries of functions that act only on their inputs and only return a > result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > external variables are never referenced. If a function needs to return > complex information, it returns either a type or an object. Database > functions unavoidably have side-effects, but these are regarded as > 'external' to the code, and are explicitly documented. > > The thing that surprised me was how well libraries play with objects. > Libraries provide discrete, testable chunks of code that support any > instance. Libraries separate functions into common-sense groups. Classes > provide an instance wrapper over the libraries, stringing functions together > to support the application. > > Plus, it is pretty easy to convert classes to this scheme while maintaining > compatibility. > > The advantages became apparent when I refactored some of my early monolithic > classes. These large, 'kitchen sink' classes had dozens of methods which > mixed database, business, and application functionality. They were unwieldy, > hard-to-understand, and hard-to-extend. I simply copied the class into a > module, stripped out the instance stuff (properties and module-level > variables), and turned the methods into side-effect-free functions. I then > stripped out the code within the original class methods, turning them into > wrappers calling library functions with their instance variables. > > The result: classes become lightweight, making their functionality much more > obvious. Compatibility is maintained, but the new system is much easier to > refactor and extend. > > The class on-top-of function approach is also a good answer to those who > want to re-use your code, but can't because they need some method that is > marked private in a class. They typically demand that all methods be made > public, which is usually silly because the class designer has good reasons > for limiting the public visibility of certain methods or properties. > > But with a function library, you can have your cake and eat it, too. Classes > hold the instance information, and interact with libraries in an > instance-safe way, because the functions never modify their inputs. Others > with different needs can call the functions directly, or write their own > classes. Heck, I even find myself cramped by my own classes at times, and > having the option to call underlying functions directly has benefited me. > > Writing test code for functions is much easier than for complex class > systems. Test code provides reasonable proof of reliability. Reliable > complexity can only be built out of small, simple, understandable, and > testable pieces. > > -Ken > > >> ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Wed, 6 Apr 2011 15:13:46 -0500 >> Subject: Re: [AccessD] Autonumber when? >>> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> >> >> >> ---------- Forwarded message ---------- >> From: jwcolby >> To: Access Developers discussion and problem solving< >> accessd at databaseadvisors.com> >> Date: Wed, 06 Apr 2011 16:38:13 -0400 >> Subject: Re: [AccessD] Autonumber when? >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> From rusty.hammond at cpiqpc.com Mon Apr 11 13:00:35 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:00:35 -0500 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Mon Apr 11 13:05:06 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:05:06 -0500 Subject: [AccessD] New Language In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, that's my duh moment for the afternoon. I'll look at the msdn link below. Rusty -----Original Message----- From: Rusty Hammond Sent: Monday, April 11, 2011 1:01 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Mon Apr 11 13:45:52 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Mon, 11 Apr 2011 14:45:52 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <003c01cbf868$d4127de0$7c3779a0$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> Message-ID: <4CF42796B1DC41E2B84C92485E599533@LaptopII> Doug, No need to replace the three routers; use can use them as a hub. The trick is to disable the DNS in reach, set RIP to none, and then when you connect to the one router after the cable modem, plug the cable into the LAN port (not the WAN port as it is now). This also effectively turns a Wireless Router into a simple Wireless Access point. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 11, 2011 12:52 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 14:14:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:14:50 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3532A.9040606@colbyconsulting.com> And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From jwcolby at colbyconsulting.com Mon Apr 11 14:16:12 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:16:12 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3537C.7010509@colbyconsulting.com> Oh... some routers use 192.168.1.xx instead of 1.9.168.0.xx in which case you have to modify my previous advice to match what your router uses. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From accessd at shaw.ca Mon Apr 11 14:58:10 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 12:58:10 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> My daughters have all grown up with computers. From childhood, their rooms have been wired for computers...coax cable and all. My oldest daughter learned to type on the keyboard before she could talk. She would sit in my lap and enter the keys as I called them out. She could start up the Commodore 64 and load games from memory. My youngest daughter made her first web site when she was ten, a Sailor-moon site. ;-) At that time she used notepad to build her site and she knew more about web sites and HTML coding than I did. Today, both my daughters are married or in a long term relationship with programmers (both with a least one degree in computer science) and they all work in the business; one in computer graphic designer (and fashion design) and two in animation and one as an application developer but if pushed the girls are both pretty good programmers (At the age of 15 my oldest daughter was short-listed in a job competition and the company sent her their whole software line as a consolation...It was Blizzard software with Warcraft etc.) The one I feel sorry for is my wife Maria who totally non-computer literate and has to listen to rest of the family talk shop and coding etc. at ever family gathering. I really hope your wife likes computers. ;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 9:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 15:02:08 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 13:02:08 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA3532A.9040606@colbyconsulting.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> Message-ID: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Mon Apr 11 15:09:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 15:09:32 -0500 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: John, I understand the reasoning and all however... because the code is no longer > contained within the object that needs it, you now open yourself up to the > old "I need to modify this method... oops... that change breaks something > else that uses the code". > It is always possible to over-factor, and merge two similar pieces of code together that really should be separate. In that case, you factor the code back into multiple pieces, and correct the dependencies. > Class programming exists for a reason. Placing code in the object that > needs the code exists for a reason. Black box programming exists for a > reason. The reason in many cases is to prevent exactly this kind of > interaction when we accidentally change a piece of code used in many places > and break one of those places. > I would submit that calling side-effect free functions from a class does not pierce the black box. The important things, state and access, are protected by the class. But the function can be anywhere: built-in VBA functions, Access application methods, or DAO library calls. You undoubtedly call these functions from within your classes. > Yes, there are instances where lots of different things need the exact same > code, and yes, I have been known to call module functions from classes, but > it truly is a questionable practice in most cases. > Test cases replace questionability with a guarantee of proper function. The function shouldn't define what it does -- the test cases should. If changes to a function break a test, then you know immediately that there is a problem. Functional unit testing guards against changes that would break dependent code. I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. -Ken > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > >> John, All: >> >> I'm going to expand a little on what I'm trying to get at. This post >> really >> isn't advice on what you should do. And it certainly isn't criticism. >> >> I have been returning to the old Lisp idea of functional programming: >> libraries of functions that act only on their inputs and only return a >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> external variables are never referenced. If a function needs to return >> complex information, it returns either a type or an object. Database >> functions unavoidably have side-effects, but these are regarded as >> 'external' to the code, and are explicitly documented. >> >> The thing that surprised me was how well libraries play with objects. >> Libraries provide discrete, testable chunks of code that support any >> instance. Libraries separate functions into common-sense groups. Classes >> provide an instance wrapper over the libraries, stringing functions >> together >> to support the application. >> >> Plus, it is pretty easy to convert classes to this scheme while >> maintaining >> compatibility. >> >> The advantages became apparent when I refactored some of my early >> monolithic >> classes. These large, 'kitchen sink' classes had dozens of methods which >> mixed database, business, and application functionality. They were >> unwieldy, >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> module, stripped out the instance stuff (properties and module-level >> variables), and turned the methods into side-effect-free functions. I then >> stripped out the code within the original class methods, turning them into >> wrappers calling library functions with their instance variables. >> >> The result: classes become lightweight, making their functionality much >> more >> obvious. Compatibility is maintained, but the new system is much easier to >> refactor and extend. >> >> The class on-top-of function approach is also a good answer to those who >> want to re-use your code, but can't because they need some method that is >> marked private in a class. They typically demand that all methods be made >> public, which is usually silly because the class designer has good reasons >> for limiting the public visibility of certain methods or properties. >> >> But with a function library, you can have your cake and eat it, too. >> Classes >> hold the instance information, and interact with libraries in an >> instance-safe way, because the functions never modify their inputs. Others >> with different needs can call the functions directly, or write their own >> classes. Heck, I even find myself cramped by my own classes at times, and >> having the option to call underlying functions directly has benefited me. >> >> Writing test code for functions is much easier than for complex class >> systems. Test code provides reasonable proof of reliability. Reliable >> complexity can only be built out of small, simple, understandable, and >> testable pieces. >> >> -Ken >> >> From charlotte.foust at gmail.com Mon Apr 11 15:22:19 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 13:22:19 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: I have to say, that I would put those module level functions into a utility class and call the class method. I don't like calling module level stuff from a class. The built in things you call are already part of a library/dll so it isn't the same. Charlotte Foust On Mon, Apr 11, 2011 at 1:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. ?Placing code in the object that >> needs the code exists for a reason. ?Black box programming exists for a >> reason. ?The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. ?Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 15:25:26 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:25:26 -0400 Subject: [AccessD] New Language In-Reply-To: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> Message-ID: <4DA363B6.8000005@colbyconsulting.com> My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim From jwcolby at colbyconsulting.com Mon Apr 11 15:36:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:36:04 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA36634.3080604@colbyconsulting.com> > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object that >> needs the code exists for a reason. Black box programming exists for a >> reason. The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> From dw-murphy at cox.net Mon Apr 11 15:42:36 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 13:42:36 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <006c01cbf888$fded7730$f9c86590$@cox.net> Great info. Thanks guys. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Apr 11 16:59:04 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 01:59:04 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA36634.3080604@colbyconsulting.com> References: <4DA36634.3080604@colbyconsulting.com> Message-ID: <85CF23CEAE904982B6ED4556F847CB7B@nant> <<< I doubt seriously that anyone uses your paradigm in .net. >>> http://fsharp.net ? -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 12 ?????? 2011 ?. 0:36 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no > longer >> contained within the object that needs it, you now open yourself up >> to the old "I need to modify this method... oops... that change >> breaks something else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object >> that needs the code exists for a reason. Black box programming >> exists for a reason. The reason in many cases is to prevent exactly >> this kind of interaction when we accidentally change a piece of code >> used in many places and break one of those places. >> > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > >> Yes, there are instances where lots of different things need the >> exact same code, and yes, I have been known to call module functions >> from classes, but it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really isn't advice on what you should do. And it certainly isn't >>> criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return >>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>> modified, and external variables are never referenced. If a function >>> needs to return complex information, it returns either a type or an >>> object. Database functions unavoidably have side-effects, but these >>> are regarded as 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. >>> Classes provide an instance wrapper over the libraries, stringing >>> functions together to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic classes. These large, 'kitchen sink' classes had dozens >>> of methods which mixed database, business, and application >>> functionality. They were unwieldy, hard-to-understand, and >>> hard-to-extend. I simply copied the class into a module, stripped >>> out the instance stuff (properties and module-level variables), and >>> turned the methods into side-effect-free functions. I then stripped >>> out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality >>> much more obvious. Compatibility is maintained, but the new system >>> is much easier to refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those >>> who want to re-use your code, but can't because they need some >>> method that is marked private in a class. They typically demand that >>> all methods be made public, which is usually silly because the class >>> designer has good reasons for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. >>> Others with different needs can call the functions directly, or >>> write their own classes. Heck, I even find myself cramped by my own >>> classes at times, and having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex >>> class systems. Test code provides reasonable proof of reliability. >>> Reliable complexity can only be built out of small, simple, >>> understandable, and testable pieces. >>> >>> -Ken >>> >>> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 17:07:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 15:07:07 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA363B6.8000005@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> Message-ID: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> It sounds like your daughter has a very rare disease and her life will be very challenged. It does appear that she is growing up in the best environment and will be able to reach her full potential. It seems that she has achieved a great deal and has an almost gifted ability with computers. Your little scientist sounds like he is off to a great start and with you as his father his success is assured. Now I had better watch out for the Off Topic police...;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Mon Apr 11 18:35:02 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 12 Apr 2011 09:35:02 +1000 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <201104112335.p3BNZAnu007707@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Hi John, My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. good luck John, keep keeping us informed on your progress here. regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 12 April 2011 2:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From BradM at blackforestltd.com Mon Apr 11 20:04:51 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Mon, 11 Apr 2011 20:04:51 -0500 Subject: [AccessD] New Language References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Mon Apr 11 20:17:17 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 18:17:17 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no "module", > though there can be static classes / functions. ?I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Apr 11 21:39:31 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 19:39:31 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <000301cbf8ba$d9f66440$8de32cc0$@cox.net> Thanks all. A few of your suggested tweaks and all is good. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 00:58:20 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 09:58:20 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA36634.3080604@colbyconsulting.com><85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: Hi Charlotte -- No, wait - in fact VB.NET and C# do support first-order functional programming paradigms (LINQ and related stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html And here they say that MS Excel is a kind of functional programming environment http://en.wikipedia.org/wiki/Functional_programming So you should know and use them for quite some time already - foundations of functional programming paradigm... :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 12 ?????? 2011 ?. 5:17 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no > "module", though there can be static classes / functions. ?I haven't > done a poll, but I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you >> factor the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and >> access, are protected by the class. But the function can be anywhere: >> built-in VBA functions, Access application methods, or DAO library >> calls. You undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test >> cases should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This >>>> post really isn't advice on what you should do. And it certainly >>>> isn't criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only >>>> return a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a >>>> function needs to return complex information, it returns either a >>>> type or an object. Database functions unavoidably have >>>> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support >>>> any instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to >>>> those who want to re-use your code, but can't because they need >>>> some method that is marked private in a class. They typically >>>> demand that all methods be made public, which is usually silly >>>> because the class designer has good reasons for limiting the public >>>> visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying >>>> functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> From jwcolby at colbyconsulting.com Tue Apr 12 05:18:31 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:18:31 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: <4DA426F7.7000803@colbyconsulting.com> Well, now we are all happy! ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 5:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net.>>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? Everything is an object. There is no "module", > though there can be static classes / functions. I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. Placing code in the object >>> that needs the code exists for a reason. Black box programming >>> exists for a reason. The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 12 05:50:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:50:28 -0400 Subject: [AccessD] New Language In-Reply-To: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> Message-ID: <4DA42E74.6040007@colbyconsulting.com> > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim From jwcolby at colbyconsulting.com Tue Apr 12 08:03:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 09:03:11 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA44D8F.7060106@colbyconsulting.com> I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... From jimdettman at verizon.net Tue Apr 12 09:09:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 12 Apr 2011 10:09:29 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA44D8F.7060106@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rusty.hammond at cpiqpc.com Tue Apr 12 09:15:00 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 12 Apr 2011 09:15:00 -0500 Subject: [AccessD] New Language In-Reply-To: References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14E@CPIEMAIL-EVS1.CPIQPC.NET> Thanks Brad. That looks promising. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Monday, April 11, 2011 8:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Tue Apr 12 09:54:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 10:54:11 -0400 Subject: [AccessD] New Language In-Reply-To: <201104112335.p3BNZAnu007707@databaseadvisors.com> References: <201104112335.p3BNZAnu007707@databaseadvisors.com> Message-ID: <4DA46793.6090507@colbyconsulting.com> from http://en.wikipedia.org/wiki/BASIC The eight design principles of BASIC were: 1. Be easy for beginners to use. 2. Be a general-purpose programming language. 3. Allow advanced features to be added for experts (while keeping the language simple for beginners). 4. Be interactive. 5. Provide clear and friendly error messages. 6. Respond quickly for small programs. 7. Not to require an understanding of computer hardware. 8. Shield the user from the operating system. There are phases in learning to program. 0) Selecting a learning tool 1) learning programming concepts, keywords and constructs (loops / tests) 2) coming up with an idea of something to program 3) selecting a tool to implement the idea 4) Learning the tool 5) Implementing that idea 6) Go to 1 Whether or not basic will be around in the future it is a good language for starting to learn to program. IMHO, more than anything else, the programming environment and specifically the ease or difficulty of use of that environment determines the success of learning to program. Access and VBA is certainly not the easiest to use environment, but it is still very easy. Creating a database is easy. Creating a new module is easy. Creating a form and button and text box is easy. You can progress one step at a time. 1) Here is how to build a database container. 2) Here is how to create a module and save it 3) Here is how to open that module and add a function 4) Here is the debug window - how to execute that method and see a result. etc. The advantage of starting in Access is that while you are at it, you're teaching the concepts in a real life environment, which has enormous power to "go to the next step" particular in database applications. 5) here is how to create a table (and what a table is) 6) Fields 7) open and enter data (cool, the data is stored!) All tightly integrated. 8) Here is a form and a button. 9) here is the code that runs when the button is clicked. easy to move on to more stuff, interesting stuff, stuff that can earn Dad money... ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 7:35 PM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > Hi John, > > My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. > > good luck John, keep keeping us informed on your progress here. > > regards > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, 12 April 2011 2:27 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My 10 year old son is independently and without prompting asking dad to teach him how to program a > computer. :) > > It appears that he has decided that what dad does is pretty cool. > > Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. > IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute > code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things > like a simple "add two numbers" first project. > > Does anyone want to share "teaching the kids" stories? > > John W. Colby > www.ColbyConsulting.com > > On 3/25/2011 5:41 PM, Stuart McLachlan wrote: >> For all you people who are looking at moving away from Acces who want something easy to >> use and are wedded to the .Net world, MS have just the thing for you: >> >> http://msdn.microsoft.com/en-us/beginner/ff384126.aspx >> >> :-) >> >> >> From bheygood at abestsystems.com Tue Apr 12 10:34:43 2011 From: bheygood at abestsystems.com (b heygood) Date: Tue, 12 Apr 2011 08:34:43 -0700 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: <669B553C66A64AB6924FBE3758A17756@Seven> thanks for all your work. bob heygood -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Saturday, April 09, 2011 6:50 PM To: administrivia at databaseadvisors.com Subject: [AccessD] Administrivia - DBA Server Downtime Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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!" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Tue Apr 12 10:38:39 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 10:38:39 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: >Charlotte Foust: > I have to say, that I would put those module level functions into a > utility class and call the class method. I don't like calling module > level stuff from a class. The built in things you call are already > part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is > no "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses > your paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support first-order > functional programming paradigms (LINQ and related stuff...) > http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional > programming environment > http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > John, > > I understand the reasoning and all however... because the code is no longer > > contained within the object that needs it, you now open yourself up to > the > > old "I need to modify this method... oops... that change breaks something > > else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object that > > needs the code exists for a reason. Black box programming exists for a > > reason. The reason in many cases is to prevent exactly this kind of > > interaction when we accidentally change a piece of code used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class does > not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call > these > functions from within your classes. > > > > Yes, there are instances where lots of different things need the exact > same > > code, and yes, I have been known to call module functions from classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This post > >> really > >> isn't advice on what you should do. And it certainly isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only return a > >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > >> external variables are never referenced. If a function needs to return > >> complex information, it returns either a type or an object. Database > >> functions unavoidably have side-effects, but these are regarded as > >> 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support any > >> instance. Libraries separate functions into common-sense groups. Classes > >> provide an instance wrapper over the libraries, stringing functions > >> together > >> to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining > >> compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic > >> classes. These large, 'kitchen sink' classes had dozens of methods which > >> mixed database, business, and application functionality. They were > >> unwieldy, > >> hard-to-understand, and hard-to-extend. I simply copied the class into a > >> module, stripped out the instance stuff (properties and module-level > >> variables), and turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality much > >> more > >> obvious. Compatibility is maintained, but the new system is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to those who > >> want to re-use your code, but can't because they need some method that > is > >> marked private in a class. They typically demand that all methods be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write their own > >> classes. Heck, I even find myself cramped by my own classes at times, > and > >> having the option to call underlying functions directly has benefited > me. > >> > >> Writing test code for functions is much easier than for complex class > >> systems. Test code provides reasonable proof of reliability. Reliable > >> complexity can only be built out of small, simple, understandable, and > >> testable pieces. > >> > >> -Ken > From jwcolby at colbyconsulting.com Tue Apr 12 11:03:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 12:03:54 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA477EA.3010002@colbyconsulting.com> My question is, why do regression testing if we never regress? I write these functions and they are done. They work or they don't. We are currently testing them manually. Take the flag class, dead simple. It reads / writes to SQL server or it doesn't. We test the flag by actually using it and watching that the flag sets. It works, it is used forever. That is a simple example but the concept extends. It is not that we do not test, we do but once these functions work we are not modifying them. Actually in fact, we do paradigm changes (code functions custom written to read / write the flags in SQL Server to a flag class), but even here, the new flag class entirely replaces a couple of dozen functions, each of which wrote one flag. I would like to stress that it is not testing that I question, it is not unit testing that I question, it is when and where it might be applied, and when and where it is more trouble than it is worth. John W. Colby www.ColbyConsulting.com On 4/12/2011 10:09 AM, Jim Dettman wrote: > John, > > If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > For example, I develop a customer class, which handles CRUD operations for > customers. > > As result, I would develop four separate basic unit tests for that object: > > 1. Adding a record. > 2. Deleting a record. > 3. Reading a record. > 4. Updating a record. > > Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. A function > can be made to accept > args and return a value and never modify anything external to itself. It > would make programming > some functionality much more complicated however. Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. The > process builds that. No flag > is used, we just ask SQL server whether the objects exist and create them if > not. When we *fill* > that table, a piece of SQL code executed in a function. That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. *IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. The function itself does not modify the parameters passed > in. It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. I went to a > great deal of effort to get all of this stuff working this way. I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. I am not sitting at a desk collecting a paycheck regardless of what > I produce. I do not > have a test department, I am the test department. I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... From accessd at shaw.ca Tue Apr 12 12:39:27 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 10:39:27 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA42E74.6040007@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> <4DA42E74.6040007@colbyconsulting.com> Message-ID: Wasn't it Henry Fonda that said, and allow me to paraphrase, "The most successful people are either very smart or very nice." I wish you daughter well. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 3:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 12:54:27 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 21:54:27 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Hi Ken -- <<< VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. >>> Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) has limited capabilities - the issue is that VBA implementation (within MS Office) is "crappy"... I mean that when one tries to go to use advanced VBA features, which should work by definition, they get all kinds of "blues" - and MS answer is that VBA wasn't intended to be used like that... And when everything is done within VBA (syntax and semantics) why there should be any mentioning of any programmers'/developers' intentions which go beyond VBA capabilities? That "limited capability by implementation" was the main reason I did mainly quit VBA development ... <<< The Lisp idea of closures is fundamental to getting JavaScript to do lots of useful things. >>> I have read/learned LISP in theory quite some time ago - and I must note I'm ignorant in this area... Yes, JavaScript is a great programming language - I'm (trying) to get it mastered now (OO JavaScript) - and I really like it... And the paradox is that JavaScript isn't an Object Oriented language but how powerful and flexible it's to simulate all/most of OOP concepts... <<< If a block of code doesn't require state, why should it be in a class? >>> OOP IMO is more useful/natural way to design and to develop software solutions simulating real world "objects" behaviors... Yes, the more loosely coupled and the less stateful one gets their classes designed the more they look like just "standard" modules with functions... (This World is dual isn't it?)... <<< F# is one of the most interesting .NET languages for me. >>> Yes, it looks interesting here too but I doubt I will have an opportunity to learn and to use it in the near future... But who knows how it all will evolve... <<< You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. >>> I'm not sure how do you use VBA in TDD - could you please elaborate a bit more on this subject here? Do you have your custom VBA TDD framework? Or you just develop and use special test VBA modules/functions and call that stuff TDD? That's OK with me - I'm just wondering what practice is behind your VBA TDD terminology... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 12 ?????? 2011 ?. 19:39 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] >Charlotte Foust: > I have to say, that I would put those module level functions into a >utility class and call the class method. I don't like calling module >level stuff from a class. The built in things you call are already >part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is no > "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses your > paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support > first-order functional programming paradigms (LINQ and related > stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional programming > environment http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, > > I understand the reasoning and all however... because the code is no > longer > > contained within the object that needs it, you now open yourself up > > to > the > > old "I need to modify this method... oops... that change breaks > > something else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object > > that needs the code exists for a reason. Black box programming > > exists for a reason. The reason in many cases is to prevent exactly > > this kind of interaction when we accidentally change a piece of code > > used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > > > Yes, there are instances where lots of different things need the > > exact > same > > code, and yes, I have been known to call module functions from > > classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This > >> post really isn't advice on what you should do. And it certainly > >> isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only > >> return a result. The goal is 'side-effect-free' -- inputs are NEVER > >> modified, and external variables are never referenced. If a > >> function needs to return complex information, it returns either a > >> type or an object. Database functions unavoidably have > >> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support > >> any instance. Libraries separate functions into common-sense > >> groups. Classes provide an instance wrapper over the libraries, > >> stringing functions together to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic classes. These large, 'kitchen sink' classes had dozens > >> of methods which mixed database, business, and application > >> functionality. They were unwieldy, hard-to-understand, and > >> hard-to-extend. I simply copied the class into a module, stripped > >> out the instance stuff (properties and module-level variables), and > >> turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning > >> them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality > >> much more obvious. Compatibility is maintained, but the new system > >> is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to > >> those who want to re-use your code, but can't because they need > >> some method that > is > >> marked private in a class. They typically demand that all methods > >> be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write > >> their own classes. Heck, I even find myself cramped by my own > >> classes at times, > and > >> having the option to call underlying functions directly has > >> benefited > me. > >> > >> Writing test code for functions is much easier than for complex > >> class systems. Test code provides reasonable proof of reliability. > >> Reliable complexity can only be built out of small, simple, > >> understandable, and testable pieces. > >> > >> -Ken > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 13:02:26 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 22:02:26 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: Hi Jim -- <<< As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. >>> That would be called "integration tests" wouldn't they? That above is a bit "provocative" question I must admit to "fire" new here (?) Unit testing vs. Integration testing vs. Regression testing vs. ... testing Great Debate :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: 12 ?????? 2011 ?. 18:09 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up >> to the >> old "I need to modify this method... oops... that change breaks >> something else that uses the code". ... From kismert at gmail.com Tue Apr 12 15:11:57 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:11:57 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken From charlotte.foust at gmail.com Tue Apr 12 15:22:00 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 12 Apr 2011 13:22:00 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: NUnit testing is a learning experience in itself. Many of the basic tests can be scripted, which my previous employer finally did. However, the business rules tests needed to be hand written, and they largely dispensed with them, which didn't make a lot of sense to me. Every time a new rule was created, all the test would be run again just to be sure nothing got knocked sideways in the process. It is an incredible tool in .Net. Wish it were/had been available in Access. Charlotte Foust On Tue, Apr 12, 2011 at 7:09 AM, Jim Dettman wrote: > John, > > ?If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > ?As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > ?For example, I develop a customer class, which handles CRUD operations for > customers. > > ?As result, I would develop four separate basic unit tests for that object: > > ?1. Adding a record. > ?2. Deleting a record. > ?3. Reading a record. > ?4. Updating a record. > > ?Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > ?So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". ?OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. ?If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. ?To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. ?A function > can be made to accept > args and return a value and never modify anything external to itself. ?It > would make programming > some functionality much more complicated however. ?Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). ?Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". ?The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". ?It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. ?So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. ?Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. ?The > process builds that. ?No flag > is used, we just ask SQL server whether the objects exist and create them if > not. ?When we *fill* > that table, a piece of SQL code executed in a function. ?That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. ?*IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. ?The function itself does not modify the parameters passed > in. ?It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. ?There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? ?Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. ?I went to a > great deal of effort to get all of this stuff working this way. ?I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. ?They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". ?I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... ?This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ?;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. ?I am not sitting at a desk collecting a paycheck regardless of what > I produce. ?I do not > have a test department, I am the test department. ?I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kismert at gmail.com Tue Apr 12 15:48:47 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:48:47 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Let me give some examples of how I use function libraries, which might help illustrate what I'm talking about. Example 1: Factoring a Monolithic Business Class ======================================= I had a class, that I will call CPart, that had dozens and dozens of functions for dealing with parts. I had methods like CPart.Read and CPart.Save, with a CPart.Part property that I set before reading or saving a part. All was good until I got into situations where I just wanted to read an arbitrary part, without upsetting all of the delicate state that had built up for the 'Current' part. Yes, I could have created another instance of CPart, but it was monolithic, and represented the current (complex) state of the application, which seemed like a lot of effort just to read a part. So, for my first (bad) fix, I made optional parameters, like CPart.Read(Optional vPart As Variant), with internal code: If IsMissing(vPart) Then ' use member variable mvPart Else ' use given vPart End If ' specific code to read part ... Yes, my class inevitably got peppered with these optional parameters and If constructs, which started getting in the way of what the class was really trying to do, added extra complexity, and made it harder to debug and understand. During refactoring, I realized how I could simplify things: I built a module called MPart, with a function PartRead that took a required vPart parameter and returned a part structure or an error. The CPart methods lost their optional parameters and all the If statement nonsense, and the Part method's internal code reduced down to: tPart = MPart.PartRead(mvPart). External code could just call MPart.PartRead directly, without having to bother with creating and initializing a temporary CPart instance. Simplicity, readability, and testability improved all around. CPart shrank dramatically, making it easier to factor in the future. Example 2: Topical Function Libraries ============================= Over time, I have built up quite a few specialized modules for dealing with standard things in standard ways. For instance, MArray deals with arrays. MCollection holds very useful functions for Collections, similarly MString for strings and MVariant for variants. There are also more specialized libraries, like MMD5 for md5 hashes, and MMJD for Modified Julian Dates. There are lots of application-specific function libraries like MPart as well. These module functions have replaced sometimes a dozen half-assed and inconsistently written variations on a theme with one well-tested and thought-through piece of code that is portable among all of my applications. Moving standard code to a new application often reveals unknown weaknesses, which when fixed, strengthen the code for all applications. I find this to be a profitable way to bring consistency, flexibility and stability to my coding efforts. -Ken From accessd at shaw.ca Tue Apr 12 16:16:33 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:16:33 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <528397A8E9B14C68B8F6ACE8E43D0F39@creativesystemdesigns.com> The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking togther applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes closed...in another 5 years...maybe. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Apr 12 16:22:32 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:22:32 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <1E56BD82BB8A46A5A1A19FAB77E0B0C4@creativesystemdesigns.com> Sorry about the previous post but I was typing too fast and hit the mouse pad with the heel of my palm and the post was on it way. The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking together applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes (nearly) closed...in another 5 years...maybe. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 12 21:12:35 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 22:12:35 -0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <4DA50693.1040907@colbyconsulting.com> Ken, This stuff is all C# / SQL Server (and a Virtual Machine running a third party app) and is not the same as my framework in Access. This thing is really a custom written application specific to the needs of a single client. I wrote it and have re-factored it a couple of times as my knowledge increased in C#. It is slowly turning into an impressive system. I really wrote it because I was doing everything manually and it was a PITA, error prone (because it was all manual) and just plain not fun! The more I automated the process, the more the client was impressed. To this day the client really has no idea what what the system looks like or how it really works. He is in New York and I am in NC, and he basically has no knowledge of what is involved to do this stuff. He has his business, and I have mine - which is to make his business hum. What impresses him is that he knows (because I billed him for the hours) that doing an order used to take two days for the simplest order. Now it takes well under a day and for simple orders it can be done in a few hours. He used to send me count requests and it used to take an hour and it was a big enough pain that I might not get the results back to him until the next day. Now I get the count order and I can get the results back to him in 5-10 minutes if I can give it my immediate attention. I now have a program where I select a CSV file containing zips and the program does the counts, I press a button and the counts are pasted into an email and emailed off to him (and CC myself). So while he can't see the system (or understand it if he could) he can *feel* the system. I didn't do this to impress the customer I did this to keep the customer and to save my sanity. I now have nine lists which total about 350 million names, and I really need to process every list every month. I can only process 2 million names at a time through the third party software and each chunk takes about 50 minutes average. That's 175 chunks * 50 minutes of processing monthly - 146 hours of computer time every month. To do this stuff "manually" took me 2-3 times that long I am finally getting to the point where the system can do all of that unattended. And... I can process orders on-the-fly and they will break into the queue and jump to the head of the processing line. I'm here to tell you I could not do that manually, and if I were able to the customer would not be willing to pay me the hours required to do that. It really is an impressive system and it has been written (evolved really) starting somewhere around December 2009, so about 16 months, and I was learning C# as I went, which explains much of the refactoring. Now I finally get to relax a little bit and enjoy the fruits of my labor. John W. Colby www.ColbyConsulting.com On 4/12/2011 4:11 PM, Kenneth Ismert wrote: > All, > >> jwcolby: >> ... >> But in general the class functions are only used in the class. A function >> can be made to accept args and return a value and never modify anything >> external to itself. It would make programming some functionality much more >> complicated however. Let's take an example. ... >> > > You have a very impressive system with a lot of capability. But frameworks > have their own inertia: for all that they do, they unquestionably limit your > choices and reduce your options for their sheer bulk. I have wrestled with > this in building my own frameworks, and have entirely dismissed third party > frameworks (Symphony comes to mind) for the thunderous overhead they impose. From shamil at smsconsulting.spb.ru Wed Apr 13 08:24:42 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 17:24:42 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <7732C63F31AF47ADA03F1D17DE33837F@nant> Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 13 08:59:27 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 13 Apr 2011 09:59:27 -0400 Subject: [AccessD] mscomctl In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA5AC3F.4060602@colbyconsulting.com> I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com From phpons at gmail.com Wed Apr 13 09:27:35 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 16:27:35 +0200 Subject: [AccessD] How to hide info within a db? Message-ID: Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS From edzedz at comcast.net Wed Apr 13 09:38:47 2011 From: edzedz at comcast.net (Edward Zuris) Date: Wed, 13 Apr 2011 08:38:47 -0600 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <000001cbf9e8$802246d0$5bdea8c0@edz1> Thanks for the information. I was thinking of getting that book. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 7:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Wed Apr 13 10:11:51 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Wed, 13 Apr 2011 10:11:51 -0500 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> There is no encryption available at the table level. However, there are a few things that can be done to hide information... although if a person is a good VBA / Access programmer they could get around them. Creating an encrypted version does nothing to hide the data if one chooses to link or import tables. 1. Hiding the table is the first step... I might consider pending the table with "USys" to signify the table is a user system table. That hides the table unless the user unhides it in the parameters. 2. Roll your own encryption to the field. I call it encryption, but actually all you can do is store the data in Unicode using the StrConv function. When a user attempts to view the data in the table view, all they see is the first character of the field. If you change the field's input mask to password then the length of the field is seen but the number of characters represents the number of bytes in Unicode. For example: Social Security Numbers are nine digits in length, but in Unicode its stored as 18. Just make sure the field's length is long enough to store the extra digits. If they click into the field only one asterisk is seen. They can't copy or paste the data either. Of course this requires that you "encrypt" and "decrypt" each time you need to use the data. One more caveat... a person who sees the asterisk or the one character in length to be able decrypt the field they need to first realize HOW it was modified. 3. In Access 2007, create a ACCDE file. This locks everything down and enables the code to run faster. After the file is created... change the extension to ACCDR. This tells Access it's a runtime version. If someone tries to link or import tables from a runtime version, the file does not show BUT they could paste the name of the file into the dialog box and then it can be linked or imported. I do all three, although my table is not a system table. To the inexperienced or the casual user, these are adequate to keep the information safe. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 9:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Wed Apr 13 10:17:56 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 13 Apr 2011 11:17:56 -0400 Subject: [AccessD] mscomctl In-Reply-To: <4DA5AC3F.4060602@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> <4DA5AC3F.4060602@colbyconsulting.com> Message-ID: <6D90731D044D4616A0CBB207291B4C5C@Gateway> Usually, just regsvr32 "fullpath_in_quotes" Can be done in bat, but may need permissions. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 13, 2011 9:59 AM To: Access Developers discussion and problem solving Subject: [AccessD] mscomctl I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 13 11:01:11 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 09:01:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Keep in mind that I come from a .Net world where everything is an object, so I learned to deal with that orientation. Once you get accustomed to that, it makes sense to do it that way. It's all black boxes. Charlotte Foust On Tue, Apr 12, 2011 at 8:38 AM, Kenneth Ismert wrote: >>Charlotte Foust: >> I have to say, that I would put those module level functions into a >> utility class and call the class method. ?I don't like calling module >> level stuff from a class. ?The built in things you call are already >> part of a library/dll so it isn't the same. > > But if they are just utility functions, why go through the effort of > instantiating a class, when you can just call it directly in a module? If a > block of code doesn't require state, why should it be in a class? > > As long as you write side-effect-free functions, you can write libraries > that work just as well as the built-in stuff. > >> jwcolby: >> Do you program in .Net? ?Everything is an object. ?There is >> no "module", though there can be static classes / functions. >> I haven't done a poll, but I doubt seriously that anyone uses >> your paradigm in .net. > > Static classes would work just fine for function libraries -- they meet the > criteria of being globally available, and not requiring instantiation. You > can use Namespaces to group and name function libraries, as well. > >> Shamil Salakhetdinov >> http://fsharp.net ? > > F# is one of the most interesting .NET languages for me. I dabbled with > Nemerle years ago, which had all kinds of Lispy features, but it doesn't > seem to be very actively developed now. > >> No, wait - in fact VB.NET and C# do support first-order >> functional programming paradigms (LINQ and related stuff...) >> http://www.info.ucl.ac.be/~pvr/paradigms.html >> And here they say that MS Excel is a kind of functional >> programming environment >> http://en.wikipedia.org/wiki/Functional_programming >> So you should know and use them for quite some time already - >> foundations of functional programming paradigm... ?:) > > Having functions as first-class data types (like strings, doubles, etc) > turns out to be very handy. > The Lisp idea of closures is fundamental to getting Javascript to do lots of > useful things. > Test-driven programming comes from loosely-typed languages like Lisp and > Python. It is a way to define and enforce function, just contracts in > Eiffel. > > VBA is not a very capable language, but you can directly use most of these > ideas, and approximate and simulate others in a more-or-less satisfactory > way. > > You can treat VBA as a loosely-typed, partly functional, test-driven > programming language, and get tangible benefits. > > -Ken > > > ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Mon, 11 Apr 2011 15:09:32 -0500 >> Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 >> John, >> >> I understand the reasoning and all however... because the code is no longer >> > contained within the object that needs it, you now open yourself up to >> the >> > old "I need to modify this method... oops... that change breaks something >> > else that uses the code". >> > >> >> It is always possible to over-factor, and merge two similar pieces of code >> together that really should be separate. In that case, you factor the code >> back into multiple pieces, and correct the dependencies. >> >> >> > Class programming exists for a reason. ?Placing code in the object that >> > needs the code exists for a reason. ?Black box programming exists for a >> > reason. ?The reason in many cases is to prevent exactly this kind of >> > interaction when we accidentally change a piece of code used in many >> places >> > and break one of those places. >> > >> >> I would submit that calling side-effect free functions from a class does >> not >> pierce the black box. The important things, state and access, are protected >> by the class. But the function can be anywhere: built-in VBA functions, >> Access application methods, or DAO library calls. You undoubtedly call >> these >> functions from within your classes. >> >> >> > Yes, there are instances where lots of different things need the exact >> same >> > code, and yes, I have been known to call module functions from classes, >> but >> > it truly is a questionable practice in most cases. >> > >> >> Test cases replace questionability with a guarantee of proper function. The >> function shouldn't define what it does -- the test cases should. If changes >> to a function break a test, then you know immediately that there is a >> problem. Functional unit testing guards against changes that would break >> dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted and >> tested module-level functions. >> >> -Ken >> >> >> > >> > John W. Colby >> > www.ColbyConsulting.com >> > >> > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> > >> >> John, All: >> >> >> >> I'm going to expand a little on what I'm trying to get at. This post >> >> really >> >> isn't advice on what you should do. And it certainly isn't criticism. >> >> >> >> I have been returning to the old Lisp idea of functional programming: >> >> libraries of functions that act only on their inputs and only return a >> >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> >> external variables are never referenced. If a function needs to return >> >> complex information, it returns either a type or an object. Database >> >> functions unavoidably have side-effects, but these are regarded as >> >> 'external' to the code, and are explicitly documented. >> >> >> >> The thing that surprised me was how well libraries play with objects. >> >> Libraries provide discrete, testable chunks of code that support any >> >> instance. Libraries separate functions into common-sense groups. Classes >> >> provide an instance wrapper over the libraries, stringing functions >> >> together >> >> to support the application. >> >> >> >> Plus, it is pretty easy to convert classes to this scheme while >> >> maintaining >> >> compatibility. >> >> >> >> The advantages became apparent when I refactored some of my early >> >> monolithic >> >> classes. These large, 'kitchen sink' classes had dozens of methods which >> >> mixed database, business, and application functionality. They were >> >> unwieldy, >> >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> >> module, stripped out the instance stuff (properties and module-level >> >> variables), and turned the methods into side-effect-free functions. I >> then >> >> stripped out the code within the original class methods, turning them >> into >> >> wrappers calling library functions with their instance variables. >> >> >> >> The result: classes become lightweight, making their functionality much >> >> more >> >> obvious. Compatibility is maintained, but the new system is much easier >> to >> >> refactor and extend. >> >> >> >> The class on-top-of function approach is also a good answer to those who >> >> want to re-use your code, but can't because they need some method that >> is >> >> marked private in a class. They typically demand that all methods be >> made >> >> public, which is usually silly because the class designer has good >> reasons >> >> for limiting the public visibility of certain methods or properties. >> >> >> >> But with a function library, you can have your cake and eat it, too. >> >> Classes >> >> hold the instance information, and interact with libraries in an >> >> instance-safe way, because the functions never modify their inputs. >> Others >> >> with different needs can call the functions directly, or write their own >> >> classes. Heck, I even find myself cramped by my own classes at times, >> and >> >> having the option to call underlying functions directly has benefited >> me. >> >> >> >> Writing test code for functions is much easier than for complex class >> >> systems. Test code provides reasonable proof of reliability. ?Reliable >> >> complexity can only be built out of small, simple, understandable, and >> >> testable pieces. >> >> >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Wed Apr 13 13:19:12 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 20:19:12 +0200 Subject: [AccessD] How to hide info within a db? In-Reply-To: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> References: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> Message-ID: Thank's a lot, Jim, I will try to use you advice. Philippe 2011/4/13 jm.hwsn > There is no encryption available at the table level. > However, there are a few things that can be done to hide information... > although if a person is a good VBA / Access programmer they could get > around > them. Creating an encrypted version does nothing to hide the data if one > chooses to link or import tables. > > 1. Hiding the table is the first step... I might consider pending the > table > with "USys" to signify the table is a user system table. That hides the > table unless the user unhides it in the parameters. > > 2. Roll your own encryption to the field. I call it encryption, but > actually all you can do is store the data in Unicode using the StrConv > function. When a user attempts to view the data in the table view, all > they > see is the first character of the field. If you change the field's input > mask to password then the length of the field is seen but the number of > characters represents the number of bytes in Unicode. For example: Social > Security Numbers are nine digits in length, but in Unicode its stored as > 18. > Just make sure the field's length is long enough to store the extra digits. > If they click into the field only one asterisk is seen. They can't copy or > paste the data either. Of course this requires that you "encrypt" and > "decrypt" each time you need to use the data. One more caveat... a person > who sees the asterisk or the one character in length to be able decrypt the > field they need to first realize HOW it was modified. > > 3. In Access 2007, create a ACCDE file. This locks everything down and > enables the code to run faster. After the file is created... change the > extension to ACCDR. This tells Access it's a runtime version. If someone > tries to link or import tables from a runtime version, the file does not > show BUT they could paste the name of the file into the dialog box and then > it can be linked or imported. > > I do all three, although my table is not a system table. To the > inexperienced or the casual user, these are adequate to keep the > information > safe. > > HTH > Jim > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Wednesday, April 13, 2011 9:28 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] How to hide info within a db? > > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Wed Apr 13 13:37:11 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Wed, 13 Apr 2011 11:37:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <004701cbfa09$cd8869b0$68993d10$@cox.net> Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code > which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 14:02:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 05:02:02 +1000 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4DA5F32A.1919.28625544@stuart.lexacorp.com.pg> Jim has aleady given you some ideas, but there other options depending on exactly what it is you want to hide. How much information? What type of information? Under what cirucmstances? i.e when does it need to hidden and when does it need to be visible? There are a number of simple and resaonable secure encrytion routines you can use when you save/retreive data which just rely on a password which you can have the user enter when they open the application. -- Stuart On 13 Apr 2011 at 16:27, philippe pons wrote: > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 14:22:52 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 14:22:52 -0500 Subject: [AccessD] Dir command trouble Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> I am running the following code to get a list of file folders. All it returns is an empty string. What might I be missing? Sub FileFolderLIst() Dim FileFolder As Variant strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, vbDirectory) End Sub Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From shamil at smsconsulting.spb.ru Wed Apr 13 14:35:07 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 23:35:07 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <004701cbfa09$cd8869b0$68993d10$@cox.net> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> <004701cbfa09$cd8869b0$68993d10$@cox.net> Message-ID: Hi Doug, Not at all - in fact that was Ken who posted that link here: <<< Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: 13 ?????? 2011 ?. 22:37 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, <<< skip>>> Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. <<< skip >>> -Ken -- From kismert at gmail.com Wed Apr 13 14:45:56 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 13 Apr 2011 14:45:56 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: > Charlotte Foust: > Keep in mind that I come from a .Net world where everything is an > object, so I learned to deal with that orientation. Once you get > accustomed to that, it makes sense to do it that way. It's all black > boxes. > One of my points is that you don't have to think about programming constructs in the terms that their designers intended. If, in C#, you have a static class with all public methods, no properties, and no member variables, then it is a 'function library', for all intents and purposes. Write your methods so that they are side-effect free, and you are an instant functional programmer. VBA has no static classes. But, VBA modules allow properties and member variables, so all you have to do is hack in some initialization code, and voila, a VBA 'static class'. If you aren't proud about the 'purity' of the solution, (and trust me, I am not proud), you can approximate a lot of programming concepts the language wasn't intended to support. -Ken From stuart at lexacorp.com.pg Wed Apr 13 15:15:58 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:15:58 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> Message-ID: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:24:23 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:24:23 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> I found my mistake just as you responded. A one character error in the path name. Thanks for the assistance. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:29:42 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:29:42 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> Message-ID: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:34:35 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:34:35 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Problem found! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:43:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:43:18 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Message-ID: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> PEBCAK :-) On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > Problem found! > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > "Pablic" ? :-) > > -- > Stuart > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > I found my mistake just as you responded. A one character error in > > the path name. Thanks for the assistance. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > It works for me on "C:\" > > > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > Dim strPathname As String > > strPathname = "C:\" > > FileFolder = Dir(strPathname) > > FileFolder = Dir(strPathname, vbDirectory) > > Debug.Print FileFolder > > End Sub > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > *only* list the directories rather all files as well. > > > > Sub Test() > > Dim MyPath As String > > Dim MyName As String > > MyPath = "c:\" ' Set the path. > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > While MyName <> "" ' Start the loop. > > ' Ignore the current directory and the encompassing directory. > > If MyName <> "." And MyName <> ".." Then > > ' Use bitwise comparison to make sure MyName is a directory. > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > Then > > Debug.Print MyName ' Display entry only if it > > End If ' it represents a directory. > > End If > > MyName = Dir ' Get next entry. > > Loop > > End Sub > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > I am running the following code to get a list of file folders. All > > > it returns is an empty string. What might I be missing? > > > > > > Sub FileFolderLIst() > > > > > > Dim FileFolder As Variant > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > vbDirectory) > > > > > > End Sub > > > > > > > > > Chester Kaup > > > Engineering Technician > > > Kinder Morgan CO2 Company, LLP > > > Office (432) 688-3797 > > > FAX (432) 688-3799 > > > > > > ? > > > No trees were killed in the sending of this message. However a > > > large number of electrons were terribly inconvenienced. > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Wed Apr 13 15:46:23 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 13 Apr 2011 13:46:23 -0700 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> Message-ID: I hate it when that happens! :) On Wed, Apr 13, 2011 at 1:43 PM, Stuart McLachlan wrote: > PEBCAK :-) > > On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > > > Problem found! > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > "Pablic" ? :-) > > > > -- > > Stuart > > > > > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > > > I found my mistake just as you responded. A one character error in > > > the path name. Thanks for the assistance. > > > > > > -----Original Message----- > > > From: accessd-bounces at databaseadvisors.com > > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > > command trouble > > > > > > It works for me on "C:\" > > > > > > Sub FileFolderLIst() > > > Dim FileFolder As Variant > > > Dim strPathname As String > > > strPathname = "C:\" > > > FileFolder = Dir(strPathname) > > > FileFolder = Dir(strPathname, vbDirectory) > > > Debug.Print FileFolder > > > End Sub > > > > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > > *only* list the directories rather all files as well. > > > > > > Sub Test() > > > Dim MyPath As String > > > Dim MyName As String > > > MyPath = "c:\" ' Set the path. > > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > > While MyName <> "" ' Start the loop. > > > ' Ignore the current directory and the encompassing directory. > > > If MyName <> "." And MyName <> ".." Then > > > ' Use bitwise comparison to make sure MyName is a directory. > > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > > Then > > > Debug.Print MyName ' Display entry only if it > > > End If ' it represents a directory. > > > End If > > > MyName = Dir ' Get next entry. > > > Loop > > > End Sub > > > > > > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > > > I am running the following code to get a list of file folders. All > > > > it returns is an empty string. What might I be missing? > > > > > > > > Sub FileFolderLIst() > > > > > > > > Dim FileFolder As Variant > > > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > > vbDirectory) > > > > > > > > End Sub > > > > > > > > > > > > Chester Kaup > > > > Engineering Technician > > > > Kinder Morgan CO2 Company, LLP > > > > Office (432) 688-3797 > > > > FAX (432) 688-3799 > > > > > > > > > > > > No trees were killed in the sending of this message. However a > > > > large number of electrons were terribly inconvenienced. > > > > > > > > > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Wed Apr 13 17:22:27 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 17:22:27 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Wed Apr 13 18:05:57 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 16:05:57 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheid at sc.rr.com Wed Apr 13 19:04:56 2011 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 13 Apr 2011 20:04:56 -0400 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <000301cbfa37$97917a30$c6b46e90$@rr.com> Philippe, If this is data, and it is important that it not be read, I would encrypt it. Not sure how you would do it in Access (probably some API), but in .Net Framework, there are library functions to do this. Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 10:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Wed Apr 13 19:58:30 2011 From: df.waters at comcast.net (Dan Waters) Date: Wed, 13 Apr 2011 19:58:30 -0500 Subject: [AccessD] FE's Disconnecting from BE Message-ID: <004301cbfa3f$12cd7710$38686530$@comcast.net> At just one of my customers, we've recently had the experience where the FE files have all, at the same time, had one or more table links disconnect from the BE file, and then all the table links reconnected no more than 15 minutes later. As far as we know, there was no human intervention. A Disk or Network Error was recorded by the FE in the GlobalErrors table with is in the BE file, so this table link did not disconnect. The network setup is a little complex - they use a Storage Area Network (SAN) with multiple disks, virtual server (VMWare), and Citrix. The system is 3 - 6 times slower with data intensive activity compared to my other customers using a LAN and a physical server. Anyone have any ideas on a cause, what I can monitor, or what I could do? Thanks! Dan From accessd at shaw.ca Wed Apr 13 21:05:58 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 13 Apr 2011 19:05:58 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Apr 13 22:45:55 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:45:55 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Wed Apr 13 22:49:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:49:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Does it affect anything other than Reflection? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 13, 2011 6:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Wed Apr 13 23:55:38 2011 From: rockysmolin at bchacc.com (rockysmolin at bchacc.com) Date: Wed, 13 Apr 2011 21:55:38 -0700 Subject: [AccessD] New Language Message-ID: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Thu Apr 14 00:36:21 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 22:36:21 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). ?Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. ?So here is what I stumbled on. ?I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ?The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Thu Apr 14 00:44:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 00:44:08 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Ok, thanks. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 12:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or >> thinking about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', >> to retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I >> could find, to do this, was to put in extra code into a class module >> to create a 'Properties' Property. ?In fact, I had written an Add-on >> in VB6 that did this for me (created a properties property). ?Put a >> LOT of extra code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the >> Reflection Library. ?So here is what I stumbled on. ?I was all >> excited to use the Reflection library on a particalur class where I >> needed to dynamically list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ? >> The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting >> at all of my properties...until I figured out that some were >> properties some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From accessd at shaw.ca Thu Apr 14 02:02:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 00:02:38 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: <7DEDE1F783024A28A3C5D53E63803261@creativesystemdesigns.com> Hi Drew: OK... Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 8:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 14 04:39:03 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:39:03 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C0B7.9070509@colbyconsulting.com> Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. From jwcolby at colbyconsulting.com Thu Apr 14 04:42:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:42:48 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C198.7060305@colbyconsulting.com> > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From Gustav at cactus.dk Thu Apr 14 05:27:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 14 Apr 2011 12:27:05 +0200 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. From jwcolby at colbyconsulting.com Thu Apr 14 07:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 08:47:23 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6ECDB.2020702@colbyconsulting.com> LOL. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. Whatever. Why doesn't he do that to start with? Class public fields exist for a reason. http://www.codinghorror.com/blog/2006/08/properties-vs-public-variables.html Read down through the comments. Like everything else programming, there are very opinionated people on both sides of the isle. But notice that *referencing* code breakage is very real. Kind of like natural vs surrogate keys, you can get away with either... until you can't! And when you can't you have created problems for yourself that you never would have had had you just "done it right" to start with. John W. Colby www.ColbyConsulting.com On 4/14/2011 6:27 AM, Gustav Brock wrote: > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39>>> > > I understand that you are a lazy programmer .. > > From kismert at gmail.com Thu Apr 14 10:17:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Thu, 14 Apr 2011 10:17:32 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: Speaking of Unit-testing, I bumped into this: http://cobra-language.com/ Cobra is a .NET/Mono language, with language constructs that directly support: * Contracts * Unit-testing * Lambdas and closures * Doc strings * Mixins and extensions Familiar .NET features like Generics are there, and it plays nice with C# and VB.NET, too. It offers the clean syntax and convenience of Ruby or Python, but provides strong compile-time checking, and compiled performance. -Ken From accessd at shaw.ca Thu Apr 14 11:38:24 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 09:38:24 -0700 Subject: [AccessD] New Language In-Reply-To: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Message-ID: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 12:16:41 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 10:16:41 -0700 Subject: [AccessD] New Language In-Reply-To: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Message-ID: Noah recommends starting with Java. Says LUA data types are confusing and Java is more structured and object oriented. Debugging is harder in LUA as well. I'll see if I can post a video of the competition they did at the regionals. I have it - just have to figure out how and where to post. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 9:38 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] New Language Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 14 13:01:00 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:01:00 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C0B7.9070509@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: Wow... a little snarky today, are we? Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, both were considered properties... and that isn't me 'protesting till the cows come home', it's how it is. If it's not, if you can show me some documentation that refers to 'Public SomeVariable As String' as being a FIELD in VB 6, I will gladly apologize and bow to your superior knowledge. ;) As for the lazy programmer comment..... who's the one that uses the 'canned' bound format? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:03:01 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:03:01 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C198.7060305@colbyconsulting.com> References: <4DA6C198.7060305@colbyconsulting.com> Message-ID: Man, did I piss in your wheaties or something? Programming style, safety of my code? Wow, you like kicking dirt.... be careful there buddy.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:43 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:04:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:04:19 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: No, I hand code the properties... I encapsulate my data tables in classes that handle the data the way I want it handled. Directly linking tables to user 'visible' controls is the lazy and dangerous way to do things.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, April 14, 2011 5:27 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Thu Apr 14 13:16:22 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Thu, 14 Apr 2011 11:16:22 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Thu Apr 14 13:20:38 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Thu, 14 Apr 2011 13:20:38 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From DWUTKA at Marlow.com Thu Apr 14 13:55:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:55:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Nah, this is like two geeks arguing over who is faster, Superman or the Flash. Just break out the popcorn. ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:57:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:57:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> References: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: And we can send them to camp JWC, to be trained by the Fuhrer himself! 'You call that code?' 'It's sloppy, lazy!' 'Wrap that simple class field in 100 lines of code!' 'Drop and give me 300 lines of error handling! On the double!' ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rusty Hammond Sent: Thursday, April 14, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 14 14:26:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 15:26:37 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: <4DA74A6D.7000706@colbyconsulting.com> LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. From DWUTKA at Marlow.com Thu Apr 14 14:43:23 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 14:43:23 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA74A6D.7000706@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: Well VBA is a subset of VB 6. Can you show me any documentation where it defines a Public statement as setting a 'field' to a class, versus Property statement setting a property, in VBA? When in the IDE, if you have Public MyValue or Property Get MyOther value, both will show up with the same 'property' icon in the IDE. No declaration that 'MyValue' (in this case) is a 'field' in the Object browser. In .Net, it DOES have a different icon in the IDE. Fields and Properties are given completely different icons in autosensing drop downs. It makes a clear distinction. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 2:27 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 15:04:47 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 13:04:47 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky From DWUTKA at Marlow.com Thu Apr 14 15:20:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 15:20:08 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 16:20:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:20:26 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <03E535F8605A444BA1A55E3B9B4D1058@HAL9005> Client found these links: http://en.kioskea.net/forum/affich-26059-rename-file-with-datetime-appended- to-filenam http://www.computing.net/answers/dos/can-a-batch-file-get-a-files-datetime-s tamp/318.html Reminds me of how much stuff we used to do with batch files. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 14, 2011 1:20 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 16:35:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:35:49 -0700 Subject: [AccessD] 2010 Version Message-ID: Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From garykjos at gmail.com Thu Apr 14 16:43:15 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 16:43:15 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From BradM at blackforestltd.com Thu Apr 14 16:43:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Thu, 14 Apr 2011 16:43:22 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From accessd at shaw.ca Thu Apr 14 16:44:28 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 14:44:28 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Thu Apr 14 16:54:25 2011 From: df.waters at comcast.net (Dan Waters) Date: Thu, 14 Apr 2011 16:54:25 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <003f01cbfaee$85bd3080$91379180$@comcast.net> Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Apr 14 16:55:14 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 14 Apr 2011 14:55:14 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Thu Apr 14 17:47:34 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:47:34 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:19 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:45 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:45 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> Message-ID: <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 2:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:50:18 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:50:18 -0700 Subject: [AccessD] 2010 Version In-Reply-To: <003f01cbfaee$85bd3080$91379180$@comcast.net> References: <003f01cbfaee$85bd3080$91379180$@comcast.net> Message-ID: <0A5CEF40B05C4D5D9E0F77A5CAAAAB5E@HAL9005> Good thinkin'. Covers me for the rest of my life. Or the product 's life. Of course, that's assuming that DoCmd.ShowToolbar "Ribbon", acToolbarNo works so well and is so bulletproof that MS will feel compelled to replace it with something else we'll have to learn. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Thursday, April 14, 2011 2:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:51:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:51:26 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <20E088CEE08447F1BEB51DD59AB3EAE9@HAL9005> Dunno. If it happened more than three weeks ago, it's gone from my cache. But, law of averages says, I got it from this list. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 14, 2011 2:55 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Thu Apr 14 17:59:01 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 17:59:01 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From Darryl.Collins at iag.com.au Thu Apr 14 19:26:56 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:26:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150027.p3F0R3lU012257@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hahaha, reminds me of the logic when you are using code to write from Access to Excel. Used to be 5.0 (has been for years - ie Excel 5.0;HDR=YES;IMEX=2;DATABASE=etc...). Now XL2007+ is being used you have use Excel 8.0 or it fails. Now neither of those numbers align with the XL versions being used. And what happened to 6 & 7? Logically you would think, "ok change it to 6". I am not really asking, I am sure if I Google it hard enough I could find out for myself. It is just one of those things that trip you up when you least expected it and the obvious answer is the wrong one. :) fun stuff. Just having a cheap and quiet little rant over here... cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, 15 April 2011 8:48 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Darryl.Collins at iag.com.au Thu Apr 14 19:27:55 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:27:55 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150028.p3F0S1RN012807@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ and yet it was still cursed... Guess you cannot escape ya fate ;) -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, 15 April 2011 8:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Thu Apr 14 22:40:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 15 Apr 2011 13:40:24 +1000 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DA7BE28.31054.5F4DF65@stuart.lexacorp.com.pg> Not file renaming :-( -- Stuart On 14 Apr 2011 at 15:20, Drew Wutka wrote: > Not sure about xcopy, but robocopy has that kind of ability. Robocopy > used to be only available the extra resources CD you had to buy > separately, but it's included in Windows 7 now. > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers > discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp > to xcopy target > > Dear List: > > Client wants to do regular backup to his EHD using Windows Scheduler. > He's almost there but has a question: > > The following in a batch file seems to work for backing up > DocketWorks: > > > > xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" > > > > Do you know if there is some way to append a date time stamp to it so > it does not always overwrite the previous backup? > > Anyone know? > > > > TIA > > > > Rocky > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for > the person or entity to which it is addressed and may contain II-VI > Proprietary and/or II-VI Business Sensitive material. If you are not > the intended recipient, please contact the sender immediately and > destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended > recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Fri Apr 15 03:33:33 2011 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 15 Apr 2011 10:33:33 +0200 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim From jwcolby at colbyconsulting.com Fri Apr 15 07:43:58 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 08:43:58 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: <4DA83D8E.5020106@colbyconsulting.com> Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if you > have Public MyValue or Property Get MyOther value, both will show up > with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew From shamil at smsconsulting.spb.ru Fri Apr 15 09:26:41 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 18:26:41 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 10:05:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:05:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: LOL.... what a long winded way of saying 'No, it's not documented, it's my personal definition'. Your view here is based on a granular perspective of VB6 (remember, we are talking about VBA and VB6 here, there is a CLEAR defined difference between a Field and a Property in .Net). You are looking at the definition of a property from INSIDE the class. If you take a more bird's eye view of class a property is a value. A class is an object. Regardless of what each individual line of code within a class module says, a class is an object defined and structured to represent something. A Function is set of instructions that you start with a call. A Class is an object, that you create, mold, store, manipulate, etc. With this type of view, it is irrelevant as to whether a property is defined with a Public statement or a property statement, it is still a 'property' of a class. If you were to build a 'Rubber Ball' class, and gave it a Color property, from the outside world (to the class), the property is a value that can be set or retrieved (or one or the other). The outside world, to the class, doesn't care how it is defined. .Net makes a distinction, in documentation and intellisense. But Property is a keyword and Field is not. But back to VBA and VB6, let's go even more granular then your view here. What is the machine code difference between: Public MyValue as string And Property Get MyValue() as String MyValue=strValue End Property Property Let MyValue(strEnter as String) strValue=strEnter End Property ??? Do you think that thep code, when this is compiled, is doing anything different? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 7:44 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Fri Apr 15 10:08:21 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:08:21 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com><4DA83D8E.5020106@colbyconsulting.com> Message-ID: Bingo, you said it better though... thanks! Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, April 15, 2011 9:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jedi at charm.net Fri Apr 15 11:10:26 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 15 Apr 2011 12:10:26 -0400 (EDT) Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> You forgot Preparation H. Mike > They took off a year? (Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Fri Apr 15 14:26:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 15:26:20 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA89BDC.4020409@colbyconsulting.com> So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com On 4/15/2011 10:26 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Public class modules variables are implemented in VB6 and VBA the same way > as properties IOW they have the same programmatic interface from VB6/VBA > (and COM) internals point of view. - this is what Drew has been telling > about here... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 15 ?????? 2011 ?. 16:44 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a property > is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns a > value. It has a keyword in the VB language. It can run any amount of code > inside of the "function", and do anything that is legal for a function to do > including dimensioning, reading and writing other variables, running loops, > doing if then / select case etc., reading and writing to the disk, > downloading files from the internet, formatting your hard disk... you name > it. > > A property is a function. It happens to be targeted to wrapping variables > and exposing them to the outside world but that is not all it can do. A > property does not *define* the variable, that is done in the dimension > statement. A property does not "own" the variable that it wraps, it is > simply > *returning* the variable. A property does not have any data storage area on > the heap unless it happens to dimension its own variables inside of the > property, and even then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved area > of memory on the heap sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a property is and what a variable is. How can you > possibly expect them to be or work the same. They are different things > entirely. The fact that the IDE displays the same icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the language, I > just look at what things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > > On 4/14/2011 3:43 PM, Drew Wutka wrote: >> Well VBA is a subset of VB 6. Can you show me any documentation where >> it defines a Public statement as setting a 'field' to a class, versus >> Property statement setting a property, in VBA? When in the IDE, if >> you have Public MyValue or Property Get MyOther value, both will show >> up with the same 'property' icon in the IDE. No declaration that > 'MyValue' >> (in this case) is a 'field' in the Object browser. >> >> In .Net, it DOES have a different icon in the IDE. Fields and >> Properties are given completely different icons in autosensing drop >> downs. It makes a clear distinction. >> >> Drew > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From shamil at smsconsulting.spb.ru Fri Apr 15 14:54:31 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 23:54:31 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <3870F1BDA6774925B9CD59D1B66F5C3F@nant> Hi John -- <<< Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not >>> But they are the same from *technical* (VBA/VB6/COM) point of view - that is what Drew is telling... IOW: they are looking the same for outer world. Drew doesn't care about their internal implementation or high level concepts... Nobody argues here when one or another coding style/approach should be used or that one is better than another one because of ... OA: They are the same from *technical* point of view/perspective of VBA/VB6/COM. Try the following VBA/VB6 code: ------------- cut here ----- ' class MyClass Public MyTestVar As String Private m_myTestVar2 As String Property Get MyTestVar2() As String MyTestVar2 = m_myTestVar2 End Property Property Let MyTestVar2(ByVal v As String) m_myTestVar2 = v End Property ------------- cut here ----- ' standard module - MyTestModule Public Sub MyTest() Dim c As MyClass Set c = New MyClass Dim result As String CallByName c, "MyTestVar", VbLet, "MyTestValue" result = CallByName(c, "MyTestVar", VbGet) Debug.Print "Result from public variable = " + result CallByName c, "MyTestVar2", VbLet, "MyTestValue2" result = CallByName(c, "MyTestVar2", VbGet) Debug.Print "Result from public variable2 = " + result End Sub ------------- cut here ----- Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 23:26 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Apr 15 15:11:48 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 15:11:48 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: Boy John, you don't read anything I wrote. The entire point was about a difference between .Net and VB6/VBA. No point in explaining further, your soapbox is above the level I care to engage at. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 2:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Apr 15 15:18:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 16:18:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8A816.9000705@colbyconsulting.com> Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com On 4/15/2011 11:05 AM, Drew Wutka wrote: > LOL.... what a long winded way of saying 'No, it's not documented, it's > my personal definition'. > > Your view here is based on a granular perspective of VB6 (remember, we > are talking about VBA and VB6 here, there is a CLEAR defined difference > between a Field and a Property in .Net). You are looking at the > definition of a property from INSIDE the class. If you take a more > bird's eye view of class a property is a value. A class is an object. > Regardless of what each individual line of code within a class module > says, a class is an object defined and structured to represent > something. A Function is set of instructions that you start with a > call. A Class is an object, that you create, mold, store, manipulate, > etc. > > With this type of view, it is irrelevant as to whether a property is > defined with a Public statement or a property statement, it is still a > 'property' of a class. If you were to build a 'Rubber Ball' class, and > gave it a Color property, from the outside world (to the class), the > property is a value that can be set or retrieved (or one or the other). > The outside world, to the class, doesn't care how it is defined. > > .Net makes a distinction, in documentation and intellisense. But > Property is a keyword and Field is not. > > But back to VBA and VB6, let's go even more granular then your view > here. > > What is the machine code difference between: > > Public MyValue as string > > And > > Property Get MyValue() as String > MyValue=strValue > End Property > Property Let MyValue(strEnter as String) > strValue=strEnter > End Property > > ??? Do you think that thep code, when this is compiled, is doing > anything different? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 7:44 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a > property is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns > a value. It has a keyword > in the VB language. It can run any amount of code inside of the > "function", and do anything that is > legal for a function to do including dimensioning, reading and writing > other variables, running > loops, doing if then / select case etc., reading and writing to the > disk, downloading files from the > internet, formatting your hard disk... you name it. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the > outside world but that is not all it can do. A property does not > *define* the variable, that is > done in the dimension statement. A property does not "own" the variable > that it wraps, it is simply > *returning* the variable. A property does not have any data storage > area on the heap unless it > happens to dimension its own variables inside of the property, and even > then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap > sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a > property is and what a variable is. How can you possibly expect them to > be or work the same. They > are different things entirely. The fact that the IDE displays the same > icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the > language, I just look at what > things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From rockysmolin at bchacc.com Fri Apr 15 15:30:27 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 15 Apr 2011 13:30:27 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target + New Language In-Reply-To: References: Message-ID: <9DC7EA07277745B39387C0607ACA09F4@HAL9005> John: I gave the task to Noah - he knows batch files. Told him $25. He's learned a bit more about batch files a lot more about testing, communicating with the user, and reworking based on finding out 'what they really want'. Between that, the $15 he got for recycling bottles, and his allowance, he's having a really good day. :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 15, 2011 1:34 AM To: accessd at databaseadvisors.com; accessd at shaw.ca Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 16:09:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 16:09:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: Actually John, now that you've come down a bit on your soapbox, I will try to clarify for you. As a VB/VBA programmer, nothing I ever read about VB referred to 'Public SomeValue as string' as a FIELD. In fact, it was always referred to it as a PROPERTY of a class object. I have ASKED if you have any supporting documentation, like some Microsoft white paper, or something I should have read when becoming proficient in VB(6/VBA), where I would have learned that the correct term for 'Public SomeValue As SomeType' in a VB/VBA class module was FIELD. I can show you PLENTY of documentation where the reverse is the case. http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual Basic Concepts / Customizing Form Classes' Straight out of the MSDN, when talking about Class modules in VB6. It refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public Comment As String' as 'click on it to play back its Comment PROPERTY'. Or how about: http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual Basic Concepts / Class Module Step by Step'. You won't find the WORD 'field' on that page, and it refers to 'Public Name As String' AS A PROPERTY. Straight from the designers of VB 6's mouth, JWC. Now admittedly, I'm only bringing MSDN articles into the fray. I'm not taking your approach, that you've been programming since you built THE FIRST Antikythera mechanism, so what you say is how it is. To begin with, you are absolutely, 100% incorrect in stating that there is ANY difference in performance OR FUNCTIONALITY between: Public MyValue as String And Dim strMyValue as string Property Get MyValue() As String MyValue=strMyValue End Property Property Let MyValue(strEnter As String) strMyValue=strEnter End Property The only difference above is that one uses 1 line of code, the other uses 7 lines of code, in the source code. That is it. When you express what else you can do with Get/Let statements, you are going OUTSIDE the scope of declaring what a BASIC property is. Yes, you can put error handling into the statements above, but that changes the strictest definition of a 'SIMPLE' property. You can add extra arguments, logic, processes, etc. All going OUTSIDE of the definition of a 'simple property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 liner property, and converting it until actual Get and Let statements (or Set) for more functionality down the road. In .Net, there IS a problem, because if you are using Reflection, the Field is now a Property (in .Net terms), so it will be in a different collection in Reflection. Back to my original point, to this thread, I have been using .Net for about a year now, since I was out of the development world for a while. I have only recently had a reason to use Reflection, which I stumbled on, because as a VB 6 Programmer, there WAS no distinction between property declaration types like there is in .Net. I am not complaining that there is a difference, in fact, it is quite handy to have two separate Reflection collections to use. I was simply stating that it was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or are just crossing the bridge into the .Net world. Like saying that there is no more Variant variable type. Would you like to give us a tirade about how Variant types never truly existed, and how I personally will never understand that concept? Seriously John, you need to read more than a few lines of my posts. A lot of what you have said makes you sound like an a$$, not as a skilled professional. My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 3:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Fri Apr 15 17:33:59 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:33:59 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Sorry, I can't agree with you there. A METHOD is a function. A PROPERTY is the external name given to a variable which is encapsulated in the class. i.e. for all intents and purposes outside of the object, it IS the variable. "PROPERTY SET" and "PROPERTY GET" are methods. The fact that you can also perform other actions when you SET a variable is irrelevant. You should be doing what it is saying and setting the value of the variable. When you GET it, you should be retrieving the value of the variable. Wiile it is possible to create SET/GET functions for a property so that GET doesn't return what is SET, it is a gross abuse of the whole Object concept. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the outside world but that is not all > it can do. A property does not *define* the variable, that is done in > the dimension statement. A property does not "own" the variable that > it wraps, it is simply *returning* the variable. A property does not > have any data storage area on the heap unless it happens to dimension > its own variables inside of the property, and even then (except for > strings and statics) most variables inside of functions are stored on > the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap sized to accept a specific data type. > From jwcolby at colbyconsulting.com Fri Apr 15 17:37:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 18:37:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8C8AA.6000102@colbyconsulting.com> >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From stuart at lexacorp.com.pg Fri Apr 15 17:38:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:38:02 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: , , <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > From stuart at lexacorp.com.pg Fri Apr 15 17:48:25 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:48:25 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> The problem as I see it is that "Public fields" are an abomination. Because Java has then, .Net has to as well :-( You should not be able to accept any "properties" of an object other than through GET/SET processes. -- Stuart On 15 Apr 2011 at 16:18, jwcolby wrote: > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" which absolutely one of many English > language (and programming) definitions of property. > > You have already told us (as have I) that a public field and a > property (keyword / function) behave differently. > > The problem is yours not mine. I understand and use your definition > in the same way you do. I do not expect a public field to behave in > the same way that a property (keyword / function) does because they > are fundamentally different things. Personally I do not call a public > field a property, I call it a public field (in programmer speak), > though of course it is a property in English language speak. > > You no longer expect them to behave the same because you have > discovered that they are fundamentally different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and moan that they behave differently. To > which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > From jwcolby at colbyconsulting.com Fri Apr 15 18:28:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:28:47 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> References: , , <4DA83D8E.5020106@colbyconsulting.com> <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Message-ID: <4DA8D4AF.8050107@colbyconsulting.com> >> A PROPERTY is the external name given to a variable which is encapsulated in the class. LOL, absolutely and unequivocally not true. It is the name of some data value associated with or encapsulated by the class but it is simply *not* always and necessarily a variable. Nor is it an invalid use of a property if it is not a wrapped variable! There are properties that do not even reference a variable at all and they are perfectly valid uses of property. I can take three booleans and return a true of all are true (and I do exactly that in one of my properties). It is a property (English definition) that the class is stopped when three child classes are all stopped. The child objects use threads and write to a status control on a form. I cannot (don't want to) close the form until they are all stopped - their threads are no longer running. The form asks the manager if it is stopped when I try to close the form. It does so by checking the boolean stopped property of the manager. The boolean stopped property (get) asks the child objects if they are stopped and returns a true if all three are true else returns a false. It is not wrapping a variable, you can't set the stop variable, there isn't one. It is a valid property however. I can take 16 booleans and "translate them" into an integer value from 0 to 16 if that is what I need to do. A property (English) is a data value, but it is not necessarily a stored value and in fact it is quite often a calculated value. The fact that you personally say that is bad practice doesn't impress me. If I use the property to calculate a state (data item) of the class that is a property (English) of the class the same as your stored value is. I understand perfectly well that a property is not a function (or method) but it has more properties (English) of a function than a variable - public or otherwise. I used "function with quotes at the start of the thread to clearly denote that a property was not a function. However a property (keyword) is a call. It pushes the current address pointer on the stack. A property set (or let) pushes the value on the stack. Inside of the property other lines of code can and do run. A property does not inherently have any storage. They can do anything that is logical for a property to do. When it returns it's value (if a get) is placed on the stack and it unwinds the stack. Sounds much more "function" than a dimensioned variable. Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > Sorry, I can't agree with you there. > > A METHOD is a function. > > A PROPERTY is the external name given to a variable which is encapsulated in the class. > i.e. for all intents and purposes outside of the object, it IS the variable. > > "PROPERTY SET" and "PROPERTY GET" are methods. > > The fact that you can also perform other actions when you SET a variable is irrelevant. You > should be doing what it is saying and setting the value of the variable. When you GET it, you > should be retrieving the value of the variable. > > Wiile it is possible to create SET/GET functions for a property so that GET doesn't return > what is SET, it is a gross abuse of the whole Object concept. From jwcolby at colbyconsulting.com Fri Apr 15 18:29:09 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:09 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: <4DA8D4C5.8000902@colbyconsulting.com> Nonsense. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:38 PM, Stuart McLachlan wrote: > That is a gross abuse of the whole Object paradigm. > > On 15 Apr 2011 at 15:26, jwcolby wrote: > >> I have had properties which did not wrap a variable at all. >> > > From jwcolby at colbyconsulting.com Fri Apr 15 18:29:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:50 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> References: , , <4DA8A816.9000705@colbyconsulting.com> <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> Message-ID: <4DA8D4EE.80503@colbyconsulting.com> Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > From davidmcafee at gmail.com Fri Apr 15 18:35:38 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 15 Apr 2011 16:35:38 -0700 Subject: [AccessD] is this date affected? Message-ID: I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From vbacreations at gmail.com Fri Apr 15 19:15:04 2011 From: vbacreations at gmail.com (William Benson) Date: Fri, 15 Apr 2011 20:15:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> Message-ID: Dumb question maybe... but have you tested that code in anything earlier than 2007?? I would think that the intrinsic constant is not recognized.... maybe compatibility mode handles...? On Apr 15, 2011 11:11 AM, "Michael Bahr" wrote: > You forgot Preparation H. > > Mike > >> They took off a year? (Whatever happened to Preparations A through G?) >> >> R >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos >> Sent: Thursday, April 14, 2011 2:43 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] 2010 Version >> >> 14 is the magic number >> >> http://en.wikipedia.org/wiki/Microsoft_Access >> >> GK >> >> On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin >> wrote: >>> Dear List: >>> >>> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >>> using: >>> >>> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >>> acToolbarNo >>> >>> If I want to check for 2010, what version number should I use? >>> >>> MTIA >>> >>> >>> Rocky Smolin >>> >>> Beach Access Software >>> >>> 858-259-4334 >>> >>> Skype: rocky.smolin >>> >>> www.e-z-mrp.com >>> >>> www.bchacc.com >>> >>> >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> Gary Kjos >> garykjos at gmail.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 15 19:15:20 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:15:20 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. There, that's fixed it :-) -- Stuart On 15 Apr 2011 at 19:28, jwcolby wrote: > >> A PROPERTY is the external name given to a variable which is > encapsulated in the class. > > > LOL, absolutely and unequivocally not true. It is the name of some > data value associated with or encapsulated by the class but it is > simply *not* always and necessarily a variable. Nor is it an invalid > use of a property if it is not a wrapped variable! > > There are properties that do not even reference a variable at all and > they are perfectly valid uses of property. I can take three booleans > and return a true of all are true (and I do exactly that in one of my > properties). It is a property (English definition) that the class is > stopped when three child classes are all stopped. The child objects > use threads and write to a status control on a form. I cannot (don't > want to) close the form until they are all stopped - their threads are > no longer running. > > The form asks the manager if it is stopped when I try to close the > form. It does so by checking the boolean stopped property of the > manager. The boolean stopped property (get) asks the child objects if > they are stopped and returns a true if all three are true else returns > a false. > > It is not wrapping a variable, you can't set the stop variable, there > isn't one. It is a valid property however. > > I can take 16 booleans and "translate them" into an integer value from > 0 to 16 if that is what I need to do. A property (English) is a data > value, but it is not necessarily a stored value and in fact it is > quite often a calculated value. The fact that you personally say that > is bad practice doesn't impress me. If I use the property to > calculate a state (data item) of the class that is a property > (English) of the class the same as your stored value is. > > I understand perfectly well that a property is not a function (or > method) but it has more properties (English) of a function than a > variable - public or otherwise. I used "function with quotes at the > start of the thread to clearly denote that a property was not a > function. > > However a property (keyword) is a call. It pushes the current address > pointer on the stack. A property set (or let) pushes the value on the > stack. Inside of the property other lines of code can and do run. A > property does not inherently have any storage. They can do anything > that is logical for a property to do. > > When it returns it's value (if a get) is placed on the stack and it > unwinds the stack. > > Sounds much more "function" than a dimensioned variable. > > Drew mentioned my "soap box". I do not have a soap box, I am simply > insisting that we acknowledge the facts. I have no idea what goes on > in VB6 because I do not use it. However I have used a class or two > (or three maybe?) in Access so I do understand VBA. Obviously Drew is > a better (and wittier) programmer than I but let's attempt to > understand (and discuss so others can understand) what these things > are, what they do and when we are using an English definition and when > we are using a keyword, and when we are just using a vague kinda sorta > definition. > > And when we are using an object. A property is also often an object > in OO environments. > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > > Sorry, I can't agree with you there. > > > > A METHOD is a function. > > > > A PROPERTY is the external name given to a variable which is > > encapsulated in the class. i.e. for all intents and purposes outside > > of the object, it IS the variable. > > > > "PROPERTY SET" and "PROPERTY GET" are methods. > > > > The fact that you can also perform other actions when you SET a > > variable is irrelevant. You should be doing what it is saying and > > setting the value of the variable. When you GET it, you should be > > retrieving the value of the variable. > > > > Wiile it is possible to create SET/GET functions for a property so > > that GET doesn't return what is SET, it is a gross abuse of the > > whole Object concept. > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 15 19:50:56 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:50:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net>, Message-ID: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Application.Version has been around for a long time. That code certainly works in A2K3. It does nothing. because Application.Version = 11. I use it for frequently for mdbs that are runnning in a mixed environment (A2K3 and A2007). On 15 Apr 2011 at 20:15, William Benson wrote: > Dumb question maybe... but have you tested that code in anything > earlier than 2007?? I would think that the intrinsic constant is not > recognized.... maybe compatibility mode handles...? ... > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo From jwcolby at colbyconsulting.com Fri Apr 15 21:47:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 22:47:06 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> Message-ID: <4DA9032A.1060304@colbyconsulting.com> > OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. Why do you insist on tying it to at least one variable? It isn't. I have a flag class (in C#). When that class instantiates, the constructor is fed a table, field and PK of a specific record and promptly loads the contents of that field into a variable. The variable may be a date (when an event occurred) or an integer (one means that process occurred, a zero means that process has not occurred). That class has a boolean which can be read or set. If it is set true, the property sets the variable "behind the scene" to either now() or 1 depending on the kind of flag it is. Additionally the property set causes a function to execute which dynamically constructs a sql statement and writes the date or integer into SQL Server. When you read the variable it returns the value associated with that flag, which is really a field in SQL server. So the property is boolean, but the actual variable read / written can be either a date or an integer. The property causes a fair bit of code to run which "interprets" something and returns a true / false. In fact if I so desired I could make the "variable" the actual data in the field in the specific record in SQL Server. This property exposes the boolean through a property (keyword) and that property is exposed to internal code of the parent object so that the parent object can read / write flags from SQL Server in a logical and consistent manner. I could, if I so desired, cause the property to read a serial port and return a value on a strain gauge, or the temperature of a sensor in a machine, or a frequency of a phase lock loop, or a value of an Analog to digital converter or the value of 2/3 rounded to 4 decimal places... In the end all you can really say about a property (get) is that it returns a unit of data. You may or may not be able to set the value. To call a register in a DToA a variable is a bit of a stretch, but if you insist that's fine. But the value of 2/3? No variables involved there. A property get returns a value, a property let accepts a value and does something with it. Storing it? Not necessarily. It may just feed it off to a machine somewhere which does something with the value. It could fire a stepper motor, or set a voltage in a Digital to Analog converter, or it could pull in a relay and spray water all over your computer. By the way that is a write only property which I lovingly call HoseTheTwitsdown. ;) It is a property of the Colbyizer class which has many different properties to allow me to do everything from HoseTheTwitsDown to BoottheTwitsOutTheDoorAt20000Feet. Don't make me use the more extreme properties. :) John W. Colby www.ColbyConsulting.com On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > OK. A property is the the external name given to the state of one or more variables ( scalar > or object) encapsulated within the class.. > > There, that's fixed it :-) > From stuart at lexacorp.com.pg Fri Apr 15 23:20:36 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 14:20:36 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA9032A.1060304@colbyconsulting.com> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> Message-ID: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Sorry, I can't accept that; A write-only property is the local equivalent of this: http://www.supersimplestorageservice.com/ If you can't get a meaningful value from it, then it is not a property - it is a method ( and I don't mean a return value indicating success or failure of the SET) HoseTheTwits Down is a Method. -- Stuart On 15 Apr 2011 at 22:47, jwcolby wrote: > A property get returns a value, a property let accepts a value and > does something with it. Storing it? Not necessarily. It may just > feed it off to a machine somewhere which does something with the > value. It could fire a stepper motor, or set a voltage in a Digital > to Analog converter, or it could pull in a relay and spray water all > over your computer. By the way that is a write only property which I > lovingly call HoseTheTwitsdown. > > ;) > > It is a property of the Colbyizer class which has many different > properties to allow me to do everything from HoseTheTwitsDown to > BoottheTwitsOutTheDoorAt20000Feet. > > Don't make me use the more extreme properties. > > :) > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > > OK. A property is the the external name given to the state of one > > or more variables ( scalar or object) encapsulated within the > > class.. > > > > There, that's fixed it :-) > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From vbacreations at gmail.com Fri Apr 15 23:59:04 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 00:59:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Message-ID: This is quite a surprise. This implies that the code compiles even though vba for access 2003 ought to have no idea what that constant is. Thus compiler is ignoring the code on the "Then" part of the statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" wrote: > Application.Version has been around for a long time. That code certainly works in A2K3. It > does nothing. because Application.Version = 11. I use it for frequently for mdbs that are > runnning in a mixed environment (A2K3 and A2007). > > > On 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question maybe... but have you tested that code in anything >> earlier than 2007?? I would think that the intrinsic constant is not >> recognized.... maybe compatibility mode handles...? > > ... >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 16 01:59:33 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 16:59:33 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg>, Message-ID: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is a toolbar called "Ribbon". That constant is only evaluated at runtime if the Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. -- Stuart On 16 Apr 2011 at 0:59, William Benson wrote: > This is quite a surprise. This implies that the code compiles even > though vba for access 2003 ought to have no idea what that constant > is. Thus compiler is ignoring the code on the "Then" part of the > statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" > wrote: > Application.Version has been around > for a long time. That code certainly works in A2K3. It > does nothing. > because Application.Version = 11. I use it for frequently for mdbs > that are > runnning in a mixed environment (A2K3 and A2007). > > > On > 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question > maybe... but have you tested that code in anything >> earlier than > 2007?? I would think that the intrinsic constant is not >> > recognized.... maybe compatibility mode handles...? > > ... >> If > Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From vbacreations at gmail.com Sat Apr 16 05:51:23 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 06:51:23 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> References: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Message-ID: Great, thanks! On Apr 16, 2011 3:02 AM, "Stuart McLachlan" wrote: > Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is > a toolbar called "Ribbon". That constant is only evaluated at runtime if the > Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. > > -- > Stuart > > > On 16 Apr 2011 at 0:59, William Benson wrote: > >> This is quite a surprise. This implies that the code compiles even >> though vba for access 2003 ought to have no idea what that constant >> is. Thus compiler is ignoring the code on the "Then" part of the >> statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" >> wrote: > Application.Version has been around >> for a long time. That code certainly works in A2K3. It > does nothing. >> because Application.Version = 11. I use it for frequently for mdbs >> that are > runnning in a mixed environment (A2K3 and A2007). > > > On >> 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question >> maybe... but have you tested that code in anything >> earlier than >> 2007?? I would think that the intrinsic constant is not >> >> recognized.... maybe compatibility mode handles...? > > ... >> If >> Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 16 10:59:22 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 16 Apr 2011 17:59:22 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From rockysmolin at bchacc.com Sat Apr 16 12:14:10 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 16 Apr 2011 10:14:10 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: <130733C3468C4FEB89AC6671E8846036@HAL9005> There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 16 12:51:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 16 Apr 2011 13:51:16 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Message-ID: <4DA9D714.8060503@colbyconsulting.com> Stuart, C# of course. http://msdn.microsoft.com/en-us/library/w86s7x04%28v=vs.80%29.aspx Unlike fields, properties are not classified as variables. Therefore, it is not possible to pass a property as a ref (C# Reference) or out (C# Reference) parameter. Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields. >>> from Stack Overflow: >>> One use for a write-only property is to support setter dependency injection. Let's say I had a class: public class WhizbangService { public WhizbangProvider Provider { set; private get; } } The WhizbangProvider is not intended to be accessed by the outside world. I'd never want to interact with service.Provider, it's too complex. I need a class like WhizbangService to act as a facade. Yet with the setter, I can do something like this: service.Provider = new FireworksShow(); service.Start(); And the service starts a fireworks display. Or maybe you'd rather see a water and light show: service.Stop(); service.Provider = new FountainDisplay(new StringOfLights(), 20, UnitOfTime.Seconds); service.Start(); Expand your mind. Sit in the sun, close your eyes, contemplate your belly button. And yes, HoseTheTwitsDown actually is a method - which I was fantasizing about using... ;) John W. Colby www.ColbyConsulting.com On 4/16/2011 12:20 AM, Stuart McLachlan wrote: > Sorry, I can't accept that; A write-only property is the local equivalent of this: > http://www.supersimplestorageservice.com/ > > If you can't get a meaningful value from it, then it is not a property - it is a method ( and I > don't mean a return value indicating success or failure of the SET) > > HoseTheTwits Down is a Method. > From DWUTKA at Marlow.com Sat Apr 16 16:36:37 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:36:37 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8AA.6000102@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> <4DA8C8AA.6000102@colbyconsulting.com> Message-ID: Finally, we agree on something. Glad you finally came to your wits... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:39:03 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:39:03 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: Actually, I have to disagree with you Stuart, a property doesn't necessarily have to wrap a variable. It could wrap a constant. It could wrap a value that is not directly related to a variable, say it could represent some 'condition'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:41:44 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:41:44 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com><4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: Yes, and if you were referring to a property as a field, in VBA, you were using incorrect terminology in that environment. ;) Drew Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:42:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:42:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4EE.80503@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com><4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> <4DA8D4EE.80503@colbyconsulting.com> Message-ID: That's like saying that it would be a good thing if there was no way to make a form 'bound' in some way to data automatically.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 6:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From adtp at airtelmail.in Sat Apr 16 22:57:47 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Sun, 17 Apr 2011 09:27:47 +0530 Subject: [AccessD] is this date affected? References: <130733C3468C4FEB89AC6671E8846036@HAL9005> Message-ID: <00475C102A0F4440809644E445155921@personal4a8ede> David, Another alternative could be considered. You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: IsAffected = ((Dt2 - Dt1) Mod 14 = 0) If the condition is to be checked in an If / End If block, the syntax could be as follows: If (Dt2 - Dt1) Mod 14 = 0 Then Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Rocky Smolin To: 'Access Developers discussion and problem solving' Sent: Saturday, April 16, 2011 22:44 Subject: Re: [AccessD] is this date affected? There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From davidmcafee at gmail.com Mon Apr 18 12:52:44 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 10:52:44 -0700 Subject: [AccessD] is this date affected? In-Reply-To: <00475C102A0F4440809644E445155921@personal4a8ede> References: <130733C3468C4FEB89AC6671E8846036@HAL9005> <00475C102A0F4440809644E445155921@personal4a8ede> Message-ID: Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal > ------------ > > ----- Original Message ----- > From: Rocky Smolin > To: 'Access Developers discussion and problem solving' > Sent: Saturday, April 16, 2011 22:44 > Subject: Re: [AccessD] is this date affected? > > > There's a Weekday function in VBA that you pass a date to and it returns a > number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, April 16, 2011 8:59 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] is this date affected? > > Hi David > > You can build a collection of the dates using a loop and DateAdd. > Then look up your date in this collection. > > /gustav > > > >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> > I was wondering if anyone already has some code or Jet SQL to determine if > a > date is affected? > > Such as Every other Saturday for the next x Saturdays starting 4/16/2011 > (2011.04.16 ;) ) > > Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) > > I was going to write a function, but I was wondering I am re-inventing the > wheel, or if there is some built in too to do so. > > Thanks, > David > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Mon Apr 18 13:11:51 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 18 Apr 2011 20:11:51 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". /gustav >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal From davidmcafee at gmail.com Mon Apr 18 15:01:32 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 13:01:32 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the > next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had > to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate > > Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the > > following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax > > could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Tue Apr 19 04:57:50 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Apr 2011 11:57:50 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Not exactly. That will loosen the condition to satisfy the question: "such as Every other Saturday before x weeks after 4/16/2011". For example, 2011-03-19 will be accepted, and these values will be as well: StartingSat = #2011/04/17# NumOfSats = 5 SiQ = #2011/05/15# Of course, you may have validated SiQ to be larger than StartingSat as well as StartingSat to be a Saturday prior to calling your easy expression, but how can we know? Also, the DateAdd formula could be reduced to: DateAdd("ww", NumOfSats, StartingSat) /gustav >>> davidmcafee at gmail.com 18-04-2011 22:01 >>> Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal From jwcolby at colbyconsulting.com Tue Apr 19 13:26:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 19 Apr 2011 14:26:18 -0400 Subject: [AccessD] Exact reports are such a pita Message-ID: <4DADD3CA.7010106@colbyconsulting.com> I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Tue Apr 19 13:32:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 13:32:06 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <004301cbfec0$16c2eb40$4448c1c0$@comcast.net> I think I would just build a string, using the values if I have them, underscores if I don't. If you're using Access 2002+, you can use the OpenArgs parameter when you open the report, if that would work out. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Tue Apr 19 13:33:54 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 19 Apr 2011 13:33:54 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Tue Apr 19 13:45:32 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 11:45:32 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Tue Apr 19 14:32:45 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Wed, 20 Apr 2011 07:32:45 +1200 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> References: <4DADD3CA.7010106@colbyconsulting.com> <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Message-ID: <9728D49895B043959AFD82816DBD3DBF@stevelaptop> I agree. I don't think the idea of a temp table is over the top. That's how I would do it. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Wednesday, April 20, 2011 6:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Exact reports are such a pita Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? From john at winhaven.net Tue Apr 19 15:30:34 2011 From: john at winhaven.net (John Bartow) Date: Tue, 19 Apr 2011 15:30:34 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <00bf01cbfed0$a2f48e60$e8ddab20$@winhaven.net> That's how I handle "previously done on a form" reports with my apps. Makes the form look perfect and it relieves you of having to fudge around with data. I've honestly had to do this and then duplicate the report and remove the image background, and include a choice for the user to either insert preprinted forms or print the entire form (there was no discernable difference). Supposedly this was because the client didn't want to waste all of those preprinted forms they had. I did a follow up about a year later and the client had actually ordered more preprinted forms! Yes, you guessed it. It was a government job. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, April 19, 2011 1:34 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Exact reports are such a pita Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 19 15:37:24 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 13:37:24 -0700 Subject: [AccessD] Hide Form Title Bar Message-ID: Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From df.waters at comcast.net Tue Apr 19 16:39:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 16:39:06 -0500 Subject: [AccessD] OT: Windows Kinect SDK Beta Message-ID: <002401cbfeda$35f42730$a1dc7590$@comcast.net> If you combine this with XKCD, there's going to be a lot of trouble. I'm not saying anything more. Dan From ab-mi at post3.tele.dk Tue Apr 19 16:45:26 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Tue, 19 Apr 2011 23:45:26 +0200 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: Don't think you can eliminate the title bar on a sizable form. But you can eliminate the contents of the bar using these settings: Caption: ControlBox: No MinMaxButtons: None CloseButton: No Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Rocky Smolin Sendt: 19. april 2011 22:37 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Tue Apr 19 17:23:20 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Tue, 19 Apr 2011 17:23:20 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # References: <07230D1FF5AD4611A350B33814B094C6@HAL9005><74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad From charlotte.foust at gmail.com Tue Apr 19 20:15:41 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:15:41 -0700 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: I'm not sure this is an Access issue. I seem to recall that the # sign has a specific meaning in passing data into and out of delimited text file. Maybe someone else can recall the specifics. You might be able to work around it by either using a double # in the export spec for the field name, or else export and then rename the field in the csv file using text IO code. Charlotte Foust On Tue, Apr 19, 2011 at 3:23 PM, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our testing) > and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't understand. > > Is there a way to force Access to not replace the "#" with a "." ?? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 19 20:23:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:23:15 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: If you want to use a continuous subform, you could count the records you have and then add dummy records to fill out the count. You would want to either use a temp table or create a new recordset and add the dummy records to that, then dispose the recordset when done. Charlotte Foust On Tue, Apr 19, 2011 at 11:26 AM, jwcolby wrote: > I need to build a report that looks as close as possible to a state form. > ?This includes a couple of subforms which look like: > > 1) From:_____________ To:___________ > 2) From:_____________ To:___________ > 3) From:_____________ To:___________ > > And if I don't have a line 2 or line 3 I still need to fake it, put in the > number and underline. > > IOW it should be indistinguishable from a copy of their form casually > compared side by side. > > Can you say PITA. > > The only thing I can think of is to build a temp table, place the 1) 2) and > 3) in three records (programmatically) and then fill in each record as > needed. > > That seems rather over the top. ?Any suggestions for easy ways to fake this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Darryl.Collins at iag.com.au Tue Apr 19 20:26:03 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Wed, 20 Apr 2011 11:26:03 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: Message-ID: <201104200126.p3K1QAR6009307@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Perhaps a cheap and easy solution that may work nicely is to use a valid placeholder during the export and creation of the CSV file instead of the "#". Maybe something like "Employee$" and then once the CSV is exported use code to perform a global search and replace on the .txt file where the "#" char is not going to be an issue. .replace ""Employee$", ""Employee#" or similar. hth a bit Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Wednesday, 20 April 2011 8:23 AM To: Access Developers discussion and problem solving Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Tue Apr 19 22:40:09 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 13:40:09 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DAE5599.938.1FB46483@stuart.lexacorp.com.pg> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Apr 20 02:59:26 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 20 Apr 2011 09:59:26 +0200 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # Message-ID: Hi Brad Listen to Stuart. Once you have this set up you are in total control and will never look back. The same goes for importing text files. /gustav >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad From stuart at lexacorp.com.pg Wed Apr 20 04:53:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 19:53:45 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: Message-ID: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 20 09:46:23 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 20 Apr 2011 10:46:23 -0400 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 10:28:40 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 08:28:40 -0700 Subject: [AccessD] Search as you type Message-ID: I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug From charlotte.foust at gmail.com Wed Apr 20 11:01:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 09:01:06 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Try using a disconnected ADO recordset and apply a filter to return the limited recordset. That should make the search fast because the recordset is no longer connected to the back end. What are you planning to do if there are multiple results for the find? The user could actually edit the record if you require that and then you would have to reconnect the recordset and update the source. I have an old demo on roger's access site that was built in 2000 (AFAIR) that uses disconnected recordsets to load and update data. You might have a look at it and see if it gives you any ideas. Watch out for a wrap. http://www.rogersaccesslibrary.com/forum/foust-charlotte_forum14&SID=f27a794a-684c-f2495918-e4c25924-463bez2z.html Charlotte Foust On Wed, Apr 20, 2011 at 8:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 11:03:00 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 12:03:00 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: <4DAF03B4.3060501@colbyconsulting.com> In the onchanged event of the text box you can set a form timer to fire X ticks later. Every time the onchanged fires the timer is "reset" to be x ticks out. When the timer fires, reset the timer to not fire ( a value of 0 ticks I think) and then go do the search. Each tick is a millisecond so set it for 1000 to get a 1 second delay. Something like that. John W. Colby www.ColbyConsulting.com On 4/20/2011 11:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug From shamil at smsconsulting.spb.ru Wed Apr 20 11:14:14 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 20 Apr 2011 20:14:14 +0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Hi Doug -- I suppose you can try to use KeyDown event and run search only when {Enter} or any other special char(s) combination is pressed. Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then MsgBox (txtSearch.Text) ' suppress if needed => KeyCode = 0 End If End Sub Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: 20 ?????? 2011 ?. 19:29 To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed Apr 20 11:21:46 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 20 Apr 2011 09:21:46 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 20 12:17:48 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 20 Apr 2011 13:17:48 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Doug, How many records will they be searching against roughly? You can do a reasonable incremental search character by character with DAO by using a seek on an index (which is the fastest method for finding a match), but that tops out at about 50,000 records depending on the speed of the network and PC. Might also want to consider searching on a snapshot. Using a snapshot, the data will be cached locally in a temp file. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 11:29 AM To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 13:28:18 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 11:28:18 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Thanks for the responses. I'll do some experimenting and report back. Jim, the recordset is fairly small (500 or so records) but is based on about 15 large tables. The form isn't editable, so I guess a snapshot should work. Doug On Wed, Apr 20, 2011 at 10:17 AM, Jim Dettman wrote: > Doug, > > ?How many records will they be searching against roughly? > > ?You can do a reasonable incremental search character by character with DAO > by using a seek on an index (which is the fastest method for finding a > match), but that tops out at about 50,000 records depending on the speed of > the network and PC. > > ?Might also want to consider searching on a snapshot. ?Using a snapshot, > the data will be cached locally in a temp file. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, April 20, 2011 11:29 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Search as you type > > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 15:39:02 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 16:39:02 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working Message-ID: <4DAF4466.7010506@colbyconsulting.com> I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the move but it isn't working. Has anyone ever seen this and a fix? -- John W. Colby www.ColbyConsulting.com From BradM at blackforestltd.com Wed Apr 20 15:49:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 15:49:22 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # References: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Message-ID: All, Thanks for the advice and insights. I am planning to experiment with the ideas posted. I like the sounds of the "roll your own" export (I am a product of the 1960s :-) I have never used Access to tweak a flat file, so that also is something that sounds interesting, at least to have in the bag-of-tricks. (If someone has a simple example that they are willing to share, I would appreciate it). Thanks again, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 15:58:31 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 13:58:31 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: ADO or DAO recordset? Charlotte Foust On Wed, Apr 20, 2011 at 1:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. ?The bookmark is the > accepted way of doing the move but it isn't working. > > Has anyone ever seen this and a fix? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 16:02:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 17:02:36 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: <4DAF49EC.7070606@colbyconsulting.com> Never mind. PBKAC! John W. Colby www.ColbyConsulting.com On 4/20/2011 4:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the > move but it isn't working. > > Has anyone ever seen this and a fix? > From dbdoug at gmail.com Wed Apr 20 16:05:34 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 14:05:34 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF49EC.7070606@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Wed Apr 20 16:07:42 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 16:07:42 -0500 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working References: <4DAF4466.7010506@colbyconsulting.com><4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem Between Keyboard and Chair ? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 4:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Me.Bookmark = rst.Bookmark not working OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 16:08:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 14:08:06 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem (exists) Between Keyboard And Chair Charlotte Foust On Wed, Apr 20, 2011 at 2:05 PM, Doug Steele wrote: > OK, I'll bite - what is PBKAC? > Doug > > On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: >> Never mind. PBKAC! >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/20/2011 4:39 PM, jwcolby wrote: >>> >>> I am trying to lookup and move to a record in a form. The bookmark is the >>> accepted way of doing the >>> move but it isn't working. >>> >>> Has anyone ever seen this and a fix? >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Wed Apr 20 16:37:35 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 21 Apr 2011 07:37:35 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # In-Reply-To: References: , Message-ID: <4DAF521F.5986.238ED302@stuart.lexacorp.com.pg> One useful "flat file tweak" is when you are supplied with a Unix file that has LF as line terminators instead of CRLF. You need to convert such files before you can read them in with Line Input. Here's a simple function to read the whole file into memory and change LFs to CRLFs. It works fine as long as the export file doesn't exceed about 2 billion characters, which is the limit of a single string length. :-) There are lots of other things you can do in a similar vein. You could for instance parse the file into an array of lines instead using strMyArray() = Split(strTemp,Chr$(10)) Function UnixToDosFile(filename) As Long Dim fileroot As String Dim fileext As String Dim newfile As String Dim ff As Long Dim flen As Long Dim strTemp As String 'Create a name for the output file fileext = Right$(filename, Len(filename) - InStrRev(filename, ".")) fileroot = Left$(filename, InStrRev(filename, ".") - 1) newfile = fileroot & "-DOS." & fileext 'Get a file handle ff = FreeFile 'Load complete Unix file into memory Open filename For Binary As #ff flen = LOF(ff) ' how big is the file strTemp = Space$(flen) 'make our buffer the same size. Get #ff, , strTemp 'get the file into memory Close #ff 'Replace LF with CRLF strTemp = Replace(strTemp, Chr$(10), Chr$(13) & Chr$(10)) 'Save new file Open newfile For Binary As #ff Put #ff, , strTemp Close #ff End Function -- Stuart On 20 Apr 2011 at 15:49, Brad Marks wrote: > All, > > Thanks for the advice and insights. > > I am planning to experiment with the ideas posted. > > I like the sounds of the "roll your own" export (I am a product of the > 1960s :-) > > I have never used Access to tweak a flat file, so that also is > something that sounds interesting, at least to have in the > bag-of-tricks. (If someone has a simple example that they are willing > to share, I would appreciate it). > > Thanks again, > Brad > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] > Problem Exporting to a CSV file with a Column Namethat has a # > > Hi Brad, > > Listen to Gustav ;-) > > Especially for import. You willl find all sorts of CSV file formats. > The biggest problem is the inconsistent use of "quotes". Sometime all > dates and strings are quoted, sometimes they are only quoted if they > contain a comma, sometimes you will get numbers quoted because they > are formatted to include commas and others which are not because they > don't include commas, sometimes you will get embedded real quotes > represented as double quotes. You can get all of these variations in > a single file. The built in Import function can't handle many of > them. > > What I do is import the line, strip the quotes and convert it into Tab > delimited strings without extraneous quotes. > > Function ConvertLine(strIn As String) As String > 'Converts CSV(either quoted or non-quoted text) to TAB delimited > Dim inquotes As Boolean Dim strC As String Dim x As Long > > 'Change real delimiter commas to Tabs > 'ie those that aren't inside quotes > For x = 1 To Len(strIn) > strC = Mid$(strIn, x, 1) > If strC = "," And Not inquotes Then > Mid$(strIn, x, 1) = Chr$(9) > End If > If strC = """" Then > inquotes = Not inquotes > End If > Next > > ' there may be real quotes escaped as "paired" quotes > ' so change them temporarily to a non print character > strln = Replace(strln,"""""",chr$(1)) > > 'get rid of all the remaining quotes > strln = Replace(strIn, """", "") > > 're-instate the escaped quotes > ConvertLine = Replace(strln,Chr$(1),"""") > End Function > > Then I split the record using > ... > Line Input #ff strInputLine > strData() = Split(Convertline(strInputLine),Chr$(9)) > ... > > Once you have done that, you can convert the strings to other data > types as required. > > -- > Stuart > > On 20 Apr 2011 at 9:59, Gustav Brock wrote: > > > Hi Brad > > > > Listen to Stuart. > > Once you have this set up you are in total control and will never > > look back. The same goes for importing text files. > > > > /gustav > > > > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > > The best solution is not to use the built in Access export routine. > > Roll your own and you can put anything you want in the file. > > > > Aircode: > > > > Function Export() as Long > > Dim rs as DAO.Recordset > > Dim ff as long > > ff = Freefile > > set rs = CurrentDB.Openrecordset("qryMyExport") > > ff = Freefile > > Open "myExportFile.csv" for Output as #ff > > Print #1,"First fieldname,Employee #,Third fieldname" > > While not rs.Eof > > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > > rs.movenext > > Wend > > Close #ff > > End Function > > > > -- > > Stuart > > > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > > > All, > > > > > > We are just starting to use an Access 2007 application to feed > > > data to another outside system via a CSV file. > > > > > > This outside system is very rigid and we need to use exact field > > > names on the CSV file that we are creating. > > > > > > The catch is that one of the fields is call "Employee #". > > > > > > We set up an Export Specification (called Export-Query1 for our > > > testing) and we are using the following command to do the export > > > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > > > When we run the application, everything works nicely, except the > > > field named "Employee #" is somehow being renamed "Employee ." in > > > the generated CSV file. > > > > > > We have run a number of tests and it looks like we have stumbled > > > upon either a "bug" a "feature", or something that we just don't > > > understand. > > > > > > Is there a way to force Access to not replace the "#" with a "." > > > ? > > > > > > Thanks for your help, > > > > > > Brad > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Thu Apr 21 10:33:09 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 21 Apr 2011 08:33:09 -0700 Subject: [AccessD] Search as you type (note to JC) Message-ID: John, the timer logic you suggested for the search box worked like a charm. It makes the search much smoother to use. I'm still going experiment with ADO for this when I have a bit of time. Doug From DWUTKA at Marlow.com Thu Apr 21 10:33:51 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 10:33:51 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:22:40 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:22:40 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 21 11:28:37 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:28:37 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <2F55242637C64867956F4EF369D6E259@HAL9005> Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:30:28 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:30:28 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:39:20 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:39:20 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <64BB5603B8E945EC97F03BBD8B503D18@HAL9005> Yep. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:50:38 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:50:38 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <2F55242637C64867956F4EF369D6E259@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> <2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 21 12:26:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 21 Apr 2011 13:26:38 -0400 Subject: [AccessD] Search as you type (note to JC) In-Reply-To: References: Message-ID: <4DB068CE.9040408@colbyconsulting.com> > John, the timer logic you suggested for the search box worked like a charm. Its nice to occasionally get one right. :) Long ago I built a system to take a list and populate it with the matches to the characters being typed into a text box. I sized the list to just a single line and positioned it butted up to the bottom of the text box. As the user typed the first character into the text box, the logic "opened" the list by causing the size to change to some value (a few inches). Then I populated the list with "like CharactersTypedIn*". When the user tabbed out (onExit of the text box) the top value in the list was pulled into the text box and the list pulled back up to a single line. It worked just like a combo box basically. John W. Colby www.ColbyConsulting.com On 4/21/2011 11:33 AM, Doug Steele wrote: > John, the timer logic you suggested for the search box worked like a > charm. It makes the search much smoother to use. > > I'm still going experiment with ADO for this when I have a bit of time. > > Doug From accessd at shaw.ca Thu Apr 21 13:17:13 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 21 Apr 2011 11:17:13 -0700 Subject: [AccessD] Slightly off topic In-Reply-To: <4DB068CE.9040408@colbyconsulting.com> References: <4DB068CE.9040408@colbyconsulting.com> Message-ID: Hi All: Does anyone know of a little routine that will open a DVD drive and then re-close it. I have some remote processes that have this requirement. MTIA Jim From jwcolby at colbyconsulting.com Fri Apr 22 07:44:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 08:44:50 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: <4DB17842.4020604@colbyconsulting.com> I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Apr 22 08:06:23 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 09:06:23 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB17842.4020604@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Hi John, I've just finished a similar project for downloading all pdf and xls from a site and the iron is still hot. I know its volunteer - just send the relevant access info to my address and I'll get your pics for you. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 8:45 AM To: Access Developers discussion and problem solving Subject: [AccessD] How do I Grab the picture from the web page I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Fri Apr 22 08:31:15 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 08:31:15 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad From jwcolby at colbyconsulting.com Fri Apr 22 08:34:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 09:34:49 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4DB183F9.90006@colbyconsulting.com> Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading > all pdf and xls from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info > to my address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From rockysmolin at bchacc.com Fri Apr 22 08:44:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 06:44:36 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Fri Apr 22 08:48:18 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 22 Apr 2011 08:48:18 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4db18725.06c7640a.18cc.75b7@mx.google.com> Brad, I'm with you. Although after ten years working with Access, I still get confused between ADO and DAO. As a matter of preference, maybe because I don't understand the issues, I routinely use DAO anytime I need to create a TableDef or anything else that needs to connect to a database, etc. Maybe someone on this list can give us definitions of the two and give examples where one is better than the other. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 8:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 09:09:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 10:09:05 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <4db18725.06c7640a.18cc.75b7@mx.google.com> References: <4DB17842.4020604@colbyconsulting.com> <4db18725.06c7640a.18cc.75b7@mx.google.com> Message-ID: <4DB18C01.3000202@colbyconsulting.com> DAO is the object model for the the Access database object. DAO knows about things like *Microsoft ACCESS* databases, tables, fields, properties, queries, forms, reports and so forth. IOW *anything* that is an object in Access is manipulated using DAO. You can modify the tabledef object with DAO I believe. DAO knows nothing about *anything* other than objects inside of an Access database container. ADO is an object model for manipulating very specific objects related to *data* and will work with any data store which has an ADO provider - which includes SQL Server, Access, MySQL, etc. It knows about the command object, datasets, tables, columns, relationships and the like. It is possible to change a table with SQL. There are keywords for adding and dropping columns, the data type for the column, adding indexes and the like. You can execute SQL using the ADO command object. That is different from doing so directly with ADO. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:48 AM, jm.hwsn wrote: > Brad, > I'm with you. Although after ten years working with Access, I still get > confused between ADO and DAO. > As a matter of preference, maybe because I don't understand the issues, I > routinely use DAO anytime I need to create a TableDef or anything else that > needs to connect to a database, etc. > > Maybe someone on this list can give us definitions of the two and give > examples where one is better than the other. > > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 8:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > From michael at mattysconsulting.com Fri Apr 22 09:40:42 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 10:40:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> John, OK, I think the best way to approach this is for you to visit http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp It took me an hour or two to get the right elements for my project and then lots more to loop through the relevant tables, rows, childnodes, and cells to get the right info. Basically, you want the href of the image and then it's a simple binary save object to file, thus http://www.devx.com/vb2themax/Tip/18441 Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 9:35 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa ge=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading all pdf and xls > from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info to my > address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 09:42:48 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 09:42:48 -0500 Subject: [AccessD] Trouble using Split command Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> I am trying to use the split command on the following string " 0.000 243.729 - 61.495 -" I have a dim statements as follows Dim LineText As String Dim Test() As String The split statement is as follows Test = Split(LineText)(0) No matter how I dim Test() I get an error message of Run Time Error 13 Type Mismatch This seems like it should be real simple but I am obviously missing something. Thanks. Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From phpons at gmail.com Fri Apr 22 09:57:35 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 16:57:35 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Fri Apr 22 10:04:58 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 17:04:58 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:06:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:06:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C9C@houex1.kindermorgan.com> Still generates the same error of Type Mismatch -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 9:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Fri Apr 22 10:12:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:12:20 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:18:05 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:18:05 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From charlotte.foust at gmail.com Fri Apr 22 10:35:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:35:20 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Yes, it is possible to change a table (not a tabledef, please note) with ADO, but you have to use the ADOX library, and the process is different. ADOX is the library that lets you create and edit tables using ADO. The 2010 help files aren't very helpful when it comes to ADOX, I've noticed. However, the MSDN files are better. Take a look at http://support.microsoft.com/kb/291264/fr to see about manipulating tables and links in ADOX. Charlotte Foust On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks wrote: > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jackandpat.d at gmail.com Fri Apr 22 10:44:52 2011 From: jackandpat.d at gmail.com (jack drawbridge) Date: Fri, 22 Apr 2011 11:44:52 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Here's a link to some ADO examples and tips by Allen Browne. http://allenbrowne.com/func-adox.html Specific to Modify table is http://allenbrowne.com/func-adox.html#ModifyTableAdox On Fri, Apr 22, 2011 at 11:35 AM, Charlotte Foust wrote: > Yes, it is possible to change a table (not a tabledef, please note) > with ADO, but you have to use the ADOX library, and the process is > different. ADOX is the library that lets you create and edit tables > using ADO. The 2010 help files aren't very helpful when it comes to > ADOX, I've noticed. However, the MSDN files are better. Take a look > at http://support.microsoft.com/kb/291264/fr to see about manipulating > tables and links in ADOX. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks > wrote: > > All, > > > > We have an existing Access 2007 application that uses ADO. > > > > We now want to enhance this application to be able to change a TableDef > > with VBA code so that we can change the path to an Excel file on the > > fly. > > > > Is it possible to change TableDefs with ADO? > > > > I have seen many examples of how to change TableDefs with DAO, but I > > have not yet discovered an example of how to do this with ADO. > > > > I am fairly new to the world of Access and I am still trying to wrap my > > little brain around the "ADO vs DAO" debate. > > > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > > > Thanks, > > Brad > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:48:15 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:48:15 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. Correct me if I am wrong. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 10:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:50:18 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:50:18 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB7@houex1.kindermorgan.com> The (0) is to put the first element of the array into the variable Test -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:12 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:51:38 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:51:38 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB8@houex1.kindermorgan.com> The - is part of the string that is being read from a text file using a lineinput statement. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:18 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 10:53:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 11:53:08 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1A464.3090708@colbyconsulting.com> OK, thanks for that! John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:55:46 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:55:46 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Fri Apr 22 11:01:18 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 09:01:18 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: This is how I use it: 'Opening ARgs = "ReturnForm|ReturnField" Dim arrX As Variant If Nz(Me.OpenArgs, "") <> "" Then arrX = Split(Me.OpenArgs, "|") strReturnForm = arrX(0) strReturnField = arrX(1) End If On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the > first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a large > >> number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 11:08:53 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 11:08:53 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> I tried changing the dim statement to Dim Test as Variant I then did Test = Split(LineText) Test2=Test(0) Both variables test and test2 are empty I ran a LEN test on the variable LineText and got 98 I am puzzled. Thanks for everyone's help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:56 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From phpons at gmail.com Fri Apr 22 11:32:32 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 18:32:32 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Fri Apr 22 11:50:14 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 11:50:14 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From jedi at charm.net Fri Apr 22 12:25:08 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:25:08 -0400 (EDT) Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <2419.24.35.19.37.1303493108.squirrel@mail.expedient.net> John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or > obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page > to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn > how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first > string, but it would be good (for another project) to know how I insert > data into the controls and > click the search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table > collection etc. The web control is found by clicking the ellipsis in the > toolbox bar in form design > and going down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I > have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they > apparently did not program the web site in a "nice" manner, tables just > have one big long string > etc. the following is the code that I use to poke through the dozens of > tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading >> all pdf and xls from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info >> to my address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Fri Apr 22 12:33:43 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:33:43 -0400 (EDT) Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <2432.24.35.19.37.1303493623.squirrel@mail.expedient.net> Chester, if you are still having trouble consider using the debugger. Stop on the line Test = Split(LineText) and view the contents of LineText to make sure there is something there. If there is a valid string then view the properties of Split(LineText), there should be a bunch. You may need to place them in the Inspection window. Goodluck, Mike... > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: >> My understanding is that the result of the split statement is a one >> dimensional array. Thus the Dim test() as Variant >> The Test = Split(LineText)(0) statement is meant to put the contents of >> the first array element into the variable Test. >> Correct me if I am wrong. >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons >> Sent: Friday, April 22, 2011 10:05 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Trouble using Split command >> >> Better! >> >> Public Sub test() >> ? ?'I have a dim statements as follows >> ? ?Dim LineText As String >> ? ?Dim test As Variant ' no parenthesis for the name of the variable >> ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 >> 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" >> ? ?'The split statement should be as follows >> ? ?test = Split(LineText, "0") ' the split separator must be within the >> () >> of the split function >> End Sub >> Philippe >> 2011/4/22 philippe pons >> >>> Dim Test() As Variant >>> >>> Philippe >>> >>> 2011/4/22 Kaup, Chester >>> >>> I am trying to use the split command on the following string >>>> >>>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? >>>> - >>>> ? ? 61.495 ? ? ? ? ? ? ?-" >>>> >>>> I have a dim statements as follows >>>> Dim LineText As String >>>> Dim Test() As String >>>> >>>> The split statement is as follows >>>> Test = Split(LineText)(0) >>>> >>>> No matter how I dim Test() I get an error message of >>>> Run Time Error 13 >>>> Type Mismatch >>>> >>>> This seems like it should be real simple but I am obviously missing >>>> something. >>>> >>>> Thanks. >>>> >>>> >>>> >>>> >>>> Chester Kaup >>>> Engineering Technician >>>> Kinder Morgan CO2 Company, LLP >>>> Office (432) 688-3797 >>>> FAX (432) 688-3799 >>>> >>>> >>>> No trees were killed in the sending of this message. However a large >>>> number of electrons were terribly inconvenienced. >>>> >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >>> >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 12:43:28 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 13:43:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: Whoa. Well, you may be right ... however, I think one can actuate the link like this: Dim ITM as HTMLLINKELEMENT Set ITM = Doc.Links(ThatLink) ITM.Click The picture will then be visible. That may not be enough, though. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Bahr Sent: Friday, April 22, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchre > sults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter > data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they apparently did not program the web site in > a "nice" manner, tables just have one big long string etc. the > following is the code that I use to poke through the dozens of tables > they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 13:05:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 13:05:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Thanks for everyone's help and suggestions. I wanted to get out just the 5 data elements. Obviously I need a different plan. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 11:33 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 13:13:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 14:13:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1C556.70804@colbyconsulting.com> Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 13:55:36 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 14:55:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: John, Please elaborate on what is meant by early binding, since the control can be placed on a form and it shows all properties and methods in the Object Browser? Or did you mean late binding? Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 2:14 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project and > then lots more to loop through the relevant tables, rows, childnodes, > and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults& > listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I need to learn how it is done so I can > do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is > the code that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 14:00:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 12:00:19 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <8147EC9653BF4537B0067252FF8940A7@HAL9005> IIRC if you define all the DOA and ADO objects explicitly they'll play well together. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 9:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Apr 22 15:05:08 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 13:05:08 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > From rockysmolin at bchacc.com Fri Apr 22 16:40:00 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:40:00 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 16:41:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:41:22 -0700 Subject: [AccessD] Hide Form Title Bar References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <6864E3DD26DE4AB1A32DA74295F92233@HAL9005> Actually, I just noticed that there's a tiny sliver of bar at the top that lets you drag the form. Why do they DO THAT??!!! Rocky -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Friday, April 22, 2011 2:40 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , Message-ID: <4DB1FB8D.3278.2DF4AAA1@stuart.lexacorp.com.pg> No, even worse. I repeat - Variants are an abomination A comparison of your two examples shows why this is so. -- Stuart On 22 Apr 2011 at 17:04, philippe pons wrote: > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within > the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 > >> - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a > >> large number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, Message-ID: <4DB1FB8D.7908.2DF4AA15@stuart.lexacorp.com.pg> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" The Split() function returns a String array. So Dim Test() as Stinrg is correct. -- Stuart On 22 Apr 2011 at 16:57, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > > I am trying to use the split command on the following string > > > > " 0.000 243.729 > > - > > 61.495 -" > > > > I have a dim statements as follows > > Dim LineText As String > > Dim Test() As String > > > > The split statement is as follows > > Test = Split(LineText)(0) > > > > No matter how I dim Test() I get an error message of > > Run Time Error 13 > > Type Mismatch > > > > This seems like it should be real simple but I am obviously missing > > something. > > > > Thanks. > > > > > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:14:32 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:14:32 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <4DB1FDC8.23134.2DFD5E85@stuart.lexacorp.com.pg> Why didn't you say so :-) Dim LineText as string Dim Elements() as string DIm x as long LineText = " 0.000 243.729 - 61.495 - " 'Reduce multiple spaces to singles While instr(Linetext," ") > 0 LineText = Replace(LineText," "," ") Wend 'Get the data Elements() = Split(LineText," ") 'Do something with the data For x = 1 to UBound(Elements()) debug.print Elements(x) Next On 22 Apr 2011 at 13:05, Kaup, Chester wrote: > Thanks for everyone's help and suggestions. I wanted to get out just > the 5 data elements. Obviously I need a different plan. > From jwcolby at colbyconsulting.com Fri Apr 22 17:40:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 18:40:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB203E4.6000305@colbyconsulting.com> In order to pass the object to a class or method of a module any way other than "as object" you need to know what it is. IOW As textbox, as combobox etc. If you pass it "as object" then intellisense no longer works inside of the method or class. "As object" is late binding. In order te sink events in a class you have to ue early binding. Dim WithEvents XYZ as SomeObjType. John W. Colby www.ColbyConsulting.com On 4/22/2011 2:55 PM, Michael Mattys wrote: > John, > > Please elaborate on what is meant by early binding, > since the control can be placed on a form and it shows > all properties and methods in the Object Browser? > Or did you mean late binding? > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From charlotte.foust at gmail.com Fri Apr 22 17:48:27 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 15:48:27 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <8147EC9653BF4537B0067252FF8940A7@HAL9005> References: <4DB17842.4020604@colbyconsulting.com> <8147EC9653BF4537B0067252FF8940A7@HAL9005> Message-ID: You can use both, if you declare them specifically, but don't try to mix them because ADO calls don't work on a DAO object! Charlotte Foust On Fri, Apr 22, 2011 at 12:00 PM, Rocky Smolin wrote: > IIRC if you define all the DOA and ADO objects explicitly they'll play well > together. > > Rocky > > > -----Original Message----- > From: accOessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 9:50 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All - Thanks for the help/advice/insights ... Brad > > ~~~~~~~~~~~ > > Rocky, > > In the situation that I am dealing with, the Excel file is a "Linked Table". > > This works fine. > > Now we want to be able to change the Path to this Linked Table with VBA > code. > > I have this working using DAO, but I have some concern about using both DAO > and ADO in the same application. > > It appears that using both DAO and ADO is Okay, but I am not 100% sure. > > Thanks, > Brad > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin > Sent: Friday, April 22, 2011 8:45 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > What kind of change do you want to make? ?Wouldn't the path to the Excel > file be stored as data in a text field in the table? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 6:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef with > VBA code so that we can change the path to an Excel file on the fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I have > not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Fri Apr 22 19:42:41 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 22 Apr 2011 19:42:41 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Fri Apr 22 20:03:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 18:03:02 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <171D63778466419685EA3C5EE9C24CB0@HAL9005> On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 23 06:37:51 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 23 Apr 2011 13:37:51 +0200 Subject: [AccessD] Trouble using Split command Message-ID: Hi Stuart Let me guess: Stuart loves programming VBScript! /gustav >>> stuart at lexacorp.com.pg 23-04-2011 00:05:01 >>> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" From dhb at flsi.com Sat Apr 23 07:20:00 2011 From: dhb at flsi.com (Darrell Burns) Date: Sat, 23 Apr 2011 05:20:00 -0700 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases Message-ID: <032a01cc01b0$c4a1c630$4de55290$@com> Howdy. First-time on AccessD. I've tried all the other forums and can't get an answer to this one. I have a FE A2007 app linked to a BE A2007 database. There's a master form with 6 tabs. Each tab contains a subform that's bound to a query. Plus I open recordsets on the the BE tables to fetch stuff for the form. You can drill down from any subform to a detailed form by double-clicking a data field. I started getting the above error message after opening 2 or 3 of these forms, so I created a form handler method that shuts down the calling form and closes all the DB connections before opening the target form. I'm still getting that error. I've gone thru my code and diligently set all DBs to nothing at the end of each sub, but I can't seem to lick the problem. Suggestions from other forums have been to unbind the tables from the subforms. I buy that, but the question I can't get an answer to is how can I monitor how many connections I have open at one time so I can diagnose the problem? I feel like I'm debugging in the dark. Please turn on the light for me. Thanx, Darrell From jwcolby at colbyconsulting.com Sat Apr 23 08:13:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:13:11 -0400 Subject: [AccessD] Trouble using Split command In-Reply-To: References: Message-ID: <4DB2D067.20705@colbyconsulting.com> LOL. The reality is that variants are a specialized tool used for specific situations. There are things that you cannot accomplish without them but if you know what the data type you need is, you should use that type rather than a variant. John W. Colby www.ColbyConsulting.com On 4/23/2011 7:37 AM, Gustav Brock wrote: > Hi Stuart > > Let me guess: Stuart loves programming VBScript! > > /gustav > > >>>> stuart at lexacorp.com.pg 23-04-2011 00:05:01>>> > NO! > > Repeat after me, seven times... > > "Variants are an abomination. They are rarely required and must be used with caution" > > > From DWUTKA at Marlow.com Sat Apr 23 08:16:32 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 08:16:32 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <171D63778466419685EA3C5EE9C24CB0@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> <171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sat Apr 23 08:51:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:51:18 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB2D956.50309@colbyconsulting.com> Darrell, This is one of those misleading error messages. Every single open query or or table uses a "database". This means every combo box (uses a query to display the data), bound form, bound report, open recordset and so forth. The usual villain is a bound form with bound subforms with dozens of combo boxes open. I investigated this extensively a few years ago and what I discovered is that Access has some magic number which is the maximum number of recordsets available to the application. It seems that the number was somewhere around 1800. Every time you opened a query (combo, report, sub-report etc) the number available dropped. When you got low enough (and "low enough was not zero) you started getting this error. There is no fix, this is a "by design" limitation. You work around it by using JIT subforms and the like to minimize the number of objects using queries. BTW, you can discover for yourself what this number is fairly easily but there is no place (that I could discover) that you could go to see how many were left. The following code is not pretty but it does the job. In my case I am getting only 408 recordsets. I could swear the number was much higher. this is against linked SQL Server databases so maybe that has something to do with it. If we could get a bunch of people to run the code and report back their numbers that would help us to see better. Function rstOpen(db As DAO.Database, intTheLimit As Integer) As DAO.Recordset Dim rst As DAO.Recordset On Error Resume Next Set rst = db.OpenRecordset("SELECT * from tblLocation", dbOpenSnapshot, dbSeeChanges) If Err Then MsgBox intTheLimit & " is the max number of recordsets you can open" Else Set rstOpen = rst End If End Function Function TestTheLimit() Dim db As DAO.Database Dim col As Collection Dim intTheLimit As Integer Set db = CurrentDb Set col = New Collection On Error Resume Next While True intTheLimit = intTheLimit + 1 col.Add rstOpen(db, intTheLimit) Debug.Print intTheLimit DoEvents Wend End Function John W. Colby www.ColbyConsulting.com On 4/23/2011 8:20 AM, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master form > with 6 tabs. Each tab contains a subform that's bound to a query. Plus I > open recordsets on the the BE tables to fetch stuff for the form. You can > drill down from any subform to a detailed form by double-clicking a data > field. I started getting the above error message after opening 2 or 3 of > these forms, so I created a form handler method that shuts down the calling > form and closes all the DB connections before opening the target form. I'm > still getting that error. I've gone thru my code and diligently set all DBs > to nothing at the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how can I > monitor how many connections I have open at one time so I can diagnose the > problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > From accessd at shaw.ca Sat Apr 23 09:18:30 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 23 Apr 2011 07:18:30 -0700 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: Hi John: It is done via a process call screen-scraping and it can only be done using webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 11:14 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 09:25:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 07:25:26 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 23 10:10:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 11:10:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB2EBE4.7060009@colbyconsulting.com> > ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Uh... this kind of thing needs to be done many different places. It is rarely about "pick your tool to do this", rather "this app uses X tool, how do I do it there". This app uses Access / VBA. How do I do it there? Telling me to go off and rewrite my app in some other tool so that I can use that tool to do one tiny piece is... draconian. It turns out that there is an IE object which knows how to do most of this kind of thing, and can be automated from VBA. It is really a matter of studying that long enough to figure it out. John W. Colby www.ColbyConsulting.com On 4/23/2011 10:18 AM, Jim Lawrence wrote: > Hi John: > > It is done via a process call screen-scraping and it can only be done using > webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... > > ...and that is a whole different subject/environment/topic. ASP.Net would be > your best all around solution. > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 11:14 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Has anyone here ever figured out how to early bind the WebBrowser activeX > object? > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 10:40 AM, Michael Mattys wrote: >> John, >> >> OK, I think the best way to approach this is for you to visit >> http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp >> >> It took me an hour or two to get the right elements for my project >> and then lots more to loop through the relevant tables, rows, >> childnodes, and cells to get the right info. >> >> Basically, you want the href of the image and then it's a simple >> binary save object to file, thus >> >> http://www.devx.com/vb2themax/Tip/18441 >> >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, April 22, 2011 9:35 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] How do I Grab the picture from the web page >> >> Michael, >> >> Thanks. The web page I navigate to is as follows: >> >> > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 >> > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa >> ge=1 >> >> I literally replace the offenderID with the ID (called an OPUS number) of >> the inmate I am viewing or obtaining the record for. >> >> What you are viewing if you go to this link is an actual record of some >> inmate. Open this web page to view the html behind. >> >> Notice that the picture is obscured, with a "click to show photo" which I >> assume is actually a button? >> >> It is not that I need to get one or even several photos. I need the > *code* >> to do it from VBA, and I need to learn how it is done so I can do it again >> by myself. >> >> I would prefer to actually retrieve the photo to a file stored on disk, >> however I also want to learn how to click buttons (and enter data). >> >> The following is the actual search website. >> >> http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view >> >> I don't need it for this project because I can do a simple replace of the >> OPUS ID in that first string, but it would be good (for another project) > to >> know how I insert data into the controls and click the search button, how > to >> click the Clear Selection button etc. >> >> I currently use an ActiveX control inserted into a subform to retrieve >> pages, get the table collection etc. The web control is found by clicking >> the ellipsis in the toolbox bar in form design and going down until you >> find the Microsoft Web Browser control. >> >> I have found code in Google to do this other ways but this is the way I > have >> managed to get working. >> I wrote a class "wrapper" with methods that I call to parse out the > data. >> It is ugly but they apparently did not program the web site in a "nice" >> manner, tables just have one big long string etc. the following is the > code >> that I use to poke through the dozens of tables they use. >> >> Again, there might be an easier way but this is how I got it working. >> >> Function mSearchTable(wbbWebsite As Object) >> >> Dim varTables As Variant >> Dim varTable As Variant >> >> Dim strOffenderInfo As String >> Dim strMostRecent As String >> >> >> Set varTables = wbbWebsite.Document.All().tags("table") >> Set varTables = wbbWebsite.Document.All.tags("TABLE") >> For Each varTable In varTables >> >> Dim strInnerText As String >> strInnerText = varTable.innerText >> 'Use the innerText to see if this is the table we want. >> 'Debug.Print varTable.innerText >> >> If (InStr(strInnerText, "Offender Information")) And (Not >> mblnOffenderInfoFound) Then >> strOffenderInfo = strInnerText >> mParseInfoOffender strInnerText >> Else >> If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not >> mblnMostRecentInfoFound) Then >> strMostRecent = strInnerText >> mParseMostRecent strMostRecent >> End If >> >> End If >> Next varTable >> >> End Function >> >> So what I need is not a fish, but to learn *how* to fish. >> >> Any assistance gratefully accepted. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/22/2011 9:06 AM, Michael Mattys wrote: >>> Hi John, >>> >>> I've just finished a similar project for downloading all pdf and xls >>> from a site and the iron is still hot. >>> >>> I know its volunteer - just send the relevant access info to my >>> address and I'll get your pics for you. >>> >>> Michael R Mattys >>> Business Process Developers >>> www.mattysconsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From rockysmolin at bchacc.com Sat Apr 23 10:26:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 08:26:16 -0700 Subject: [AccessD] Autocorrect Dialog Box Message-ID: Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky From jwcolby at colbyconsulting.com Sat Apr 23 11:06:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 12:06:45 -0400 Subject: [AccessD] SQL Server times link as str Message-ID: <4DB2F915.1070407@colbyconsulting.com> I am linking to tables with date / time fields in SQL Server. The field in Access says it is a date. This appears to be causing all kinds of issues. I cannot see any way to intercept the link and tell the wizard that a specific field is a specific data type. Is there any way to fix this? -- John W. Colby www.ColbyConsulting.com From rockysmolin at bchacc.com Sat Apr 23 11:12:08 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:12:08 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: Message-ID: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 11:16:44 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:16:44 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> Message-ID: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Sat Apr 23 12:33:23 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 23 Apr 2011 10:33:23 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 12:57:11 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 10:57:11 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005><23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Bill: Not trying to set the autocorrect options but just trigger the dialog box so that the user can fiddle with it. Apparently, from what I've been able to find on the internets, it works in Excel - there's a constant for it in the Application.Dialogs object. But I can't find the equivalent for Access. Although, IME, anything you can do through the menus you can do through code. Since I can get that dialog box by clicking Tools-->AutoCorrectOptions in 2003 (there's a different sequence of course, in 2007) I'm thinking this has to be doable in code as well. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Patten Sent: Saturday, April 23, 2011 10:33 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 16:28:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:28:18 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB2F915.1070407@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com> Message-ID: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> What sort of issues? Is the SQL Server field a datetime or a smalldatetime? Using ODBC? What Client? AFAIK, Access doesn't have a "Date" field type, only a Date/Time -- Stuart On 23 Apr 2011 at 12:06, jwcolby wrote: > I am linking to tables with date / time fields in SQL Server. The > field in Access says it is a date. This appears to be causing all > kinds of issues. I cannot see any way to intercept the link and tell > the wizard that a specific field is a specific data type. Is there > any way to fix this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sat Apr 23 16:55:17 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:55:17 +1000 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <>, <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> >From everything that I have read, Access maintains TableIDs internally and the number currently used is not exposed in any way, so sadly it appears that the answer to your question is - You can't. -- Stuart On 23 Apr 2011 at 5:20, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master > form with 6 tabs. Each tab contains a subform that's bound to a query. > Plus I open recordsets on the the BE tables to fetch stuff for the > form. You can drill down from any subform to a detailed form by > double-clicking a data field. I started getting the above error > message after opening 2 or 3 of these forms, so I created a form > handler method that shuts down the calling form and closes all the DB > connections before opening the target form. I'm still getting that > error. I've gone thru my code and diligently set all DBs to nothing at > the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how > can I monitor how many connections I have open at one time so I can > diagnose the problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 17:16:51 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 18:16:51 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com> <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> Message-ID: <4DB34FD3.4050800@colbyconsulting.com> The SQL Server fields are time(0) and DateTime. It is picked up by Access as a string, IOW the field in design view of the linked table is a string. That probably happens because Access does not understand the miliseconds in the time, and AFAIK Access doesn't have a time field, only datetime. The issues are many but small, including weird displays of the values, necessity to convert to a date - cdate() - to do compares with other times (it converts to date just fine) and finally, I was trying to use the conditional display to color a date where it was <= date() + 180 (for example) and it just doesn't work, the colors do happen but there is no rhyme or reason to the colors. Things like that. So Access thinks it is a string, SQL Server thinks it is a date or time(0) and I am constantly fiddling with it to make it right. John W. Colby www.ColbyConsulting.com On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > What sort of issues? > > Is the SQL Server field a datetime or a smalldatetime? > Using ODBC? What Client? > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > From jimdettman at verizon.net Sat Apr 23 17:53:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 23 Apr 2011 18:53:33 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: 2048 is the table ID limit. While that sounds like a lot, every field reference carries a table I'd reference. Jim Sent from my iPhone On Apr 23, 2011, at 5:55 PM, "Stuart McLachlan" wrote: > From everything that I have read, Access maintains TableIDs internally and the number > currently used is not exposed in any way, so sadly it appears that the answer to your question > is - You can't. > > -- > Stuart > > On 23 Apr 2011 at 5:20, Darrell Burns wrote: > >> Howdy. First-time on AccessD. >> >> I've tried all the other forums and can't get an answer to this one. >> >> I have a FE A2007 app linked to a BE A2007 database. There's a master >> form with 6 tabs. Each tab contains a subform that's bound to a query. >> Plus I open recordsets on the the BE tables to fetch stuff for the >> form. You can drill down from any subform to a detailed form by >> double-clicking a data field. I started getting the above error >> message after opening 2 or 3 of these forms, so I created a form >> handler method that shuts down the calling form and closes all the DB >> connections before opening the target form. I'm still getting that >> error. I've gone thru my code and diligently set all DBs to nothing at >> the end of each sub, but I can't seem to lick the problem. >> >> >> >> Suggestions from other forums have been to unbind the tables from the >> subforms. I buy that, but the question I can't get an answer to is how >> can I monitor how many connections I have open at one time so I can >> diagnose the problem? I feel like I'm debugging in the dark. >> >> >> >> Please turn on the light for me. >> >> >> >> Thanx, >> >> Darrell >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 18:05:22 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 09:05:22 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34FD3.4050800@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> Message-ID: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not DateTime2 (also new in 2008)? Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to "down-level clients" as strings, rather than as the numerics which are used to store them, so you will have to parse then back to compatible Access datatypes yourself. See http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom patibilityforDownlevelClients "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data types added in SQL Server 2008. The following table shows the type mapping between an up-level instance of SQL Server 2008 and down-level clients." -- Stuart On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. That probably happens because Access does not understand > the miliseconds in the time, and AFAIK Access doesn't have a time > field, only datetime. > > The issues are many but small, including weird displays of the values, > necessity to convert to a date - cdate() - to do compares with other > times (it converts to date just fine) and finally, I was trying to use > the conditional display to color a date where it was <= date() + 180 > (for example) and it just doesn't work, the colors do happen but there > is no rhyme or reason to the colors. > > Things like that. > > So Access thinks it is a string, SQL Server thinks it is a date or > time(0) and I am constantly fiddling with it to make it right. > > John W. Colby > www.ColbyConsulting.com > > On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > > What sort of issues? > > > > Is the SQL Server field a datetime or a smalldatetime? > > Using ODBC? What Client? > > > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 18:11:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 19:11:42 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Message-ID: <4DB35CAE.20209@colbyconsulting.com> Thanks Stuart. I kinda figured I was screwed! ;) John W. Colby www.ColbyConsulting.com On 4/23/2011 7:05 PM, Stuart McLachlan wrote: > Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not > DateTime2 (also new in 2008)? > > Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to > "down-level clients" as strings, rather than as the numerics which are used to store them, so > you will have to parse then back to compatible Access datatypes yourself. > > See > http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom > patibilityforDownlevelClients > > "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data > types added in SQL Server 2008. The following table shows the type mapping between an > up-level instance of SQL Server 2008 and down-level clients." > From DWUTKA at Marlow.com Sat Apr 23 21:18:15 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 21:18:15 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Interesting. Not sure why 2007 would do anything different, but then again, it is 2007... LOL Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From gustav at cactus.dk Sun Apr 24 08:00:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2011 15:00:44 +0200 Subject: [AccessD] SQL Server times link as str Message-ID: Hi John What to do in such cases is to create a straight select query - an interface query - for this table only. Select all fields that come through all right; the remaining offending fields you convert or manipulate as needed. Your date field you could probably convert with CDate (or CVDate if zero length strings appear). Now use this query as source whenever your application have to pull data from the linked table. Of course, if you need to write to the linked table you will need another query to interface in the other direction. /gustav On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. .. From Chester_Kaup at kindermorgan.com Mon Apr 25 07:09:42 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 25 Apr 2011 07:09:42 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693D8D@houex1.kindermorgan.com> Thanks for the piece of code. I am going to keep it. The data is delimitated by a variable number of spaces. What I ended up doing was reading through the line and replacing double spaces with single spaces until there were no more double spaces. The split commend then worked. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Friday, April 22, 2011 3:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dhb at flsi.com Mon Apr 25 12:18:11 2011 From: dhb at flsi.com (Darrell Burns) Date: Mon, 25 Apr 2011 10:18:11 -0700 Subject: [AccessD] Tab control click event In-Reply-To: References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: <038701cc036c$c1856d40$449047c0$@com> Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB From rockysmolin at bchacc.com Mon Apr 25 12:58:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 10:58:36 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <><032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <40DAFC36A8754DC0B84338A405880D3A@HAL9005> Are you doing refresh or requery? If the refresh is because of a change on the previous page, can you refresh the data in the after update event of the control on the previous page that causes a change in the other pages? Then when the tab is clicked the data will already be refreshed. Or would that cause too much delay? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 13:00:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 11:00:49 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box Message-ID: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From andy at minstersystems.co.uk Mon Apr 25 14:06:32 2011 From: andy at minstersystems.co.uk (Andy Lacey) Date: Mon, 25 Apr 2011 20:06:32 +0100 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> Message-ID: <49C5A426F1974C2EAFCE2421DC6CF9B1@MINSTER> Hi Darrell Wouldn't just an Echo False and an Echo True around the Requery do it for you? Andy -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: 25 April 2011 18:18 To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Mon Apr 25 15:53:30 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 25 Apr 2011 13:53:30 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <000c01cc038a$e12db120$a3891360$@cox.net> Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 16:42:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 14:42:22 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <000c01cc038a$e12db120$a3891360$@cox.net> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> <000c01cc038a$e12db120$a3891360$@cox.net> Message-ID: <88183A49169647A0A40576475839C469@HAL9005> Come to think of it Doug, I did something like that on a tab form where I disappeared the tab and replaced it with a label, which looks nicer, you can format it, and has a Click event where you can do whatever and then set the focus to that page: Me.TabCtl140.Pages(1).SetFocus HTH Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 25, 2011 1:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Tab control click event Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Tue Apr 26 01:49:49 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 26 Apr 2011 16:49:49 +1000 Subject: [AccessD] Karen's Powertools Message-ID: <201104260653.p3Q6rCr3016190@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am sure a few of you have heard of or even user Karen's solutions. Got this today and maybe of interest for some of you. Very Sad '======== copied email follows =================== Dear Friends, I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. I know that Karen touched many of you with her kindness, wit, creativity and encouragement. She was a loving daughter, sister, aunt and friend. And she was a pretty darned good programmer, too. We are deeply grieving her loss. For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. We are also working to fill all CD orders that have been submitted or mailed. It is difficult to make business decisions while grieving. So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. Many of you have already written many kinds words of condolence and comfort. Please know that we greatly appreciate you. If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. You can learn more about them at www.DohnavurFellowship.org. All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. May God richly bless you, as He has all those who knew Karen. Bill Kenworthy Karen?s brother '============ end of copy ========= Regards Darryl _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From jwcolby at colbyconsulting.com Tue Apr 26 07:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 08:46:37 -0400 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: <4DB6BEAD.1000507@colbyconsulting.com> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Apr 26 08:08:45 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 26 Apr 2011 17:08:45 +0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Hi John -- Just importing everything into a new DB - wouldn't that be a solution to workaround the "bugger"? Is it MDE? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 26 ?????? 2011 ?. 16:47 To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Tue Apr 26 08:09:19 2011 From: garykjos at gmail.com (Gary Kjos) Date: Tue, 26 Apr 2011 08:09:19 -0500 Subject: [AccessD] Karen's Powertools In-Reply-To: <201104260653.p3Q6rCr3016190@databaseadvisors.com> References: <201104260653.p3Q6rCr3016190@databaseadvisors.com> Message-ID: Thanks for passing this sad news along Darryl. I have used some of Karen's tools over the years. GK On Tue, Apr 26, 2011 at 1:49 AM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > I am sure a few of you have heard of or even user Karen's solutions. ?Got this today and maybe of interest for some of you. ?Very Sad > > '======== copied email follows =================== > > Dear Friends, > > I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. ?It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. > > I know that Karen touched many of you with her kindness, wit, creativity and encouragement. ?She was a loving daughter, sister, aunt and friend. ?And she was a pretty darned good programmer, too. ?We are deeply grieving her loss. > > For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. ?We are also working to fill all CD orders that have been submitted or mailed. ?It is difficult to make business decisions while grieving. ?So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. > > Many of you have already written many kinds words of condolence and comfort. ?Please know that we greatly appreciate you. ?If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. ?You can learn more about them at www.DohnavurFellowship.org. > > All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. > > May God richly bless you, as He has all those who knew Karen. > > Bill Kenworthy > Karen?s brother > > '============ end of copy ========= > > Regards > Darryl > _______________________________________________________________________________________ > > The information transmitted in this message and its attachments (if any) is intended > only for the person or entity to which it is addressed. > The message may contain confidential and/or privileged material. Any review, > retransmission, dissemination or other use of, or taking of any action in reliance > upon this information, by persons or entities other than the intended recipient is > prohibited. > > If you have received this in error, please contact the sender and delete this e-mail > and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, disclose or distribute > the information contained in this e-mail and any attached files, with the permission > of the sender. > > This message has been scanned for viruses. > _______________________________________________________________________________________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From rockysmolin at bchacc.com Tue Apr 26 08:24:53 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 06:24:53 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <1D0DAC4651364E11BC5253FF51FB991E@HAL9005> Data in temp tables? Otherwise although a PITA, binary search. Import half the objects, see what the size is after C/R. Import half the remaining, etc. Eventually, you'll find the culprit. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 5:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Tue Apr 26 08:28:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 26 Apr 2011 09:28:33 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Create a new DB and import everything in. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 08:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 26 08:49:32 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 26 Apr 2011 08:49:32 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? From jwcolby at colbyconsulting.com Tue Apr 26 09:05:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:05:07 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <4DB6D113.3020906@colbyconsulting.com> Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution to > workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Tue Apr 26 09:14:49 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 26 Apr 2011 09:14:49 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6D113.3020906@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> What about a decompile then compact/repair? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution > to workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From dbdoug at gmail.com Tue Apr 26 09:17:25 2011 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 26 Apr 2011 07:17:25 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Any embedded graphics? Doug On Tue, Apr 26, 2011 at 7:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 26 09:29:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:29:47 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4DB6D6DB.4090509@colbyconsulting.com> I tried all of that, no help. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From Gustav at cactus.dk Tue Apr 26 09:38:55 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 26 Apr 2011 16:38:55 +0200 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: Hi John Then I guess you are left with the save-as-text and load-from-text method on all objects. /gustav >>> jwcolby at colbyconsulting.com 26-04-2011 16:29 >>> I tried all of that, no help. From john at winhaven.net Tue Apr 26 09:41:55 2011 From: john at winhaven.net (John Bartow) Date: Tue, 26 Apr 2011 09:41:55 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Even jpegs seem to increase the size far too much if one would accidently or otherwise paste a exe, dll, wmv or something into a form I'd imagine it would get huge. Check the forms and reports over and remove any ole objects or embedded images. Then decompile, compact, compile, compact. If that accomplishes nothing then I'd import it into a new db. Best of luck, John B BTW have you tried running Eatbloat on it? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 7:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 11:07:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 12:07:39 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> Message-ID: <4DB6EDCB.1090202@colbyconsulting.com> >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in one > of the forms or report. Even jpegs seem to increase the size far too much if > one would accidently or otherwise paste a exe, dll, wmv or something into a > form I'd imagine it would get huge. Check the forms and reports over and > remove any ole objects or embedded images. Then decompile, compact, compile, > compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Tue Apr 26 11:47:20 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 12:47:20 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Tue Apr 26 12:53:46 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 26 Apr 2011 12:53:46 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6EDCB.1090202@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> Message-ID: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> John, I made and have been testing an essentially one-click access utility which will do export to text and import from text of all the objects except tables. Do you want to try it? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 11:08 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. Even jpegs seem to increase the size far > too much if one would accidently or otherwise paste a exe, dll, wmv or > something into a form I'd imagine it would get huge. Check the forms > and reports over and remove any ole objects or embedded images. Then > decompile, compact, compile, compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 13:01:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 11:01:16 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Tue Apr 26 13:05:06 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 14:05:06 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 15:41:30 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 13:41:30 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: beautiful -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 11:05 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 21:59:24 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 22:59:24 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> Message-ID: <4DB7868C.4080705@colbyconsulting.com> sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility which > will do export to text and import from text of all the objects except > tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever in >> one of the forms or report. Even jpegs seem to increase the size far >> too much if one would accidently or otherwise paste a exe, dll, wmv or >> something into a form I'd imagine it would get huge. Check the forms >> and reports over and remove any ole objects or embedded images. Then >> decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jengross at gte.net Wed Apr 27 17:40:29 2011 From: jengross at gte.net (Jennifer Gross) Date: Wed, 27 Apr 2011 15:40:29 -0700 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <007b01cc052c$1d002370$1201a8c0@Schroeder> Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title? .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Apr 28 00:38:39 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 28 Apr 2011 09:38:39 +0400 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: Hi Chester -- Your code works here well - MS Access/Office 2003. What code line does report Error 430 on your system? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: 26 ?????? 2011 ?. 17:50 To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 07:20:41 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 07:20:41 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <007b01cc052c$1d002370$1201a8c0@Schroeder> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <007b01cc052c$1d002370$1201a8c0@Schroeder> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20412@houex1.kindermorgan.com> Thanks for the code example. I am going to keep it. Turns out the problem was I had to reregister DAO 3.6 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jennifer Gross Sent: Wednesday, April 27, 2011 5:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Copy recordset to excel spreadsheet Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title" .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 28 10:18:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 28 Apr 2011 08:18:01 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: having a "ODBC - Call failed" message from A97 when running the code below. RTE is a long var. code generates no errors up to the last line. I can link to tables using the log on info and password successfully. any ideas?? 'populate the object variables Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, CONNECT_STR) conTest.QueryTimeout = 0 'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE From davidmcafee at gmail.com Thu Apr 28 11:04:07 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 28 Apr 2011 09:04:07 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) > DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jm.hwsn at gmail.com Thu Apr 28 12:00:04 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 12:00:04 -0500 Subject: [AccessD] Field Level AES Encryption Message-ID: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim From Lambert.Heenan at chartisinsurance.com Thu Apr 28 12:35:53 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 13:35:53 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Thu Apr 28 13:19:11 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 13:19:11 -0500 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Thu Apr 28 13:55:59 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 14:55:59 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Message-ID: Well that's different then. :-) Access 2007 huh? Still plodding along with A2003 here. No security at all really. :-) Thanks again for the information. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 2:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Field Level AES Encryption Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 14:38:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 14:38:26 -0500 Subject: [AccessD] Acrobat question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20572@houex1.kindermorgan.com> Will this code work with Acrobat reader or is a full version necessary? Dim AcroXApp As Object Dim AcroXAVDoc As Object Dim AcroXPDDoc As Object Set AcroXApp = CreateObject("AcroExch.App") AcroXApp.Hide Set AcroXAVDoc = CreateObject("AcroExch.AVDoc") AcroXAVDoc.Open PDF_PATH & filename, "Acrobat" AcroXAVDoc.BringToFront Set AcroXPDDoc = AcroXAVDoc.GetPDDoc Dim jsObj As Object Set jsObj = AcroXPDDoc.GetJSObject jsObj.SaveAs OUTPUT_PATH & OutputFile, "com.adobe.acrobat.plain-text" AcroXAVDoc.Close False AcroXApp.Hide AcroXApp.Exit Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From newsgrps at dalyn.co.nz Thu Apr 28 15:09:14 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 29 Apr 2011 08:09:14 +1200 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) >DoEvents >conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 28 15:10:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Apr 2011 16:10:20 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4DB9C9AC.9060400@colbyconsulting.com> Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > From ab-mi at post3.tele.dk Thu Apr 28 16:21:16 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Thu, 28 Apr 2011 23:21:16 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DB9C9AC.9060400@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: How do you create the hash - any generator to recommend? Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 28. april 2011 22:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:00:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:00:07 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBAD277.8080507@colbyconsulting.com> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 ' Can be used freely even for commercial applications ' ' MS Access 97 version by ' Gustav Brock, Cactus Data ApS ' gustav at cactus.dk ' ' 2002-03-09. V1.0 ' Initial port from Visual Basic. ' 2002-06-23. V1.1 ' Code clean up and constants added. ' Redundant code removed. ' Modified to fully comply with VB datatypes. ' Modified to not crash for certain passwords. ' Modified for high speed conversion of long strings ( > 32K). ' 2002-06-24. V1.2 ' Functions added for en/decrypting to/from binary strings. ' Usage: ' SetPassword(password) sets password prior to en/decryption. ' GetPassword() retrieves current password. ' StrEncrypt(DecryptedString) returns encrypted ascii string. ' StrDecrypt(EncryptedString_ascii) returns decrypted string. ' StrEncryptBin(DecryptedString) returns encrypted binary string. ' StrDecryptBin(EncryptedString_binary) returns decrypted string. ' ' Encrypted ascii string is twice the length of the decrypted string. ' Encrypted ascii string contains low ascii chars from a to p only. ' Encrypted binary string is same length as the decrypted string. ' Encrypted binary string may contain any char including Chr(0). ' Password may contain any ascii char including Chr(0). ' Password is maintained in global variable strPC1Password16. Private Const clngHexMax As Long = &H10 Private Const clngBytMax As Long = &H100 ' Maximum value of unsigned Integer. Private Const clngIntMax As Long = &H10000 ' clngAscMin defines beginning of a 16 letter range from a to p. Private Const clngAscMin As Long = &H61 Private strPC1Password16 As String * clngHexMax Private x1a0(9) As Long Private cle(17) As Long Private x1a2 As Long Private lngInt As Long Private lngRes As Long Private lngTmp As Long Private ax As Long Private bx As Long Private cx As Long Private dx As Long Private si As Long Private i As Long Private c As Long Private d As Long Private e As Long Private strEncrypted As String Private strDecrypted As String Public Function SetPassword(ByRef strPassword As String) As Integer Dim intPasswordLength As Integer ' Remove leading and trailing spaces from password. strPassword = Trim(strPassword) ' Set global variable and limit password to fixed length of 16 characters. strPC1Password16 = strPassword ' Find and return net length of password. intPasswordLength = Len(strPassword) SetPassword = intPasswordLength End Function Public Function GetPassword() As String ' Get global variable strPC1Password16. GetPassword = RTrim(strPC1Password16) End Function Public Function StrEncrypt(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(False) StrEncrypt = strEncrypted End Function Public Function StrDecrypt(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(False) StrDecrypt = strDecrypted End Function Public Function StrEncryptBin(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(True) StrEncryptBin = strEncrypted End Function Public Function StrDecryptBin(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(True) StrDecryptBin = strDecrypted End Function Private Sub Encrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strDecrypted lngX = Len(strX) strEncrypted = Space(lngX * (2 - Abs(booBinary))) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX c = Asc(mID(strX, lngN, 1)) ' Calculate lngInt. Call Assemble lngC = lngInt \ clngBytMax lngD = lngInt Mod clngBytMax For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM c = c Xor (lngC Xor lngD) If booBinary = False Then ' Build ascii string. d = (c \ clngHexMax) Mod clngHexMax e = c Mod clngHexMax ' clngAscMin + d gives one letter range from a to p for the 4 high bits of c. ' clngAscMin + e gives one letter range from a to p for the 4 low bits of c. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, (lngN * 2) - 1, 1) = Chr(clngAscMin + d) Mid(strEncrypted, (lngN * 2) - 0, 1) = Chr(clngAscMin + e) Else ' Build binary string. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, lngN, 1) = Chr(c) End If Next lngN End Sub Private Sub Decrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strEncrypted lngX = Len(strX) \ (2 - Abs(booBinary)) strDecrypted = Space(lngX) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX If booBinary = False Then d = Asc(mID(strX, (lngN * 2) - 1, 1)) If d >= clngAscMin Then ' Transform the letter to the 4 high bits of c. d = d - clngAscMin If d < clngHexMax Then d = d * clngHexMax End If End If e = Asc(mID(strX, (lngN * 2) - 0, 1)) If e >= clngAscMin Then ' Transform the letter to the 4 low bits of c. e = e - clngAscMin If e < clngHexMax Then c = d + e End If End If Else c = Asc(mID(strX, lngN, 1)) End If ' Calculate lngInt. Call Assemble lngC = (lngInt \ clngBytMax) Mod clngBytMax lngD = lngInt Mod clngBytMax c = c Xor (lngC Xor lngD) For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM ' Perform high speed insertion of decrypted character. Mid(strDecrypted, lngN, 1) = Chr(c) Next lngN End Sub Private Sub Assemble() Dim lngM As Long Dim lngN As Long x1a0(0) = ((cle(1) * clngBytMax) + cle(2)) Mod clngIntMax Call Code lngInt = lngRes For lngM = 1 To (clngHexMax / 2) - 1 lngN = lngM * 2 x1a0(lngM) = x1a0(lngM - 1) Xor ((cle(lngN + 1) * clngBytMax) + cle(lngN + 2)) Call Code lngInt = lngInt Xor lngRes Next lngM i = 0 End Sub Private Sub Code() Const clngKeyB As Long = &H4E35 Const clngKeyC As Long = &H15A dx = (x1a2 + i) Mod clngIntMax ax = x1a0(i) cx = clngKeyC bx = clngKeyB lngTmp = ax ax = si si = lngTmp lngTmp = ax ax = dx dx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax End If lngTmp = ax ax = cx cx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (si Mod clngIntMax)) Mod clngIntMax cx = (ax + cx) Mod clngIntMax End If lngTmp = ax ax = si si = lngTmp ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax dx = (cx + dx) Mod clngIntMax ax = ax + 1 x1a2 = dx x1a0(i) = ax lngRes = ax Xor dx i = i + 1 End Sub John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger From Gustav at cactus.dk Fri Apr 29 10:07:53 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:07:53 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 From jm.hwsn at gmail.com Fri Apr 29 10:14:26 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 10:14:26 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Which is the similar to using the strConv function in Access to store the data in Unicode. It's unreadable but not really secure. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2011 10:08 AM To: accessd at databaseadvisors.com Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:30:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:30:05 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> References: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Message-ID: <4DBAD97D.3030905@colbyconsulting.com> Well... I am thinking it is waaaaay more secure than that. John W. Colby www.ColbyConsulting.com On 4/29/2011 11:14 AM, jm.hwsn wrote: > Which is the similar to using the strConv function in Access to store the > data in Unicode. > It's unreadable but not really secure. > Thanks, > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2011 10:08 AM > To: accessd at databaseadvisors.com > Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit > ordering on the key (and remove the parity bits) before starting the first > round of the non-invertible s-boxes. These are also left-rotated between > each round (by 1 or 2 bits, in a non-regular pattern) to form what is > commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a > code Alexander Pukall designed himself - and which is widely regarded as > insecure. Pukall shouldn't really have chosen the same name as the DES key > schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text > non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From jwcolby at colbyconsulting.com Fri Apr 29 10:36:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:36:16 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBADAF0.7060304@colbyconsulting.com> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From Gustav at cactus.dk Fri Apr 29 10:46:08 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:46:08 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi John Yes, here: http://www.frez.co.uk/vb6.aspx /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:36 >>> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 From jwcolby at colbyconsulting.com Fri Apr 29 11:41:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 12:41:59 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBAEA57.60602@colbyconsulting.com> Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From jm.hwsn at gmail.com Fri Apr 29 11:48:27 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 11:48:27 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4DBAEA57.60602@colbyconsulting.com> References: <4DBAEA57.60602@colbyconsulting.com> Message-ID: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 29 11:53:28 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 18:53:28 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi Jim Sorry, missed that, I have followed this thread with half an eye only. Anyway, the circle is closed! /gustav >>> jm.hwsn at gmail.com 29-04-2011 18:48 >>> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From df.waters at comcast.net Fri Apr 29 11:57:50 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 29 Apr 2011 11:57:50 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB7868C.4080705@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> Message-ID: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> John - how did it go? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility > which will do export to text and import from text of all the objects > except tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or > whatever in one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever >> in one of the forms or report. Even jpegs seem to increase the size >> far too much if one would accidently or otherwise paste a exe, dll, >> wmv or something into a form I'd imagine it would get huge. Check the >> forms and reports over and remove any ole objects or embedded images. >> Then decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >> 1 report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 12:16:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:16:47 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> References: <4DBAEA57.60602@colbyconsulting.com> <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> Message-ID: <4DBAF27F.9030303@colbyconsulting.com> LOL, I wasn't following this thread closely. In fact I only spoke up to recommend the hash method. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:48 PM, jm.hwsn wrote: > That's the site I emailed earlier. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 29, 2011 11:42 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Wow is that awesome! > > Thanks! > > John W. Colby > www.ColbyConsulting.com > > On 4/29/2011 11:46 AM, Gustav Brock wrote: >> Hi John >> >> Yes, here: >> >> http://www.frez.co.uk/vb6.aspx >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> >> Thanks for the heads up on that. Have you by any chance found an > opensource for this that is considered secure? >> >> John W. Colby >> www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 29 12:17:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:17:53 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> Message-ID: <4DBAF2C1.5020007@colbyconsulting.com> Well... I haven't managed to address this yet. The last few days were pure overload. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:57 PM, Dan Waters wrote: > John - how did it go? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > sure. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 1:53 PM, Dan Waters wrote: >> John, >> >> I made and have been testing an essentially one-click access utility >> which will do export to text and import from text of all the objects >> except tables. Do you want to try it? >> >> Dan >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 11:08 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Access 2003 - 50 meg FE >> >> >>> First thing that comes to mind is an ole object - image or >> whatever in one of the forms or report. >> >> Hmm... I do have an activeX control for the IE object. >> >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/26/2011 10:41 AM, John Bartow wrote: >>> First thing that comes to mind is an ole object - image or whatever >>> in one of the forms or report. Even jpegs seem to increase the size >>> far too much if one would accidently or otherwise paste a exe, dll, >>> wmv or something into a form I'd imagine it would get huge. Check the >>> forms and reports over and remove any ole objects or embedded images. >>> Then decompile, compact, compile, compact. >>> >>> If that accomplishes nothing then I'd import it into a new db. >>> >>> Best of luck, >>> John B >>> >>> BTW have you tried running Eatbloat on it? >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Tuesday, April 26, 2011 7:47 AM >>> To: Access Developers discussion and problem solving >>> Subject: [AccessD] Access 2003 - 50 meg FE >>> >>> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >>> 1 report, a handful of classes and modules. >>> >>> The bugger is 50 megs and won't shrink down when I compact / repair. >>> It should probably be a couple of megs. >>> >>> Has anyone run across anything I should be looking at? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Apr 30 09:40:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 30 Apr 2011 10:40:18 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBC1F52.3070807@colbyconsulting.com> I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com From ab-mi at post3.tele.dk Sat Apr 30 12:37:44 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Sat, 30 Apr 2011 19:37:44 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DBC1F52.3070807@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> <4DBC1F52.3070807@colbyconsulting.com> Message-ID: <670A825F36374733BC58BE25C5DFA4F3@abpc> Thanks for the explanation, John. Could you perhaps send me your hash generator offline - I would appreciate much. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 30. april 2011 16:40 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:03:53 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:03:53 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <9FE47E35DFB047C28D1FD535A4A2FE1B@Seven> thx for responding. I could not get that code to work. been a long time since A97 anyone else? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 28, 2011 9:04 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A97 SQL Server It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, > True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:04:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:04:39 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <356F885A526D46519BE17F64C1E07317@Seven> thanks, but no, that did not help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 28, 2011 1:09 PM To: Access Developers discussion and problem solving; 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A97 SQL Server Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, >True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute >"EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 00:00:18 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 31 Mar 2011 22:00:18 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <201103312301.p2VN0u1M028069@databaseadvisors.com> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> Message-ID: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Our clock numbering system was invented by the ancient Symmerians, 3000+ years ago, so why should we change now? It is simple as everything is calculated on 12s and 60s... |-P Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter I remember when New Zealand went metric with its currency back in the '70s. A friend was going overseas and was told by another friend that we were changing over to metric time next and was asked if could he bring back a metric watch. -- Stuart On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > Metric dates...hmm... 10 days per week, then? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > > ______________________________________________________________________ > ______ ___________ > > Note: This e-mail is subject to the disclaimer contained at the bottom > of this message. > ______________________________________________________________________ > ______ ___________ > > > > Hi Rocky, > > To avoid these sort of issues I use dateserial on each and every date > I process in SQL / VBA to make sure they line up correctly. Also from > memory the VBE treats all dates passed in VBA as American format as > default, regardless of the PC's regional setting. Coming from the land > of "dd-mm-yyyy" as standard it is an issue I need to deal with a lot. > > Now, if only you pesky Americans got with the program, used a proper > date format and just swallowed your pride and admit the French were > right and adopt the (far superior) metric system it would make life > for the rest of the planet much easier. ;) > > cheers > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > discussion and problem solving' Subject: Re: [AccessD] Un-American > Date Filter > > Doug: > > When I change the code to > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > And > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > the sql statement still comes out: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate > >= #31/03/2011# AND DueDate <= #07/04/2011# > > And still no date filtering. > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > Hi Rocky: > > I've dealt with this in the past by forcing the date format to > mm/dd/yy in the SQL, something like: > > WHERE DueDate >= Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > Doug > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > wrote: > Dear List: > > I create a temp table > using a SQL statement I construct in code to > incorporate various > filter - one of which is a date filter. > > Works well here but when I > send it to the user in Bahrain who's > regional setting is (I assume > from the screen shot he sent) English > U.K. where the date format is > dd/mm/yyyy it fails. ?I set my regional > settings on my box to U.K. > and sure enough it fails - returns all > records with no date > filtering. > > Here's the SQL statement that creates the table: > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue > ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand ?WHERE DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed to > filter out any record in tblDemand where the Due > Date is outside of > the range March 31 to April 7. ?But it don't. > > When I look in > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > doesn't this work? ?Should I be using some kind of different > syntax > for this filter? > > MTIA > > > Rocky Smolin > > Beach Access Software > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > www.bchacc.com > > > > > > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ______________________________________________________________________ > ______ ___________ > > The information transmitted in this message and its attachments (if > any) is intended only for the person or entity to which it is > addressed. The message may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, > or taking of any action in reliance upon this information, by persons > or entities other than the intended recipient is prohibited. > > If you have received this in error, please contact the sender and > delete this e-mail and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, > disclose or distribute the information contained in this e-mail and > any attached files, with the permission of the sender. > > This message has been scanned for viruses. > ______________________________________________________________________ > ______ ___________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Fri Apr 1 00:10:28 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Fri, 1 Apr 2011 18:10:28 +1300 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: <759994F1FF5140A1B7081212566A9630@HAL9005><201103312301.p2VN0u1M028069@databaseadvisors.com> Message-ID: Rocky, I always convert dates in code to Long. That way it always works regardless of the locale. I find it simpler like that. ... WHERE DueDate >= " & CLng(Me.txtGEDueDate) & " AND DueDate <= " & CLng(Me.txtLEDueDate) Or preferably... ... WHERE DueDate Between " & CLng(Me.txtGEDueDate) & " And " & CLng(Me.txtLEDueDate) Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, April 01, 2011 12:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Un-American Date Filter When I change the code to "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" And "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" the sql statement still comes out: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# And still no date filtering. From stuart at lexacorp.com.pg Fri Apr 1 00:30:47 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:30:47 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, , <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> Message-ID: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > From stuart at lexacorp.com.pg Fri Apr 1 00:36:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:36:51 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg>, <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Message-ID: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Simple - if you have six digits on each hand. or even better five limbs in total with 12 fingers/toes on each. :-) -- Stuart On 31 Mar 2011 at 22:00, Jim Lawrence wrote: > Our clock numbering system was invented by the ancient Symmerians, > 3000+ years ago, so why should we change now? It is simple as > everything is calculated on 12s and 60s... |-P > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > I remember when New Zealand went metric with its currency back in the > '70s. > > A friend was going overseas and was told by another friend that we > were changing over to metric time next and was asked if could he bring > back a metric watch. > > -- > Stuart > > > On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > > > Metric dates...hmm... 10 days per week, then? > > > > Rocky > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > > > ____________________________________________________________________ > > __ ______ ___________ > > > > Note: This e-mail is subject to the disclaimer contained at the > > bottom of this message. > > ____________________________________________________________________ > > __ ______ ___________ > > > > > > > > Hi Rocky, > > > > To avoid these sort of issues I use dateserial on each and every > > date I process in SQL / VBA to make sure they line up correctly. > > Also from memory the VBE treats all dates passed in VBA as American > > format as default, regardless of the PC's regional setting. Coming > > from the land of "dd-mm-yyyy" as standard it is an issue I need to > > deal with a lot. > > > > Now, if only you pesky Americans got with the program, used a proper > > date format and just swallowed your pride and admit the French were > > right and adopt the (far superior) metric system it would make life > > for the rest of the planet much easier. ;) > > > > cheers > > Darryl. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > > discussion and problem solving' Subject: Re: [AccessD] Un-American > > Date Filter > > > > Doug: > > > > When I change the code to > > > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > > > And > > > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > > > the sql statement still comes out: > > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE > > DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > > > And still no date filtering. > > > > R > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug > > Steele Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > Hi Rocky: > > > > I've dealt with this in the past by forcing the date format to > > mm/dd/yy in the SQL, something like: > > > > WHERE DueDate >= > > Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > > > Doug > > > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > > wrote: > Dear List: > > I create a temp > > table using a SQL statement I construct in code to > incorporate > > various filter - one of which is a date filter. > > Works well here > > but when I send it to the user in Bahrain who's > regional setting > > is (I assume from the screen shot he sent) English > U.K. where the > > date format is dd/mm/yyyy it fails. ?I set my regional > settings on > > my box to U.K. and sure enough it fails - returns all > records with > > no date filtering. > > Here's the SQL statement that creates the > > table: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, > > DueDate, > QuantityDue > ) SELECT tblDemand.PartNumber, > > tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue > > FROM tblDemand ?WHERE DueDate > > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed > > > >to > > filter out any record in tblDemand where the Due > Date is outside > > of the range March 31 to April 7. ?But it don't. > > When I look in > > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > > doesn't this work? ?Should I be using some kind of different > > > syntax for this filter? > > MTIA > > > Rocky Smolin > > Beach Access > > Software > > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > > www.bchacc.com > > > > > > > > > > > > -- > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > > http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > ____________________________________________________________________ > > __ ______ ___________ > > > > The information transmitted in this message and its attachments (if > > any) is intended only for the person or entity to which it is > > addressed. The message may contain confidential and/or privileged > > material. Any review, retransmission, dissemination or other use of, > > or taking of any action in reliance upon this information, by > > persons or entities other than the intended recipient is prohibited. > > > > If you have received this in error, please contact the sender and > > delete this e-mail and associated material from any computer. > > > > The intended recipient of this e-mail may only use, reproduce, > > disclose or distribute the information contained in this e-mail and > > any attached files, with the permission of the sender. > > > > This message has been scanned for viruses. > > ____________________________________________________________________ > > __ ______ ___________ > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:38:39 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:38:39 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: Yes, you bet. In Canada, April Fool's day rules!! Doug On Thu, Mar 31, 2011 at 10:30 PM, Stuart McLachlan wrote: > dd Mmm yyyy .... in sequential order. ?(?) > > You mean "01 Apr 2011" ?comes before "01 Jan 2011" ?in your calendar? > > -- > Stuart > > On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > >> Actually, our government (federal and provincial) uses yyyymmdd which >> sorts as a string, a number or as a date without any translation. The >> other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there >> is never any confusion between month and day...and again everything is >> in sequential order. >> >> Jim >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:43:16 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:43:16 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Message-ID: Well, Jim Lawrence & I are directly in line with the output from Fukushima Daiichi, so that's a distinct possibility for the future. On Thu, Mar 31, 2011 at 10:36 PM, Stuart McLachlan wrote: > Simple - ?if you have six digits on each hand. > > or even better five limbs in total with 12 fingers/toes on each. From davidmcafee at gmail.com Fri Apr 1 09:31:45 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 07:31:45 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> References: <757F90EAE81B4D8587C1948BA52F0E6D@nant> <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> Message-ID: That's how I do it Sent from my Droid phone. On Mar 31, 2011 9:46 PM, "Jim Lawrence" wrote: > How does everyone connect to their data on their SQL server? > > I have never done any other method than by passing parameters and calling > the appropriate SP. Does everyone else actually just send sql strings? > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, March 31, 2011 3:40 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Un-American Date Filter > > That is, unless the backend may be SQL Server, in which case, the > delimiter is a single quote. We used to run into that issue in .Net, > so we built a function to return the date string formatted with the > correct delimiter depending on which database was in use. Easy enough > to create a function to format any date to US format as well. > > Charlotte Foust > > On Thu, Mar 31, 2011 at 2:58 PM, Shamil Salakhetdinov > wrote: >> Hi Rocky -- > >> Of course date string used in SQL expression in American format should be >> enclosed in a pair of '#' symbols - #04/01/2011# .... >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 10:47:26 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 1 Apr 2011 08:47:26 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: <152C372724D34FF3BA3B91793BA65146@creativesystemdesigns.com> It was a date format for human viewing; a number delimitated by letters and then numbers again...found to be the best standard and for easy reading, because of its symmetry and order. OTOH if given a date like 03/06/11, no one will ever know whether it is referring to the Mar 06 1911 or 03 Jun 1911 or Mar 06 2011 or 03 Jun 2011. Worked on a government project to bring all the old data into the computers. When I left 6 months later they were still working on it. With no standards and mixed formats many dates had to be interpeted by manually going through related files. I understand that people are still working on the project and that was almost 15 years ago. ;-) We know of a friend who is tasked with translating of church records which go back over a thousand years...too bad there were no stanadrds in the parishes. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 10:31 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 1 12:37:43 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 01 Apr 2011 19:37:43 +0200 Subject: [AccessD] Un-American Date Filter Message-ID: Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From davidmcafee at gmail.com Fri Apr 1 13:37:04 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 11:37:04 -0700 Subject: [AccessD] Weird issues with one user Message-ID: I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub From iggy at nanaimo.ark.com Fri Apr 1 16:31:40 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Fri, 01 Apr 2011 13:31:40 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D96443C.9090400@nanaimo.ark.com> Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. From rockysmolin at bchacc.com Fri Apr 1 15:56:51 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 13:56:51 -0700 Subject: [AccessD] Can it be done? In-Reply-To: References: Message-ID: <3E670D818042446CB0D4BC865203BB45@HAL9005> Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 1 16:00:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 14:00:02 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: Message-ID: <352C74FE2635434CA41704AD49475FAB@HAL9005> Demonstrating once again why I've been on this list for lo these many years. I'm going to be doing a lot of scheduling work for this client over in Bahrain in the coming months - Creating a whole shop floor scheduling and control system for them - very date intensive. "I pity the fool who's not a member of AccessD" - Mr. T. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 01, 2011 10:38 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Un-American Date Filter Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Fri Apr 1 16:03:15 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Fri, 1 Apr 2011 14:03:15 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: References: Message-ID: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Hi David, A couple of suggestions that might help you determine if your Modal idea is in fact the problem. In form frm_002D_Company open event try setting focus to an enabled control, this should bring it to the front. Since you you have a parameter declared to pass the name of the calling form, perhaps you could add code to hide the calling form in the on load or on open event of frm_002D_Company and then un hide it on form close. HTH Bill -------------------------------------------------- From: "David McAfee" Sent: Friday, April 01, 2011 11:37 AM To: "Access Developers discussion and problem solving" Subject: [AccessD] Weird issues with one user I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 1 16:06:29 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:06:29 -0500 Subject: [AccessD] Can it be done? In-Reply-To: <3E670D818042446CB0D4BC865203BB45@HAL9005> References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Glad it worked perfectly for you! That's what I like to hear about my sample systems. ;) I wonder if MS ever looked at it. Years ago this came up, it was Susan that wanted it, because she was copying and pasting data from the web into an Access form, and wanted the form to always be on top. MS's knowledge base had an article using a form timer... I submitted my solution to them, never heard back. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 01, 2011 3:57 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Can it be done? Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ssharkins at gmail.com Fri Apr 1 16:19:00 2011 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 1 Apr 2011 17:19:00 -0400 Subject: [AccessD] Can it be done? References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > From DWUTKA at Marlow.com Fri Apr 1 16:21:40 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:21:40 -0500 Subject: [AccessD] Can it be done? In-Reply-To: References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: That is true, we did! LOL. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 01, 2011 4:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From df.waters at comcast.net Fri Apr 1 16:24:59 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 1 Apr 2011 16:24:59 -0500 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> References: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <007301cbf0b3$41e65f20$c5b31d60$@comcast.net> Boy do I agree with this! I only occasionally create a pivot query. So, I just start with one I've already done and keep tweaking it until it does what I want. It's the fastest way for me. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Friday, April 01, 2011 4:32 PM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 1 23:54:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 00:54:06 -0400 Subject: [AccessD] Word document merge Message-ID: <4D96ABEE.3050501@colbyconsulting.com> I am setting up a word document merge. The document has a "parent / child" or parent / detail format. This is a state document and it needs to look like they give it to me. FName LName From date From time From time From date From time From time From date From time From time Pickup time Return time Signature The form has room for three date time parts, the rest is just once per document. Is this possible with Mail Merge? Do I need to "automate" this by pushing the data into it a field at a time? The form will be filled out and printed, then faxed - or printed to a fax printer. On that note, can I insert a signature picture somehow? TIA for any assistance in this. -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Sat Apr 2 00:11:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 02 Apr 2011 15:11:55 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D96ABEE.3050501@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com> Message-ID: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Are these "one-off" documents, or do you process several in one run? -- Stuart On 2 Apr 2011 at 0:54, jwcolby wrote: > I am setting up a word document merge. The document has a "parent / > child" or parent / detail format. This is a state document and it > needs to look like they give it to me. > > FName LName > > From date From time From time > From date From time From time > From date From time From time > > Pickup time Return time > > Signature > > The form has room for three date time parts, the rest is just once per > document. > > Is this possible with Mail Merge? Do I need to "automate" this by > pushing the data into it a field at a time? > > The form will be filled out and printed, then faxed - or printed to a > fax printer. > > On that note, can I insert a signature picture somehow? > > TIA for any assistance in this. > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 09:48:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 10:48:54 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com> <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Message-ID: <4D973756.2030605@colbyconsulting.com> Stuart, > Are these "one-off" documents, or do you process several in one run? I am starting to check inmates out of the local camp for AA meetings, church and the like. This is the checkout document that I have to fill out for each time I check someone out. So I will be filling out a checkout parent/child recordset for each inmate for each time I will check them out. I can never check out more than three inmates at a time, so I might fill out for one inmate for church, and two for an AA meeting on Tuesday. Like that. Actually I eventually figured it out. I am using bookmarks and inserting data in the bookmarks. I think the way it will work is that I will have a button on the form where I fill out the data. fill one "checkout", print it, do the next, print it. I have to sign these and then fax them to the prison. I would like to eventually have a signature gif which I insert into the document, and eventually fax them straight out of my machine. John W. Colby www.ColbyConsulting.com On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > Are these "one-off" documents, or do you process several in one run? > From stuart at lexacorp.com.pg Sat Apr 2 09:57:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 03 Apr 2011 00:57:24 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D973756.2030605@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> Message-ID: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) Do you need to insert the signature at print time, or can you just put it in the blank template document? I generally do the latter. -- Stuart On 2 Apr 2011 at 10:48, jwcolby wrote: > Stuart, > > > Are these "one-off" documents, or do you process several in one > run? > > I am starting to check inmates out of the local camp for AA meetings, > church and the like. This is the checkout document that I have to > fill out for each time I check someone out. So I will be filling out > a checkout parent/child recordset for each inmate for each time I will > check them out. I can never check out more than three inmates at a > time, so I might fill out for one inmate for church, and two for an AA > meeting on Tuesday. Like that. > > Actually I eventually figured it out. I am using bookmarks and > inserting data in the bookmarks. I think the way it will work is that > I will have a button on the form where I fill out the data. fill one > "checkout", print it, do the next, print it. > > I have to sign these and then fax them to the prison. I would like to > eventually have a signature gif which I insert into the document, and > eventually fax them straight out of my machine. > > John W. Colby > www.ColbyConsulting.com > > On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > > Are these "one-off" documents, or do you process several in one run? > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 10:20:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:20:47 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> Message-ID: <4D973ECF.7070301@colbyconsulting.com> Well... I am intending to share the app so "at print time" is the best solution. John W. Colby www.ColbyConsulting.com On 4/2/2011 10:57 AM, Stuart McLachlan wrote: > That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) > > Do you need to insert the signature at print time, or can you just put it in the blank template > document? I generally do the latter. > From jwcolby at colbyconsulting.com Sat Apr 2 10:37:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:37:07 -0400 Subject: [AccessD] datatype Time(7) precision Message-ID: <4D9742A3.8050002@colbyconsulting.com> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. -- John W. Colby www.ColbyConsulting.com From iggy at nanaimo.ark.com Sat Apr 2 11:55:30 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Sat, 02 Apr 2011 08:55:30 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D975502.6050102@nanaimo.ark.com> Hey All This is incredible if it wasn't so sad. Been fooling around with the Pivot Tables in Access 2003. I had originally installed the OCW11.dll for Access 2003 in the reference library. Finally found Microsoft's "Programming Pivot Table Reports in Access 2002." All the goodies for programmatically controlling the Pivot Table with Access VBA. Spent the last couple of hours trying their examples. Some worked fine, with others part of it would work other parts wouldn't and with some the examples it just crashed (type mismatch, this property can't be used with this object etc. etc. etc.). Farted around trying to figure out what it was I was doing wrong. Finally the "DUH" light went on, I noticed the Dim Pivot Table properties were preceded with OWC10, eg. Pt as OCW10.PivotTable I had changed these to OCW11. I switched to the OCW10.dll for Access 2002 and changed the OCW11 back to OCW10, and low and behold eveything worked beautifully. Who in they right mind would provide something like this to the developer, without a warning, I am baffled. The time I have wasted over the last couple of days I could have by now designed my own pseudo pivot table. Hey Zeus!!!! From gustav at cactus.dk Sat Apr 2 11:49:59 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 02 Apr 2011 18:49:59 +0200 Subject: [AccessD] datatype Time(7) precision Message-ID: Hi John That should influence the fractions of a second only: http://msdn.microsoft.com/en-us/library/bb677243.aspx Specifies the number of digits for the fractional part of the seconds. This can be an integer from 0 to 7. The default fractional precision is 7 (100ns). As Access out of the box doesn't support fractions of seconds, you must be facing another issue. /gustav >>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07 >>> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. From jwcolby at colbyconsulting.com Sat Apr 2 13:19:14 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 14:19:14 -0400 Subject: [AccessD] datatype Time(7) precision In-Reply-To: References: Message-ID: <4D9768A2.7000105@colbyconsulting.com> As it turns out, it is a driver issue. Using vanilla ODBC rather than the native SQL Server causes the (data entry) issue to go away. John W. Colby www.ColbyConsulting.com On 4/2/2011 12:49 PM, Gustav Brock wrote: > Hi John > > That should influence the fractions of a second only: > > http://msdn.microsoft.com/en-us/library/bb677243.aspx > Specifies the number of digits for the fractional part of the seconds. > This can be an integer from 0 to 7. > The default fractional precision is 7 (100ns). > > As Access out of the box doesn't support fractions of seconds, you must be facing another issue. > > /gustav > > >>>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07>>> > What does the (7) really mean? Is it possible to manipulate that number to determine how many > seconds / milliseconds etc that SQL server is expecting to be entered? > > Im am trying to enter time in Access and I am currently required to enter the seconds part > > hh:mm:ss > > 08:00:00 > > If I don't enter the seconds SQL Server complains as I try to store the field. > > > From gustav at cactus.dk Sun Apr 3 07:45:20 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 03 Apr 2011 14:45:20 +0200 Subject: [AccessD] Rapid Application Development: LightSwitch Beta 2 Message-ID: Hi all Here is a better, though still brief, introduction to the new beta: http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/threads Click at the top under Announcements the topic: Visual Studio LightSwitch Beta 2 Released with Go Live License! .. We'd also like to announce that Beta 2 comes with a "Go Live" license which means you can now start using Visual Studio LightSwitch for production projects /gustav >>> gustav at cactus.dk 03-04-2011 11:07 >>> Hi members of "VS2010 SP1 club" Then those interested in true RAD may proceed obtaining the recent LightSwitch Beta 2 which requires VS2010 SP1: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=cff6c4ef-a29a-4c82-9a59-8a3bbb65ec3d The Beta 1 must be uninstalled first. Apart from many minor improvements "too numerous to mention" as the team tells, an interesting new feature is direct deployment to Windows/SQL Azure. Also, the Visual Studio LightSwitch Beta 2 Training Kit: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=AC1D8EB5-AC8E-45D5-B1E3-EFB8E4E3EBD1 /gustav >>> shamil at smsconsulting.spb.ru 02-04-2011 16:26:55 >>> Hi Gustav at al, <<< So I did and ran the SP1 again. This time - as everything was downloaded - it took about an hour to finish. >>> Yes, I have also got to the "VS2010 SP1 club" today. :) Setup went smoothly and took a bit more than an hour.... Thank you. -- Shamil From rockysmolin at bchacc.com Sun Apr 3 10:05:52 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 3 Apr 2011 08:05:52 -0700 Subject: [AccessD] Solution in Search of a Problem Message-ID: I got a .pages file from a friend and, of course, couldn't open it. It was made on a (shudder) Mac. I got this tip from the web, though on opening it. Save the .pages file, change the extension to .zip, double click to unzip. In the zip file there will be a file called preview.pdf which will be the .pages doc converted to pdf. Walla! Rocky From Darryl.Collins at iag.com.au Sun Apr 3 20:02:54 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Mon, 4 Apr 2011 11:02:54 +1000 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <201104040103.p34133uS024641@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Pivot tables in Access are so insipid and fiddly that almost anyone who needs to use PTs seriously end up using Excel anyway, and either hooks Excel into the database or pushes the source out of the database into an Excel workbook / template which then automatically produces the PT using code. Best of both world then. Excel's PT ability is far superior to what is native in Access. My advice would be that using Excel is still the better approach. Of course your milage may vary depending on what you want to do. Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Saturday, 2 April 2011 8:32 AM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From rusty.hammond at cpiqpc.com Mon Apr 4 10:02:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 4 Apr 2011 10:02:44 -0500 Subject: [AccessD] Windows Terminal Services and RemoteApp - nice Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE117@CPIEMAIL-EVS1.CPIQPC.NET> A nice little introduction to Windows terminal services and the newer RemoteApp feature from FMS. Gives the ability to connect to a Terminal Server session and only show the app(s) you want the user to see. http://www.fmsinc.com/MicrosoftAccess/terminal-services/remoteapp.htm Rusty Hammond IT Dept. - B-20 Senior Developer CPI Qualified Plan Consultants, Inc. (620) 793-8473 ext. 416 rusty.hammond at cpiqpc.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From bheygood at abestsystems.com Mon Apr 4 14:06:54 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:06:54 -0700 Subject: [AccessD] datatype Time(7) precision In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <8BC8D7BC2C9840278F464D0A8CF5B340@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:08:37 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:08:37 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:09:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:09:01 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <0D38443FD37B4E6AAF674630AD1040E7@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From davidmcafee at gmail.com Mon Apr 4 14:58:26 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 4 Apr 2011 12:58:26 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: <5F016B3563E9447A81D7A3AFE217A357@BPCS> References: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Message-ID: I added the set focus. I also noticed that AutoCenter was off, so I turned that on. I put out an update and the user said that it worked, so I'm not sure which one fixed it, but it is fixed. Thanks. David On Fri, Apr 1, 2011 at 2:03 PM, Bill Patten wrote: > Hi David, > > A couple of suggestions that might help you determine if your Modal idea is > in fact the problem. > > In form frm_002D_Company open event try setting focus to an enabled > control, this should bring it to the front. > > Since you you have a parameter declared to pass the name of the calling > form, perhaps you could add code to hide the calling form in the on load or > on open event > of frm_002D_Company and then un hide it on form close. > > HTH > > > Bill > -------------------------------------------------- > From: "David McAfee" > Sent: Friday, April 01, 2011 11:37 AM > To: "Access Developers discussion and problem solving" > > Subject: [AccessD] Weird issues with one user > > I've been struggling with this issue for the last couple of days and it is > driving me nuts. > > The user didn't have problems until they were given a newer computer. > The computer has Vista as the OS and Access2007. > > I have some forms that were originally created in Access 2000, and another > created in (I believe Access 2003). > > Now that they have the new computer, when the user clicks on cmdLocationAdd > (or Edit), Access seems to lock up. > > What I believe is happening is that the form 002D is opening up in modal > mode, but not on top of the form that is calling it. > > I can't recreate it on my machine (also a Vista box with A2007). > > I checked our references and they both match: > > Visual Basic for Applications > Microsoft Access 12.0 Object Library > OLE Automation > Microsoft ActiveX Data Objects 2.1 Library > Microsoft DAO 3.6 Object Library > > Any ideas? > > Here are the related subs: > > > The A2003 calls a form on an OnClick event: > > Private Sub cmdLocationAdd_Click() > Dim strOpenArgs As String > strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & > Me.lstCompaniesFound.Column(1) > 'Debug.Print strOpenArgs > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return > Form | Return Field | CompanyName > End Sub > > Private Sub cmdLocationEdit_Click() > Dim strOpenArgs As String > 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | > strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & > Me.lstCompaniesFound.Column(1) '2 = Edit > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > Me.lstCompanyLocations.Requery > End Sub > > > Private Sub Form_Load() > On Error GoTo Form_Load_Error > 'Dim errNum As Double, errDesc As String, errLine As Integer > > If Not IsNull(Me.OpenArgs) Then > Dim arrX As Variant > arrX = Split(Me.OpenArgs, "|") > intMode = arrX(0) > Select Case intMode > Case 1 'Add Mode > Me.txtCompanyID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Addition" > Me.Caption = "New Address Entry" > 'Hide listbox & cmd button as we don't have an AddressID yet > Me.lstAddtionalInfo.Visible = False > Me.cmdAddAddtionalInfo.Visible = False > Me.cmdEditAddtionalInfo.Visible = False > Me.cmdDelAddtionalInfo.Visible = False > ' Show fields below, so we can write to the appropriate fields > when we append this record > Me.txtPhone.Visible = True > Me.txtfax.Visible = True > Me.txtemail.Visible = True > > Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") > Case 2 'Edit Mode > Me.txtAddrID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Edit" > Me.Caption = "Company Address Edit" > 'Show listbox & cmd button as we now have an AddressID > Me.lstAddtionalInfo.Visible = True > Me.cmdAddAddtionalInfo.Visible = True > Me.cmdEditAddtionalInfo.Visible = True > Me.cmdDelAddtionalInfo.Visible = True > 'No need to show these fields as we have the listbox available > Me.txtPhone.Visible = False > Me.txtfax.Visible = False > Me.txtemail.Visible = False > FillAddress (Me.txtAddrID) > 'Fill Phone/fax/email info: > Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " > & Me.txtAddrID > Case Else > 'Trap code removed > End Select > strReturnForm = arrX(2) 'Parameter 3, the form that we will return the > data to > strReturnField = arrX(3) 'Parameter 4, the field in the above form that > data will return to > Else > 'Do stuff when opened without OpenArgs > End If > > End Sub > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Mon Apr 4 15:20:51 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 13:20:51 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a local > drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading the > resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I still am > not able to use it. > > It's very important as I, like most of you, need to replicate a clients > setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another instance of > MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 16:05:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:05:45 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: References: , , Message-ID: <4D9A32A9.25393.377FC767@stuart.lexacorp.com.pg> I agree with Charlotte completely. That's exactly what I do. Use UNC paths, not mappings, store your development and production paths somewhere in te FE and include a re-link procress to switch between development and production BEs. Triggering the rellink can be controlled in all sorts of ways, including fully automated by checking the location of the FE on startup. -- Stuart On 4 Apr 2011 at 13:20, Charlotte Foust wrote: > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a local > drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading the > resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I still am > not able to > use it. > > It's very important as I, like most of you, need to > replicate a clients > setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another instance of > MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheygood at abestsystems.com Mon Apr 4 16:24:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 14:24:39 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <41760139BA5C46879CDDA9E6D324546D@Seven> Thanks for the response. The client is dictating which drive I have to use. Yes, I tried to set some looser permissions from the properties dialog. Lately sometimes it "sticks" and the changes I made are there next time I check. And sometimes not. Irregardless, I can't write to files in that folder. Error = You do not have permissions..... -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Mapped Drive Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a > local drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading > the resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I > still am not able to use it. > > It's very important as I, like most of you, need to replicate a > clients setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another > instance of MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Mon Apr 4 16:31:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:31:38 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: <41760139BA5C46879CDDA9E6D324546D@Seven> References: , , <41760139BA5C46879CDDA9E6D324546D@Seven> Message-ID: <4D9A38BA.25221.37977B2B@stuart.lexacorp.com.pg> Permissions on a folder are whihcever are the more severe between direct and shared. You need to set appropriate permissions on the actual folder in Explorer as well in the Sharing dialog. -- Stuart On 4 Apr 2011 at 14:24, b heygood wrote: > Thanks for the response. > The client is dictating which drive I have to use. > > Yes, I tried to set some looser permissions from the properties > dialog. Lately sometimes it "sticks" and the changes I made are there > next time I check. And sometimes not. Irregardless, I can't write to > files in that folder. Error = You do not have permissions..... > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Mapped Drive > > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a > local drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading > the resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I > still am not able to > use it. > > It's very important as I, like most of you, need to > replicate a > clients setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another > instance of MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 17:54:16 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 18:54:16 -0400 Subject: [AccessD] Error 3027 Message-ID: <000001cbf31b$3b72b1b0$b2581510$@com> Hello, I wanted to fill a Query with AddNew and Update. But I get the error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." What can I do to fix this problem? TIA. Saludos Actuary Ralf Lister La Paz, Bolivia From stuart at lexacorp.com.pg Mon Apr 4 18:04:12 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:04:12 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000001cbf31b$3b72b1b0$b2581510$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> Message-ID: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Hard to say without seeing the query, but a common reason for a query being RO is that it doesn't include the PK of the table you are trying to update. -- Stuart On 4 Apr 2011 at 18:54, Ralf Lister wrote: > Hello, > > > > I wanted to fill a Query with AddNew and Update. But I get the error > message " Error 3027 at run time./ You can't update. The database a/o > object is "read only"." What can I do to fix this problem? > > > > TIA. > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 18:06:06 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 11:06:06 +1200 Subject: [AccessD] Archives Down Message-ID: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From charlotte.foust at gmail.com Mon Apr 4 18:24:28 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 16:24:28 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 18:49:34 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:49:34 +1000 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com>, <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg>, Message-ID: <4D9A590E.11612.3815C21C@stuart.lexacorp.com.pg> I assumed that the query was the source of a DAO.recordset in VBA. But I was wrong once before, it's conceivable that I am again. -- Stuart On 4 Apr 2011 at 16:24, Charlotte Foust wrote: > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 19:42:32 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 20:42:32 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: <000501cbf32a$5b411900$11c34b00$@com> Thank you all for your help. Charlotte, I`m gathering information data about one person, make some calculations and save this calculations in the fields of a query by Set dbs = CurrentDb Set rst = dbs.OpenRecordset("qryBeneficiosAlt") With rst .AddNew ![FechaCalculo] = Now ![Nombre] = gstrNombre ![Beneficiario] = gstrBeneficiario ![Edad] = gintEdad ![Sexo] = gstrSexo ![Densidad] = gintDensidad ![TasaActualUSD] = gsngTasaActualUSD ![TasaCompUSD] = gsngTasaCompUSD ![CC] = gsngCC ' CC = Compensacion de Cotizaciones ![PBR] = gsngPBR ' PBR = Pension Base Referencial ![LimSolInf] = gsngLimSolInf ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial ![PR] = gsngPR ' Porcentaje Referencial ![BeneficiosAltPension] = gsngBeneficiosAltPension ![ValorAportes] = gsngValorAportes ![GF] = gsngGF .Update End With to be able to make a report on this very query as a Control Source. After printing the report I delete the data in the query with "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. But at "AddNew I get this error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 From stuart at lexacorp.com.pg Mon Apr 4 20:28:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 11:28:51 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> Message-ID: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > .AddNew > > ![FechaCalculo] = Now > > ![Nombre] = gstrNombre > > ![Beneficiario] = gstrBeneficiario > > ![Edad] = gintEdad > > ![Sexo] = gstrSexo > > ![Densidad] = gintDensidad > > ![TasaActualUSD] = gsngTasaActualUSD > > ![TasaCompUSD] = gsngTasaCompUSD > > ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ![LimSolInf] = gsngLimSolInf > > ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ![PR] = gsngPR ' Porcentaje Referencial > > ![BeneficiosAltPension] = gsngBeneficiosAltPension > > ![ValorAportes] = gsngValorAportes > > ![GF] = gsngGF > > .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > > _____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 20:38:48 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 13:38:48 +1200 Subject: [AccessD] Creating ADE's in Access 2010 Message-ID: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Darryl.Collins at iag.com.au Mon Apr 4 20:54:32 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 11:54:32 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <201104050154.p351seYM014934@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hey, that is good to know. So this will create an A2003 version MDE that will run on both A2003 and A2007/10? I will try this at home later and see what happens. Nice if it works like I think it should and much easier than doing it the 'proper' way. cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, 5 April 2011 11:39 AM To: accessd at databaseadvisors.com Subject: [AccessD] Creating ADE's in Access 2010 For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Mon Apr 4 21:03:06 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 12:03:06 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <201104050154.p351seYM014934@databaseadvisors.com> References: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz>, <201104050154.p351seYM014934@databaseadvisors.com> Message-ID: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > From Darryl.Collins at iag.com.au Mon Apr 4 21:51:26 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 12:51:26 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Message-ID: <201104050251.p352pXOH017248@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am been largely ok with forward compatibility so far, although there has been some issues between 2003 and 2007. Might be fun to try this out though and see what happens with a 2007 'mde' in A2003 etc. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, 5 April 2011 12:03 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Creating ADE's in Access 2010 Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Gustav at cactus.dk Tue Apr 5 05:35:25 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 05 Apr 2011 12:35:25 +0200 Subject: [AccessD] Windows 8, Metro and modern UI Message-ID: Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screenshots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experience/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-revealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wallpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-transportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav From accessd at shaw.ca Tue Apr 5 12:47:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 5 Apr 2011 10:47:38 -0700 Subject: [AccessD] [dba-Tech] Windows 8, Metro and modern UI In-Reply-To: References: Message-ID: <0B83A3EE0FDC4839B506AFFA025B107D@creativesystemdesigns.com> Hi Gustav: The new designs looks (more like sounds) really interesting. I like that they are going more towards a flat and clean design with an emphasis on transitions. The only issues, especially if you are working with web based applications is the font options. There is only so much you can do with half dozen standard internal fonts you will find on every computer/browser as even the most fancy CSS has it limitations...and just downloading font images is not the answer if you application is going international. I have been working with this coding to allow a wider range of fonts to be deployed but there has to be a judicious trade off in performance and there is a limited set of size options. http://www.960development.com/how-to-write-cross-browser-font-face-syntax/ Jim -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, April 05, 2011 3:35 AM To: accessd at databaseadvisors.com; dba-tech at databaseadvisors.com Subject: [dba-Tech] Windows 8, Metro and modern UI Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screen shots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experi ence/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-r evealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wa llpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-tra nsportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com From EdTesiny at oasas.state.ny.us Tue Apr 5 14:22:18 2011 From: EdTesiny at oasas.state.ny.us (Tesiny, Ed) Date: Tue, 5 Apr 2011 15:22:18 -0400 Subject: [AccessD] Archives Down In-Reply-To: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> References: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: Nope, looks like it's down Ed Tesiny EdTesiny at oasas.state.ny.us -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, April 04, 2011 7:06 PM To: Access Developers discussion and problem solving Subject: [AccessD] Archives Down Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 5 15:02:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 15:02:26 -0500 Subject: [AccessD] Query grid question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From charlotte.foust at gmail.com Tue Apr 5 15:49:01 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:49:01 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> <000501cbf32a$5b411900$11c34b00$@com> Message-ID: You actually want to add data to tables, so why try to use the query to do so? In any case, if it isn't updateable it's usually because of the structure of the query. However, in your case, depending on the version of Access you're using, you haven't declared a recordset type, so your recordset may be a snapshot, which is not updatable by definition, regardless of whether the query is. Charlotte Foust On Mon, Apr 4, 2011 at 5:42 PM, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations ?and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > ? ?.AddNew > > ? ?![FechaCalculo] = Now > > ? ?![Nombre] = gstrNombre > > ? ?![Beneficiario] = gstrBeneficiario > > ? ?![Edad] = gintEdad > > ? ?![Sexo] = gstrSexo > > ? ?![Densidad] = gintDensidad > > ? ?![TasaActualUSD] = gsngTasaActualUSD > > ? ?![TasaCompUSD] = gsngTasaCompUSD > > ? ?![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ? ?![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ? ?![LimSolInf] = gsngLimSolInf > > ? ?![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ? ?![PR] = gsngPR ' Porcentaje Referencial > > ? ?![BeneficiosAltPension] = gsngBeneficiosAltPension > > ? ?![ValorAportes] = gsngValorAportes > > ? ?![GF] = gsngGF > > ? ?.Update > > End With > > > > to be able to make a report on this very query as a Control Source. After > printing the report I delete the data in the query with "DoCmd.RunSQL > "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You can't > update. The database a/o ?object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust > Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > > > Another possible reason is a multiple table query. ?Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: >> Hard to say without seeing the query, but a common reason for a query > being RO is that it >> doesn't include the PK of the table you are trying to update. >> >> -- >> Stuart >> >> On 4 Apr 2011 at 18:54, Ralf Lister wrote: >> >>> Hello, >>> >>> >>> >>> I wanted to fill a Query with AddNew and Update. But I get the error >>> message " Error 3027 at run time./ You can't update. The database a/o >>> object is "read only"." What can I do to fix this problem? >>> >>> >>> >>> TIA. >>> >>> >>> >>> Saludos >>> >>> Actuary Ralf Lister >>> >>> La Paz, Bolivia >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > ?_____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 5 15:50:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:50:15 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Tue Apr 5 16:03:30 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 16:03:30 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Here is a good example SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM WHERE Groups.Name like "MANIFOLD *" and Groups.Name not like "* AREA" and Groups.GroupingType="CGRP" and Members.ChildPTYPE="COMP" and Members.PID=Groups.PID and CM.PID=Members.ChildPID ORDER BY Members.ChildPID, Groups.Name; -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 3:50 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rlister at actuarial-files.com Tue Apr 5 17:50:03 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 18:50:03 -0400 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Message-ID: <000601cbf3e3$cedce560$6c96b020$@com> Thanks a lot Stuart, The SQL is: SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, tblWerte.BeneficiosAltPension, tblDisposiciones.GF FROM tblWerte, tblDisposiciones; Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations? and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > >???? .AddNew > >???? ![FechaCalculo] = Now > >???? ![Nombre] = gstrNombre > >???? ![Beneficiario] = gstrBeneficiario > >???? ![Edad] = gintEdad > >???? ![Sexo] = gstrSexo > >???? ![Densidad] = gintDensidad > >???? ![TasaActualUSD] = gsngTasaActualUSD > >???? ![TasaCompUSD] = gsngTasaCompUSD > >???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > >???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial > >???? ![LimSolInf] = gsngLimSolInf > >???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > >???? ![PR] = gsngPR ' Porcentaje Referencial > >???? ![BeneficiosAltPension] = gsngBeneficiosAltPension > >???? ![ValorAportes] = gsngValorAportes > >???? ![GF] = gsngGF > >???? .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o? object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query.? Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > >?? _____? > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:07:43 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:07:43 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000601cbf3e3$cedce560$6c96b020$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Tue Apr 5 18:16:11 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 19:16:11 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: <000d01cbf3e7$74facea0$5ef06be0$@com> Thank's Charlotte, Thank's a lot for your help. I wouldn't have found this silly error with your help. I'll join now the tables. Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Martes, 05 de Abril de 2011 07:08 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3553 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:19:03 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:19:03 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 5 22:54:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 05 Apr 2011 23:54:53 -0400 Subject: [AccessD] Autonumber when? Message-ID: <4D9BE40D.8050502@colbyconsulting.com> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From rusty.hammond at cpiqpc.com Tue Apr 5 23:02:58 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 5 Apr 2011 23:02:58 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Hi John, Do the following: .Update .BookMark = .LastModified mlngLogID = !PLSL_ID HTH Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 10:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Wed Apr 6 05:09:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 06:09:49 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C3BED.1000700@colbyconsulting.com> Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From ab-mi at post3.tele.dk Wed Apr 6 05:52:23 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 12:52:23 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <953E20402FC54D7AABE4F2578153A13D@abpc> Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. With rs .AddNew .!PLSL_IDPLSUSR = mlngIDUser .!PLSL_FE = CurrentProject.Name .!PLSL_Login = blnLogIn .!PLSL_WorkstationID = CurrentMachineName() On Error Resume Next .Update mlngLogID = .!PLSL_ID If Err Then mlngLogID = .!PLSL_ID End If .Close End With Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 12:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Wed Apr 6 06:06:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 13:06:52 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John How about: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 05:54 >>> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 06:57:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:57:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C5532.4060906@colbyconsulting.com> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > From jwcolby at colbyconsulting.com Wed Apr 6 06:58:01 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:58:01 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <953E20402FC54D7AABE4F2578153A13D@abpc> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <953E20402FC54D7AABE4F2578153A13D@abpc> Message-ID: <4D9C5549.2050804@colbyconsulting.com> Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> From Gustav at cactus.dk Wed Apr 6 07:44:24 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 14:44:24 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John No, it was not the same. It works! /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 13:57 >>> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? From Chester_Kaup at kindermorgan.com Wed Apr 6 07:38:28 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 6 Apr 2011 07:38:28 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> The grid is completely empty except for the two tables. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 6:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From ab-mi at post3.tele.dk Wed Apr 6 07:52:21 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 14:52:21 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5549.2050804@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><953E20402FC54D7AABE4F2578153A13D@abpc> <4D9C5549.2050804@colbyconsulting.com> Message-ID: <14A5B079377C4684B1473AEB5D140AAE@abpc> Ok, I see. Then try a MoveLast after the Update and before reading the new autonumber, i.e. With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .MoveLast mlngLogID = !PLSL_ID .Close End With Works for me. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 13:58 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Wed Apr 6 08:17:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 06:17:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: I don't know if this helps, but I always call @@IDENTITY in SQL to get the last PKID. Sent from my Droid phone. On Apr 5, 2011 8:56 PM, "jwcolby" wrote: > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 6 08:24:38 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 09:24:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <07790084744342A6AF9FAE17F48AF13D@XPS> John, You may find the following helpful: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6 -4e13-8876-f6e5faae8dba/ It pretty much covers what has already been said, but goes through some of the in's and out's of why one approach works or doesn't. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 11:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:25:29 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:25:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5532.4060906@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 08:25:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:25:45 -0400 Subject: [AccessD] I need help Message-ID: <4D9C69D9.6060702@colbyconsulting.com> In NC where I live, volunteers can check certain inmates out of prison for up to 6 hours for activities like church, AA meetings or pretty much anything legal. I have the required certification to do this and I am writing an application to assist volunteers such as myself in filling out leave pass requests for prison inmates. There is a web search site that anyone can use to search for and observe the information about inmates. I am inserting the URL complete with a random inmate selected. Watch for word wrap. http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=0012345&searchOffenderId=0012345&listurl=pagelistoffendersearchresults&listpage=1 What I need assistance with is reading the info at the very top of the Offender Info in order to extract this and automatically fill in a record in Access. IOW I search for and find an inmate, then I press a button and suck the info in that top area into a record. This will save a fair amount of typing. The problem is I have no idea how to do this. If I view the HTML I find an XML table that holds this stuff but how do I drill down to that area reliably, then extract the info? Preferably without doing it i some code intensive string manipulation way. I already have two other volunteers requesting my program, which I will be making available for free to any volunteers who do checkouts. I am trying to make this as user friendly as possible. Any help is much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 08:34:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:34:07 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C6BCF.1020100@colbyconsulting.com> Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against > a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > From rusty.hammond at cpiqpc.com Wed Apr 6 08:47:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 08:47:44 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> When you set your recordset are you using the dbSeeChanges option? You're code should look something like this: dim db as database dim rs as recordset set db=CurrentDB() set rs = db.openrecordset("tblName", dbOpenDynaset, dbSeeChanges) With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .BookMark = .LastModified mlngLogID = !PLSL_ID .Close End With -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 5:10 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From ab-mi at post3.tele.dk Wed Apr 6 08:49:57 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 15:49:57 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From mwp.reid at qub.ac.uk Wed Apr 6 08:50:21 2011 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 6 Apr 2011 14:50:21 +0100 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <631CF83223105545BF43EFB52CB08295470B44F4C7@EX2K7-VIRT-2.ads.qub.ac.uk> Might help http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6-4e13-8876-f6e5faae8dba/ Martin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 06 April 2011 14:34 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error > check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:58:42 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:58:42 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond Sent: Wednesday, April 06, 2011 9:50 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autonumber when? >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:01:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:01:04 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C7220.3060606@colbyconsulting.com> Lambert, I am actually doing *both*. The code needs to function for an MDB BE or an SQL BE. By testing BEFORE the save it works for DAO, the test AFTER the save (is supposed to) works for SQL. For whatever reason it doesn't work for the sql be. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:25 AM, Heenan, Lambert wrote: > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 6 09:01:47 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 10:01:47 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: As I said, look again John. You have... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With But Gustav (and me if I'd been quick enough) suggests... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. Lambert From jwcolby at colbyconsulting.com Wed Apr 6 09:06:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:06:59 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7383.4080009@colbyconsulting.com> Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? From jwcolby at colbyconsulting.com Wed Apr 6 09:15:41 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:15:41 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C758D.30905@colbyconsulting.com> It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Apr 6 09:19:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:19:34 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <4D9C7676.1000303@colbyconsulting.com> If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert From rusty.hammond at cpiqpc.com Wed Apr 6 09:21:02 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:21:02 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Yeah, there's something about linked SQL tables you have to set the recordset bookmark to the lastmodified record, after the update, before you can read the autonumber value when creating new records. It should work for both linked SQL tables and tables in an mdb so trying to read the value before the update isn't really necessary. Martin sent this link earlier that talks about it: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- 66a6-4e13-8876-f6e5faae8dba/ I've had this code running in an application for several years in Access 97 and 2003. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Wed Apr 6 09:38:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 10:38:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> John, A little code cleanup: Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Should be: Exit_mPLSLogin: On Error Resume Next If Not (rs Is Nothing) Then rs.Close Set rs = Nothing End If Exit Function Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:41:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:41:28 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7B98.9000909@colbyconsulting.com> It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, before > you can read the autonumber value when creating new records. It should > work for both linked SQL tables and tables in an mdb so trying to read > the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From jwcolby at colbyconsulting.com Wed Apr 6 09:45:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:45:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> Message-ID: <4D9C7C79.4070406@colbyconsulting.com> LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? From rusty.hammond at cpiqpc.com Wed Apr 6 09:46:37 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:46:37 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, now I remember what's going on. I had to go to Access 97 Developer's Handbook (page 269)to refresh my memory (page 1540 of the Access 2000 Developer's Handbook volume 1). You mentioned it in your original post that SQL doesn't create the autonumber value until after the record is created. When using the AddNew method on a Dynaset-type recordset, as soon as you do .Update, that new record gets added to the end of the recordset and is NOT the current record. To get to that new record, you use the .LastModified property of the recordset. You can use either of the following methods to get to the new record: .BookMark = .LastModified OR .Move 0, .LastModified Then get the value of the ID field. The nice thing is it works with either a linked SQL table or Access table. You new code should look like the following (I've rem'ed out your existing lines so you can see the changes): ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() 'Take out the following two lines - get the ID value after the Update - RustyH 'On Error Resume Next 'mlngLogID = !PLSL_ID .Update 'Added the following line - RustyH .BookMark = .LastModified 'If Err Then mlngLogID = !PLSL_ID 'End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Wed Apr 6 09:57:51 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:57:51 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7B98.9000909@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7B98.9000909@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12D@CPIEMAIL-EVS1.CPIQPC.NET> Because the record isn't actually saved to the table until you do .Update. It's like creating a new record on a data entry form or directly in the table. You can click the AddNew button and enter data in the fields but until you move to another record or hit the Save Record button, the record isn't saved yet. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:41 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, > before you can read the autonumber value when creating new records. > It should work for both linked SQL tables and tables in an mdb so > trying to read the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c84 > 5- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in > Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As > DAO.Recordset Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or > review by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:12:57 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:12:57 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7676.1000303@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:20 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:17:50 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:17:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: Although that theory may get blown out of the water as Err should in fact retain its value even after the .Update statement. I just checked with this Sub Err_Test() Dim n As Long On Error Resume Next n = 10 / 0 n = 10 Debug.Print n, Err.Number End Sub Which outputs 10, 11 (as error 11 is Div by zero). But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 06, 2011 11:13 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert From Gustav at cactus.dk Wed Apr 6 10:41:41 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 17:41:41 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi Lambert I found out that you read out the value from the record you were at before calling .AddNew. That fooled me. But no error was raised which is what fooled JC. However, Rusty described how to do it with .LastModified which method I tested with success. /gustav >>> Lambert.Heenan at chartisinsurance.com 06-04-2011 17:17 >>> But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. From ab-mi at post3.tele.dk Wed Apr 6 10:31:25 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 17:31:25 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C758D.30905@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> <4D9C758D.30905@colbyconsulting.com> Message-ID: Correct. The identity column I used has a clustered PK. If that's not the case then you could open the recordset using a sql ordering by PLSL_ID and using the dbOpenDynaset, dbSeeChanges option. As for another record being inserted before moving last: if that's a risk then you should make the insert calling a sp in SQL Server. In this sp you can use SCOPE_IDENTITY() to get the last identity ("autonumber") value created by the procedure. (Don't use @@IDENTITY for this, since it might eventually return an identity value created by a trigger for your table.) Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 16:16 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 6 10:39:32 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 6 Apr 2011 08:39:32 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Wed Apr 6 10:43:50 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 11:43:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7C79.4070406@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> <4D9C7C79.4070406@colbyconsulting.com> Message-ID: <1751F81B42C84B468378B7D3CEC911A2@XPS> John, Don't remember exactly why, but it was important not to attempt the close if the object variable was already nothing, so therefore the check. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:45 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 14:45:22 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 15:45:22 -0400 Subject: [AccessD] IE search for table Message-ID: <4D9CC2D2.60402@colbyconsulting.com> Function mSearchTable() Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And Len(strOffenderInfo) = 0 Then strOffenderInfo = strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And Len(strMostRecent) = 0 Then strMostRecent = strInnerText End If End If Next varTable Debug.Print strOffenderInfo Debug.Print strMostRecent Cleanup: Set varTable = Nothing: Set varTables = Nothing 'objIE.Quit 'Set objIE = Nothing End Function -- John W. Colby www.ColbyConsulting.com From kismert at gmail.com Wed Apr 6 15:13:46 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 6 Apr 2011 15:13:46 -0500 Subject: [AccessD] Autonumber when? Message-ID: > > jwcolby > ... > The code needs to work whether going to an MDB or SQL BE. The code works > fine for an MDB BE but fails for a SQL BE. > ... > John, This is probably what you are trying to avoid, but I'll say it anyway: You should write separate code to handle the MDB and SQL Server BEs. First, the obvious: Jet and SQL Server are very different. * It is unlikely that this is the only variation you will have to account for throughout your code * Variations in code make it harder to test * When you do want to use SQL Server-specific features, like stored procedures, you will have to split the code anyway * I have a personal distaste of "On Error Resume Next" coding, which I use only for object cleanup code where there is literally nothing to raise an error to. All told, the cost and effort to make a large existing code base generic will likely exceed the cost of just splitting it neatly into libraries that support each database type. Plus, you get more modular, flexible, testable code. Again, this is what you are trying to avoid, but I felt I should say it, anyway. -Ken From jwcolby at colbyconsulting.com Wed Apr 6 15:38:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 16:38:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9CCF35.3030705@colbyconsulting.com> I hear you Ken. I have written a framework for MDB BEs. It is very large, and has tons of functionality, and was never intended to run against SQL Server simply because nobody was using that back when I wrote it. Now I am trying to use it for a SQL Server back end. It is not just a simple case of "write a library for this and a library for that. Additionally I need it to work where this table (or set of tables) is kept in an MDB and that one is moved to SQL. I write frameworks. The framework does a ton of stuff which is handled automatically. It handles the not in list and the dbl click of combos for example. The dbl click of a combo opens a form and moves to the record that the combo is displaying. Classes instantiate classes which instantiate classes. I am just not sure that "writing separate libs" is a viable option. It would mean a complete rewrite of the framework and then a complete rewrite of the FE. John W. Colby www.ColbyConsulting.com On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >> jwcolby >> ... >> The code needs to work whether going to an MDB or SQL BE. The code works >> fine for an MDB BE but fails for a SQL BE. >> ... >> > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken From davidmcafee at gmail.com Wed Apr 6 15:58:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 13:58:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9CCF35.3030705@colbyconsulting.com> References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: Perfect time to rewrite it for "unbound" >:P On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > On 4/6/2011 4:13 PM, Kenneth Ismert wrote: > >> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >>> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I >> use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries >> that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 6 16:20:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:20:08 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: <4D9CD908.8050904@colbyconsulting.com> ;) John W. Colby www.ColbyConsulting.com On 4/6/2011 4:58 PM, David McAfee wrote: > Perfect time to rewrite it for "unbound">:P > > > On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >>> >>>> jwcolby >>>> ... >>>> The code needs to work whether going to an MDB or SQL BE. The code works >>>> fine for an MDB BE but fails for a SQL BE. >>>> ... >>>> >>>> >>> John, >>> >>> This is probably what you are trying to avoid, but I'll say it anyway: >>> >>> You should write separate code to handle the MDB and SQL Server BEs. >>> >>> First, the obvious: Jet and SQL Server are very different. >>> * It is unlikely that this is the only variation you will have to account >>> for throughout your code >>> * Variations in code make it harder to test >>> * When you do want to use SQL Server-specific features, like stored >>> procedures, you will have to split the code anyway >>> * I have a personal distaste of "On Error Resume Next" coding, which I >>> use >>> only for object cleanup code where there is literally nothing to raise an >>> error to. >>> >>> All told, the cost and effort to make a large existing code base generic >>> will likely exceed the cost of just splitting it neatly into libraries >>> that >>> support each database type. >>> >>> Plus, you get more modular, flexible, testable code. >>> >>> Again, this is what you are trying to avoid, but I felt I should say it, >>> anyway. >>> >>> -Ken >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at colbyconsulting.com Wed Apr 6 16:23:21 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:23:21 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CD9C9.7090909@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 16:25:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:25:39 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CDA53.2090800@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From Chester_Kaup at kindermorgan.com Thu Apr 7 07:41:44 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 7 Apr 2011 07:41:44 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB04055@houex1.kindermorgan.com> The query runs OK. The number of returned records is the same as what I would call a normal query. Something like this. SELECT GroupMaster.Name, dbo_DSS_CompletionMaster.PID, ConfigMaster.WellName FROM dbo_DSS_CompletionMaster INNER JOIN (ConfigMaster INNER JOIN GroupMaster ON ConfigMaster.PID = GroupMaster.PID) ON dbo_DSS_CompletionMaster.PID = ConfigMaster.ChildPID WHERE (((GroupMaster.Name) Like "Manifold*" And (GroupMaster.Name) Not Like "*Area")); -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 06, 2011 10:40 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 7 16:47:24 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 7 Apr 2011 14:47:24 -0700 Subject: [AccessD] E Mail hyperlink In-Reply-To: <4D9C69D9.6060702@colbyconsulting.com> References: <4D9C69D9.6060702@colbyconsulting.com> Message-ID: Hello, I using Access 2003 to create a contact database. I am trying to create a field (which is currently text) in a table (or the related form) which acts as hyperlink to the email address which is typed in there for each contact. i.e. we want to be able to click on the field and have it open to new mail message. Can you tell me how to do this please? I have gotten so far as to be able to right click on the control and edit hyperlink to indicate that it is an email address, but then it wants me to type in the address. I can't do this for all 5K+. Other than just leaving the data in text and automating Outlook via vba when clicking the control.... Just seems like I should be able to do this. bob heygood From stuart at lexacorp.com.pg Thu Apr 7 17:09:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 08 Apr 2011 08:09:55 +1000 Subject: [AccessD] E Mail hyperlink In-Reply-To: References: <4D9C69D9.6060702@colbyconsulting.com>, Message-ID: <4D9E3633.21526.A28319F@stuart.lexacorp.com.pg> Sub txtEmail_DoubleClick() Docmd.SendObject vbSendNoObject,,,txtEmail,,,,,True, End Sub On 7 Apr 2011 at 14:47, b heygood wrote: > Hello, I using Access 2003 to create a contact database. I am trying > to create a field (which is currently text) in a table (or the related > form) which acts as hyperlink to the email address which is typed in > there for each contact. i.e. we want to be able to click on the field > and have it open to new mail message. Can you tell me how to do this > please? > > I have gotten so far as to be able to right click on the control and > edit hyperlink to indicate that it is an email address, but then it > wants me to type in the address. I can't do this for all 5K+. > > Other than just leaving the data in text and automating Outlook via > vba when clicking the control.... Just seems like I should be able to > do this. > > bob heygood > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Apr 7 21:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 07 Apr 2011 22:46:37 -0400 Subject: [AccessD] data validation Message-ID: <4D9E770D.5030102@colbyconsulting.com> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Apr 8 02:27:38 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 08 Apr 2011 09:27:38 +0200 Subject: [AccessD] data validation Message-ID: Hi John I think a lot depends on your user interface. We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. /gustav >>> jwcolby at colbyconsulting.com 08-04-2011 04:46 >>> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From adtp at airtelmail.in Fri Apr 8 04:06:55 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Fri, 8 Apr 2011 14:36:55 +0530 Subject: [AccessD] data validation References: <4D9E770D.5030102@colbyconsulting.com> Message-ID: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> J.C., In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). Best wishes, A.D.Tejpal ------------ Brief Description (Sample Db: DentalAppointments) ========================= This sample db demonstrates Appointments Planner for a dental clinic having two chairs. The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. Caution - (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open & use the sample db. (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. Version - Access 2000 file format Reference - DAO 3.6 ======================================= ----- Original Message ----- From: jwcolby To: Access Developers discussion and problem solving Sent: Friday, April 08, 2011 08:16 Subject: [AccessD] data validation Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 8 08:00:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:00:48 -0400 Subject: [AccessD] data validation In-Reply-To: References: Message-ID: <4D9F0700.7050109@colbyconsulting.com> Thanks Gustav. I haven't wrapped my mind around the "how to" do adjustments. The data is entered into a main form (pass request) sub form (request detail), with the request detail being a continuous form. AFAICT I can't write back to the subform controls because (AFAIK) doing so writes that value into every record. I would have to write them back to the table using SQL and then requery the subform to show the changes. An additional issue is that these forms are bound to SQL Server data through linked tables. I too am looking at using the recordset clone, however one of the issues I am trying to work around is that if I move to binding the form to an ADO recordset, then the RecordsetClone property becomes non-functional. I am going to put this in the "ToDo" file I think and get some other, less... "complicated" issues handled first. John W. Colby www.ColbyConsulting.com On 4/8/2011 3:27 AM, Gustav Brock wrote: > Hi John > > I think a lot depends on your user interface. > > We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. > If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. > > The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. > > /gustav > > >>>> jwcolby at colbyconsulting.com 08-04-2011 04:46>>> > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to > check the details against itself, with a collection to hold the time classes. Time classes have > code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > From jwcolby at colbyconsulting.com Fri Apr 8 08:21:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:21:34 -0400 Subject: [AccessD] data validation In-Reply-To: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> References: <4D9E770D.5030102@colbyconsulting.com> <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> Message-ID: <4D9F0BDE.9010700@colbyconsulting.com> Thanks A.D. These time slots are entirely determined by the user, and can be any length. Basically the user decides "I will be in this location from time X to time Y". The times have to be non-overlapping to other time slots and entirely contained within the pass request times. I actually have a function that takes a pair of data points, each data point consisting of PK, time from and time to and returns a boolean true if they collide. It was written to handle comparing two records. John W. Colby www.ColbyConsulting.com On 4/8/2011 5:06 AM, A.D. Tejpal wrote: > J.C., > > In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: > http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 > > The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. > > When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. > > You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). > > A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). > > Best wishes, > A.D.Tejpal > ------------ > > Brief Description > (Sample Db: DentalAppointments) > ========================= > This sample db demonstrates Appointments Planner for a dental clinic having two chairs. > > The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. > > If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). > > Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. > > Caution - > (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open& use the sample db. > > (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. > > Version - Access 2000 file format > > Reference - DAO 3.6 > ======================================= > > ----- Original Message ----- > From: jwcolby > To: Access Developers discussion and problem solving > Sent: Friday, April 08, 2011 08:16 > Subject: [AccessD] data validation > > > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > -- > John W. Colby > www.ColbyConsulting.com From gustav at cactus.dk Sat Apr 9 03:54:55 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 09 Apr 2011 10:54:55 +0200 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Message-ID: Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug From accessd at shaw.ca Sat Apr 9 20:35:29 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 9 Apr 2011 18:35:29 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! In-Reply-To: References: Message-ID: Hi Gustav: Thanks for posting this. There is a fix/patch for all application other than those using VBA (C++ and .Net) and having installed Windowss7 SP1. Currently there is no solution. http://support.microsoft.com/kb/2517589 This is a major major type ADO error and it may very put an end to a large project I am working on. :-( I think I am going to have a couple of beer tonight and not even think about computers...two months of work shot and no work-around. Most of my large clients (they are banks but I do not program for them just hardware) are still using XP so I am sure they are aware of this issue and how interested will they now be in considering an upgrade? Such an error would mean millions to them. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 09, 2011 1:55 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissue s/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From listmaster at databaseadvisors.com Sat Apr 9 20:50:16 2011 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sat, 9 Apr 2011 21:50:16 -0400 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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 bill_patten at embarqmail.com Sun Apr 10 01:14:18 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 9 Apr 2011 23:14:18 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Resent after meltdown. In-Reply-To: References: Message-ID: <67E0822B933B446893A4CD21E01864DF@BPCS> Thanks for the update Gustav, Finally showing that the problem effected more than dot net and 32/64 client issues helps, and had I known that 2 weeks ago would have probably saved me some time. I am lucky, I only have 2 clients using my ADP's at this time. Both are fully developed and are just in a maintenance mode so I don't have to work on them very much. The problem with both clients was solved by transferring the application to one of my XP machines, decompiling, and recompiling in the XP Machine and shipping to the clients. I still don't understand why some PC's worked and some didn't but now they all work. Since my machine caused the problem, (Win 7 64 SP1) I don't think I should bill my clients so I'm sure I can send the bill for 10 hours of trouble shooting and testing to Microsoft. Ya Think? Bill -------------------------------------------------- From: "Gustav Brock" Sent: Saturday, April 09, 2011 1:54 AM To: Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Sun Apr 10 12:39:16 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 10 Apr 2011 10:39:16 -0700 Subject: [AccessD] OT - Home networking question Message-ID: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug From accessd at shaw.ca Sun Apr 10 13:32:00 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 10 Apr 2011 11:32:00 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <188AEE9832FD4C49B6748669D96F689E@creativesystemdesigns.com> Hi Doug: Off the top, as you appears to be using a simple work-group type network, with no servers, the first things to check if a computer is not seeing the network, would be one of three items: 1. The workgroup name has to be the same on all your computers. 2. The IP range has to be the same i.e. 192.168.177.xxx where xxx is a different value for every computer on the network. (Note: the value 177 can be any number but it also must be consistent network wide) 3. The subnet mask usually defaults to 255.255.255.0...check for a key-in error. If these items are checked and are consistent then we have to look at the router configuration and whether you are using your ISP as your domain controller which will make it a whole different ball of wax. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 10:39 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Sun Apr 10 13:34:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sun, 10 Apr 2011 13:34:19 -0500 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: Download nbtscan http://www.softpedia.com/progDownload/nbtscan-Download-100891.html Rename the .exe downloaded to nbtscan.exe (get rid of the version numbers in the file name) Then, from a command prompt, run: Nbtscan 192.168.0.1-255 (where this would be if the IP of your machine is 192.168.0.x (otherwise change the first three numbers to that of your network) You'll then get a list of IP addresses on your network. However, if you actually have 3 routers plugged into the hub, you may have 3 separate routers, each with their own subnet. If the routers don't know what's on the other routers, then you may not be able to communicate between networks..... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 12:39 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Sun Apr 10 17:46:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 11 Apr 2011 08:46:38 +1000 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Mon Apr 11 11:17:08 2011 From: jedi at charm.net (Michael Bahr) Date: Mon, 11 Apr 2011 12:17:08 -0400 (EDT) Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> What Stuart suggest is a much better design. For the home, in most cases, you only need 1 router right after the modem. Then everybody else connects to the router either through wireless or switches to extend the ethernet. 1. Replace the hub with a router. 2. Replace the 3 routers (behind the hub) with switches--not hubs. Mike > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable > modem and > hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 11:27:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:27:10 -0400 Subject: [AccessD] New Language In-Reply-To: <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> Message-ID: <4DA32BDE.4020100@colbyconsulting.com> My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > From dw-murphy at cox.net Mon Apr 11 11:52:12 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 09:52:12 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <003c01cbf868$d4127de0$7c3779a0$@cox.net> Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 11:57:17 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:57:17 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> Message-ID: <4DA332ED.5040905@colbyconsulting.com> 3) Make sure your switches are gigabit! John W. Colby www.ColbyConsulting.com On 4/11/2011 12:17 PM, Michael Bahr wrote: > What Stuart suggest is a much better design. For the home, in most cases, > you only need 1 router right after the modem. Then everybody else > connects to the router either through wireless or switches to extend the > ethernet. > > 1. Replace the hub with a router. > 2. Replace the 3 routers (behind the hub) with switches--not hubs. > > Mike > >> Are you sure that your terminology if correct? >> >> It would make more sense if you has one router attached to your cable >> modem and >> hubs/switches connected to that router from the three locations. >> >> Can you give us the make/model numbers of these devices? >> >> -- >> Stuart >> >> >> On 10 Apr 2011 at 10:39, Doug Murphy wrote: >> >>> Folks, >>> >>> I know there are several members of this group who are knowledgeable >>> about computer networking. We have a network in our home/offices that >>> has evolved over time. The basic configuration is that out of our >>> cable modem there is an Ethernet hub. 3 cables come out of this hub >>> and go to routers, one in my office in one part of the house, one in >>> my wife's office, and one to our wifi. These have been added as >>> requirements came about so this probably isn't the best configuration. >>> At the present we don't use the network to access machines in other >>> parts of the system. I have several in my office that access each >>> other, but they are on the same router. I do want to stay with the >>> wired systems to the offices. We just added a home security system >>> that can be monitored over the network. It is connected to my router >>> as it is closest to the box. I can access the system by typing in it's >>> IP address. Now I am trying to access it from other points in the >>> network and the IP is not visible. As you can probably tell I am >>> network challenged. I think what I need to do is find the IP address >>> of the security system from outside my router. How can this be done? >>> >>> Thanks >>> >>> Doug >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From kismert at gmail.com Mon Apr 11 12:10:29 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 12:10:29 -0500 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] Message-ID: John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > From accessd at shaw.ca Mon Apr 11 12:32:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 10:32:07 -0700 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: Excellent summary and words (code) to live by. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Monday, April 11, 2011 10:10 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: Autonumber when?] John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 12:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 13:47:23 -0400 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: <4DA33EAB.70505@colbyconsulting.com> Ken, I understand the reasoning and all however... because the code is no longer contained within the object that needs it, you now open yourself up to the old "I need to modify this method... oops... that change breaks something else that uses the code". Class programming exists for a reason. Placing code in the object that needs the code exists for a reason. Black box programming exists for a reason. The reason in many cases is to prevent exactly this kind of interaction when we accidentally change a piece of code used in many places and break one of those places. Yes, there are instances where lots of different things need the exact same code, and yes, I have been known to call module functions from classes, but it truly is a questionable practice in most cases. John W. Colby www.ColbyConsulting.com On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > John, All: > > I'm going to expand a little on what I'm trying to get at. This post really > isn't advice on what you should do. And it certainly isn't criticism. > > I have been returning to the old Lisp idea of functional programming: > libraries of functions that act only on their inputs and only return a > result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > external variables are never referenced. If a function needs to return > complex information, it returns either a type or an object. Database > functions unavoidably have side-effects, but these are regarded as > 'external' to the code, and are explicitly documented. > > The thing that surprised me was how well libraries play with objects. > Libraries provide discrete, testable chunks of code that support any > instance. Libraries separate functions into common-sense groups. Classes > provide an instance wrapper over the libraries, stringing functions together > to support the application. > > Plus, it is pretty easy to convert classes to this scheme while maintaining > compatibility. > > The advantages became apparent when I refactored some of my early monolithic > classes. These large, 'kitchen sink' classes had dozens of methods which > mixed database, business, and application functionality. They were unwieldy, > hard-to-understand, and hard-to-extend. I simply copied the class into a > module, stripped out the instance stuff (properties and module-level > variables), and turned the methods into side-effect-free functions. I then > stripped out the code within the original class methods, turning them into > wrappers calling library functions with their instance variables. > > The result: classes become lightweight, making their functionality much more > obvious. Compatibility is maintained, but the new system is much easier to > refactor and extend. > > The class on-top-of function approach is also a good answer to those who > want to re-use your code, but can't because they need some method that is > marked private in a class. They typically demand that all methods be made > public, which is usually silly because the class designer has good reasons > for limiting the public visibility of certain methods or properties. > > But with a function library, you can have your cake and eat it, too. Classes > hold the instance information, and interact with libraries in an > instance-safe way, because the functions never modify their inputs. Others > with different needs can call the functions directly, or write their own > classes. Heck, I even find myself cramped by my own classes at times, and > having the option to call underlying functions directly has benefited me. > > Writing test code for functions is much easier than for complex class > systems. Test code provides reasonable proof of reliability. Reliable > complexity can only be built out of small, simple, understandable, and > testable pieces. > > -Ken > > >> ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Wed, 6 Apr 2011 15:13:46 -0500 >> Subject: Re: [AccessD] Autonumber when? >>> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> >> >> >> ---------- Forwarded message ---------- >> From: jwcolby >> To: Access Developers discussion and problem solving< >> accessd at databaseadvisors.com> >> Date: Wed, 06 Apr 2011 16:38:13 -0400 >> Subject: Re: [AccessD] Autonumber when? >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> From rusty.hammond at cpiqpc.com Mon Apr 11 13:00:35 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:00:35 -0500 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Mon Apr 11 13:05:06 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:05:06 -0500 Subject: [AccessD] New Language In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, that's my duh moment for the afternoon. I'll look at the msdn link below. Rusty -----Original Message----- From: Rusty Hammond Sent: Monday, April 11, 2011 1:01 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Mon Apr 11 13:45:52 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Mon, 11 Apr 2011 14:45:52 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <003c01cbf868$d4127de0$7c3779a0$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> Message-ID: <4CF42796B1DC41E2B84C92485E599533@LaptopII> Doug, No need to replace the three routers; use can use them as a hub. The trick is to disable the DNS in reach, set RIP to none, and then when you connect to the one router after the cable modem, plug the cable into the LAN port (not the WAN port as it is now). This also effectively turns a Wireless Router into a simple Wireless Access point. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 11, 2011 12:52 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 14:14:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:14:50 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3532A.9040606@colbyconsulting.com> And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From jwcolby at colbyconsulting.com Mon Apr 11 14:16:12 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:16:12 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3537C.7010509@colbyconsulting.com> Oh... some routers use 192.168.1.xx instead of 1.9.168.0.xx in which case you have to modify my previous advice to match what your router uses. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From accessd at shaw.ca Mon Apr 11 14:58:10 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 12:58:10 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> My daughters have all grown up with computers. From childhood, their rooms have been wired for computers...coax cable and all. My oldest daughter learned to type on the keyboard before she could talk. She would sit in my lap and enter the keys as I called them out. She could start up the Commodore 64 and load games from memory. My youngest daughter made her first web site when she was ten, a Sailor-moon site. ;-) At that time she used notepad to build her site and she knew more about web sites and HTML coding than I did. Today, both my daughters are married or in a long term relationship with programmers (both with a least one degree in computer science) and they all work in the business; one in computer graphic designer (and fashion design) and two in animation and one as an application developer but if pushed the girls are both pretty good programmers (At the age of 15 my oldest daughter was short-listed in a job competition and the company sent her their whole software line as a consolation...It was Blizzard software with Warcraft etc.) The one I feel sorry for is my wife Maria who totally non-computer literate and has to listen to rest of the family talk shop and coding etc. at ever family gathering. I really hope your wife likes computers. ;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 9:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 15:02:08 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 13:02:08 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA3532A.9040606@colbyconsulting.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> Message-ID: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Mon Apr 11 15:09:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 15:09:32 -0500 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: John, I understand the reasoning and all however... because the code is no longer > contained within the object that needs it, you now open yourself up to the > old "I need to modify this method... oops... that change breaks something > else that uses the code". > It is always possible to over-factor, and merge two similar pieces of code together that really should be separate. In that case, you factor the code back into multiple pieces, and correct the dependencies. > Class programming exists for a reason. Placing code in the object that > needs the code exists for a reason. Black box programming exists for a > reason. The reason in many cases is to prevent exactly this kind of > interaction when we accidentally change a piece of code used in many places > and break one of those places. > I would submit that calling side-effect free functions from a class does not pierce the black box. The important things, state and access, are protected by the class. But the function can be anywhere: built-in VBA functions, Access application methods, or DAO library calls. You undoubtedly call these functions from within your classes. > Yes, there are instances where lots of different things need the exact same > code, and yes, I have been known to call module functions from classes, but > it truly is a questionable practice in most cases. > Test cases replace questionability with a guarantee of proper function. The function shouldn't define what it does -- the test cases should. If changes to a function break a test, then you know immediately that there is a problem. Functional unit testing guards against changes that would break dependent code. I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. -Ken > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > >> John, All: >> >> I'm going to expand a little on what I'm trying to get at. This post >> really >> isn't advice on what you should do. And it certainly isn't criticism. >> >> I have been returning to the old Lisp idea of functional programming: >> libraries of functions that act only on their inputs and only return a >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> external variables are never referenced. If a function needs to return >> complex information, it returns either a type or an object. Database >> functions unavoidably have side-effects, but these are regarded as >> 'external' to the code, and are explicitly documented. >> >> The thing that surprised me was how well libraries play with objects. >> Libraries provide discrete, testable chunks of code that support any >> instance. Libraries separate functions into common-sense groups. Classes >> provide an instance wrapper over the libraries, stringing functions >> together >> to support the application. >> >> Plus, it is pretty easy to convert classes to this scheme while >> maintaining >> compatibility. >> >> The advantages became apparent when I refactored some of my early >> monolithic >> classes. These large, 'kitchen sink' classes had dozens of methods which >> mixed database, business, and application functionality. They were >> unwieldy, >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> module, stripped out the instance stuff (properties and module-level >> variables), and turned the methods into side-effect-free functions. I then >> stripped out the code within the original class methods, turning them into >> wrappers calling library functions with their instance variables. >> >> The result: classes become lightweight, making their functionality much >> more >> obvious. Compatibility is maintained, but the new system is much easier to >> refactor and extend. >> >> The class on-top-of function approach is also a good answer to those who >> want to re-use your code, but can't because they need some method that is >> marked private in a class. They typically demand that all methods be made >> public, which is usually silly because the class designer has good reasons >> for limiting the public visibility of certain methods or properties. >> >> But with a function library, you can have your cake and eat it, too. >> Classes >> hold the instance information, and interact with libraries in an >> instance-safe way, because the functions never modify their inputs. Others >> with different needs can call the functions directly, or write their own >> classes. Heck, I even find myself cramped by my own classes at times, and >> having the option to call underlying functions directly has benefited me. >> >> Writing test code for functions is much easier than for complex class >> systems. Test code provides reasonable proof of reliability. Reliable >> complexity can only be built out of small, simple, understandable, and >> testable pieces. >> >> -Ken >> >> From charlotte.foust at gmail.com Mon Apr 11 15:22:19 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 13:22:19 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: I have to say, that I would put those module level functions into a utility class and call the class method. I don't like calling module level stuff from a class. The built in things you call are already part of a library/dll so it isn't the same. Charlotte Foust On Mon, Apr 11, 2011 at 1:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. ?Placing code in the object that >> needs the code exists for a reason. ?Black box programming exists for a >> reason. ?The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. ?Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 15:25:26 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:25:26 -0400 Subject: [AccessD] New Language In-Reply-To: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> Message-ID: <4DA363B6.8000005@colbyconsulting.com> My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim From jwcolby at colbyconsulting.com Mon Apr 11 15:36:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:36:04 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA36634.3080604@colbyconsulting.com> > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object that >> needs the code exists for a reason. Black box programming exists for a >> reason. The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> From dw-murphy at cox.net Mon Apr 11 15:42:36 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 13:42:36 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <006c01cbf888$fded7730$f9c86590$@cox.net> Great info. Thanks guys. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Apr 11 16:59:04 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 01:59:04 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA36634.3080604@colbyconsulting.com> References: <4DA36634.3080604@colbyconsulting.com> Message-ID: <85CF23CEAE904982B6ED4556F847CB7B@nant> <<< I doubt seriously that anyone uses your paradigm in .net. >>> http://fsharp.net ? -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 12 ?????? 2011 ?. 0:36 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no > longer >> contained within the object that needs it, you now open yourself up >> to the old "I need to modify this method... oops... that change >> breaks something else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object >> that needs the code exists for a reason. Black box programming >> exists for a reason. The reason in many cases is to prevent exactly >> this kind of interaction when we accidentally change a piece of code >> used in many places and break one of those places. >> > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > >> Yes, there are instances where lots of different things need the >> exact same code, and yes, I have been known to call module functions >> from classes, but it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really isn't advice on what you should do. And it certainly isn't >>> criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return >>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>> modified, and external variables are never referenced. If a function >>> needs to return complex information, it returns either a type or an >>> object. Database functions unavoidably have side-effects, but these >>> are regarded as 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. >>> Classes provide an instance wrapper over the libraries, stringing >>> functions together to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic classes. These large, 'kitchen sink' classes had dozens >>> of methods which mixed database, business, and application >>> functionality. They were unwieldy, hard-to-understand, and >>> hard-to-extend. I simply copied the class into a module, stripped >>> out the instance stuff (properties and module-level variables), and >>> turned the methods into side-effect-free functions. I then stripped >>> out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality >>> much more obvious. Compatibility is maintained, but the new system >>> is much easier to refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those >>> who want to re-use your code, but can't because they need some >>> method that is marked private in a class. They typically demand that >>> all methods be made public, which is usually silly because the class >>> designer has good reasons for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. >>> Others with different needs can call the functions directly, or >>> write their own classes. Heck, I even find myself cramped by my own >>> classes at times, and having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex >>> class systems. Test code provides reasonable proof of reliability. >>> Reliable complexity can only be built out of small, simple, >>> understandable, and testable pieces. >>> >>> -Ken >>> >>> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 17:07:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 15:07:07 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA363B6.8000005@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> Message-ID: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> It sounds like your daughter has a very rare disease and her life will be very challenged. It does appear that she is growing up in the best environment and will be able to reach her full potential. It seems that she has achieved a great deal and has an almost gifted ability with computers. Your little scientist sounds like he is off to a great start and with you as his father his success is assured. Now I had better watch out for the Off Topic police...;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Mon Apr 11 18:35:02 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 12 Apr 2011 09:35:02 +1000 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <201104112335.p3BNZAnu007707@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Hi John, My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. good luck John, keep keeping us informed on your progress here. regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 12 April 2011 2:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From BradM at blackforestltd.com Mon Apr 11 20:04:51 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Mon, 11 Apr 2011 20:04:51 -0500 Subject: [AccessD] New Language References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Mon Apr 11 20:17:17 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 18:17:17 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no "module", > though there can be static classes / functions. ?I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Apr 11 21:39:31 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 19:39:31 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <000301cbf8ba$d9f66440$8de32cc0$@cox.net> Thanks all. A few of your suggested tweaks and all is good. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 00:58:20 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 09:58:20 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA36634.3080604@colbyconsulting.com><85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: Hi Charlotte -- No, wait - in fact VB.NET and C# do support first-order functional programming paradigms (LINQ and related stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html And here they say that MS Excel is a kind of functional programming environment http://en.wikipedia.org/wiki/Functional_programming So you should know and use them for quite some time already - foundations of functional programming paradigm... :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 12 ?????? 2011 ?. 5:17 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no > "module", though there can be static classes / functions. ?I haven't > done a poll, but I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you >> factor the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and >> access, are protected by the class. But the function can be anywhere: >> built-in VBA functions, Access application methods, or DAO library >> calls. You undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test >> cases should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This >>>> post really isn't advice on what you should do. And it certainly >>>> isn't criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only >>>> return a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a >>>> function needs to return complex information, it returns either a >>>> type or an object. Database functions unavoidably have >>>> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support >>>> any instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to >>>> those who want to re-use your code, but can't because they need >>>> some method that is marked private in a class. They typically >>>> demand that all methods be made public, which is usually silly >>>> because the class designer has good reasons for limiting the public >>>> visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying >>>> functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> From jwcolby at colbyconsulting.com Tue Apr 12 05:18:31 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:18:31 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: <4DA426F7.7000803@colbyconsulting.com> Well, now we are all happy! ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 5:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net.>>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? Everything is an object. There is no "module", > though there can be static classes / functions. I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. Placing code in the object >>> that needs the code exists for a reason. Black box programming >>> exists for a reason. The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 12 05:50:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:50:28 -0400 Subject: [AccessD] New Language In-Reply-To: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> Message-ID: <4DA42E74.6040007@colbyconsulting.com> > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim From jwcolby at colbyconsulting.com Tue Apr 12 08:03:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 09:03:11 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA44D8F.7060106@colbyconsulting.com> I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... From jimdettman at verizon.net Tue Apr 12 09:09:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 12 Apr 2011 10:09:29 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA44D8F.7060106@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rusty.hammond at cpiqpc.com Tue Apr 12 09:15:00 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 12 Apr 2011 09:15:00 -0500 Subject: [AccessD] New Language In-Reply-To: References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14E@CPIEMAIL-EVS1.CPIQPC.NET> Thanks Brad. That looks promising. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Monday, April 11, 2011 8:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Tue Apr 12 09:54:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 10:54:11 -0400 Subject: [AccessD] New Language In-Reply-To: <201104112335.p3BNZAnu007707@databaseadvisors.com> References: <201104112335.p3BNZAnu007707@databaseadvisors.com> Message-ID: <4DA46793.6090507@colbyconsulting.com> from http://en.wikipedia.org/wiki/BASIC The eight design principles of BASIC were: 1. Be easy for beginners to use. 2. Be a general-purpose programming language. 3. Allow advanced features to be added for experts (while keeping the language simple for beginners). 4. Be interactive. 5. Provide clear and friendly error messages. 6. Respond quickly for small programs. 7. Not to require an understanding of computer hardware. 8. Shield the user from the operating system. There are phases in learning to program. 0) Selecting a learning tool 1) learning programming concepts, keywords and constructs (loops / tests) 2) coming up with an idea of something to program 3) selecting a tool to implement the idea 4) Learning the tool 5) Implementing that idea 6) Go to 1 Whether or not basic will be around in the future it is a good language for starting to learn to program. IMHO, more than anything else, the programming environment and specifically the ease or difficulty of use of that environment determines the success of learning to program. Access and VBA is certainly not the easiest to use environment, but it is still very easy. Creating a database is easy. Creating a new module is easy. Creating a form and button and text box is easy. You can progress one step at a time. 1) Here is how to build a database container. 2) Here is how to create a module and save it 3) Here is how to open that module and add a function 4) Here is the debug window - how to execute that method and see a result. etc. The advantage of starting in Access is that while you are at it, you're teaching the concepts in a real life environment, which has enormous power to "go to the next step" particular in database applications. 5) here is how to create a table (and what a table is) 6) Fields 7) open and enter data (cool, the data is stored!) All tightly integrated. 8) Here is a form and a button. 9) here is the code that runs when the button is clicked. easy to move on to more stuff, interesting stuff, stuff that can earn Dad money... ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 7:35 PM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > Hi John, > > My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. > > good luck John, keep keeping us informed on your progress here. > > regards > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, 12 April 2011 2:27 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My 10 year old son is independently and without prompting asking dad to teach him how to program a > computer. :) > > It appears that he has decided that what dad does is pretty cool. > > Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. > IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute > code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things > like a simple "add two numbers" first project. > > Does anyone want to share "teaching the kids" stories? > > John W. Colby > www.ColbyConsulting.com > > On 3/25/2011 5:41 PM, Stuart McLachlan wrote: >> For all you people who are looking at moving away from Acces who want something easy to >> use and are wedded to the .Net world, MS have just the thing for you: >> >> http://msdn.microsoft.com/en-us/beginner/ff384126.aspx >> >> :-) >> >> >> From bheygood at abestsystems.com Tue Apr 12 10:34:43 2011 From: bheygood at abestsystems.com (b heygood) Date: Tue, 12 Apr 2011 08:34:43 -0700 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: <669B553C66A64AB6924FBE3758A17756@Seven> thanks for all your work. bob heygood -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Saturday, April 09, 2011 6:50 PM To: administrivia at databaseadvisors.com Subject: [AccessD] Administrivia - DBA Server Downtime Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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!" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Tue Apr 12 10:38:39 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 10:38:39 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: >Charlotte Foust: > I have to say, that I would put those module level functions into a > utility class and call the class method. I don't like calling module > level stuff from a class. The built in things you call are already > part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is > no "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses > your paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support first-order > functional programming paradigms (LINQ and related stuff...) > http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional > programming environment > http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > John, > > I understand the reasoning and all however... because the code is no longer > > contained within the object that needs it, you now open yourself up to > the > > old "I need to modify this method... oops... that change breaks something > > else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object that > > needs the code exists for a reason. Black box programming exists for a > > reason. The reason in many cases is to prevent exactly this kind of > > interaction when we accidentally change a piece of code used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class does > not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call > these > functions from within your classes. > > > > Yes, there are instances where lots of different things need the exact > same > > code, and yes, I have been known to call module functions from classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This post > >> really > >> isn't advice on what you should do. And it certainly isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only return a > >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > >> external variables are never referenced. If a function needs to return > >> complex information, it returns either a type or an object. Database > >> functions unavoidably have side-effects, but these are regarded as > >> 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support any > >> instance. Libraries separate functions into common-sense groups. Classes > >> provide an instance wrapper over the libraries, stringing functions > >> together > >> to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining > >> compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic > >> classes. These large, 'kitchen sink' classes had dozens of methods which > >> mixed database, business, and application functionality. They were > >> unwieldy, > >> hard-to-understand, and hard-to-extend. I simply copied the class into a > >> module, stripped out the instance stuff (properties and module-level > >> variables), and turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality much > >> more > >> obvious. Compatibility is maintained, but the new system is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to those who > >> want to re-use your code, but can't because they need some method that > is > >> marked private in a class. They typically demand that all methods be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write their own > >> classes. Heck, I even find myself cramped by my own classes at times, > and > >> having the option to call underlying functions directly has benefited > me. > >> > >> Writing test code for functions is much easier than for complex class > >> systems. Test code provides reasonable proof of reliability. Reliable > >> complexity can only be built out of small, simple, understandable, and > >> testable pieces. > >> > >> -Ken > From jwcolby at colbyconsulting.com Tue Apr 12 11:03:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 12:03:54 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA477EA.3010002@colbyconsulting.com> My question is, why do regression testing if we never regress? I write these functions and they are done. They work or they don't. We are currently testing them manually. Take the flag class, dead simple. It reads / writes to SQL server or it doesn't. We test the flag by actually using it and watching that the flag sets. It works, it is used forever. That is a simple example but the concept extends. It is not that we do not test, we do but once these functions work we are not modifying them. Actually in fact, we do paradigm changes (code functions custom written to read / write the flags in SQL Server to a flag class), but even here, the new flag class entirely replaces a couple of dozen functions, each of which wrote one flag. I would like to stress that it is not testing that I question, it is not unit testing that I question, it is when and where it might be applied, and when and where it is more trouble than it is worth. John W. Colby www.ColbyConsulting.com On 4/12/2011 10:09 AM, Jim Dettman wrote: > John, > > If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > For example, I develop a customer class, which handles CRUD operations for > customers. > > As result, I would develop four separate basic unit tests for that object: > > 1. Adding a record. > 2. Deleting a record. > 3. Reading a record. > 4. Updating a record. > > Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. A function > can be made to accept > args and return a value and never modify anything external to itself. It > would make programming > some functionality much more complicated however. Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. The > process builds that. No flag > is used, we just ask SQL server whether the objects exist and create them if > not. When we *fill* > that table, a piece of SQL code executed in a function. That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. *IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. The function itself does not modify the parameters passed > in. It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. I went to a > great deal of effort to get all of this stuff working this way. I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. I am not sitting at a desk collecting a paycheck regardless of what > I produce. I do not > have a test department, I am the test department. I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... From accessd at shaw.ca Tue Apr 12 12:39:27 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 10:39:27 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA42E74.6040007@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> <4DA42E74.6040007@colbyconsulting.com> Message-ID: Wasn't it Henry Fonda that said, and allow me to paraphrase, "The most successful people are either very smart or very nice." I wish you daughter well. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 3:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 12:54:27 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 21:54:27 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Hi Ken -- <<< VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. >>> Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) has limited capabilities - the issue is that VBA implementation (within MS Office) is "crappy"... I mean that when one tries to go to use advanced VBA features, which should work by definition, they get all kinds of "blues" - and MS answer is that VBA wasn't intended to be used like that... And when everything is done within VBA (syntax and semantics) why there should be any mentioning of any programmers'/developers' intentions which go beyond VBA capabilities? That "limited capability by implementation" was the main reason I did mainly quit VBA development ... <<< The Lisp idea of closures is fundamental to getting JavaScript to do lots of useful things. >>> I have read/learned LISP in theory quite some time ago - and I must note I'm ignorant in this area... Yes, JavaScript is a great programming language - I'm (trying) to get it mastered now (OO JavaScript) - and I really like it... And the paradox is that JavaScript isn't an Object Oriented language but how powerful and flexible it's to simulate all/most of OOP concepts... <<< If a block of code doesn't require state, why should it be in a class? >>> OOP IMO is more useful/natural way to design and to develop software solutions simulating real world "objects" behaviors... Yes, the more loosely coupled and the less stateful one gets their classes designed the more they look like just "standard" modules with functions... (This World is dual isn't it?)... <<< F# is one of the most interesting .NET languages for me. >>> Yes, it looks interesting here too but I doubt I will have an opportunity to learn and to use it in the near future... But who knows how it all will evolve... <<< You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. >>> I'm not sure how do you use VBA in TDD - could you please elaborate a bit more on this subject here? Do you have your custom VBA TDD framework? Or you just develop and use special test VBA modules/functions and call that stuff TDD? That's OK with me - I'm just wondering what practice is behind your VBA TDD terminology... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 12 ?????? 2011 ?. 19:39 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] >Charlotte Foust: > I have to say, that I would put those module level functions into a >utility class and call the class method. I don't like calling module >level stuff from a class. The built in things you call are already >part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is no > "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses your > paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support > first-order functional programming paradigms (LINQ and related > stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional programming > environment http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, > > I understand the reasoning and all however... because the code is no > longer > > contained within the object that needs it, you now open yourself up > > to > the > > old "I need to modify this method... oops... that change breaks > > something else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object > > that needs the code exists for a reason. Black box programming > > exists for a reason. The reason in many cases is to prevent exactly > > this kind of interaction when we accidentally change a piece of code > > used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > > > Yes, there are instances where lots of different things need the > > exact > same > > code, and yes, I have been known to call module functions from > > classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This > >> post really isn't advice on what you should do. And it certainly > >> isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only > >> return a result. The goal is 'side-effect-free' -- inputs are NEVER > >> modified, and external variables are never referenced. If a > >> function needs to return complex information, it returns either a > >> type or an object. Database functions unavoidably have > >> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support > >> any instance. Libraries separate functions into common-sense > >> groups. Classes provide an instance wrapper over the libraries, > >> stringing functions together to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic classes. These large, 'kitchen sink' classes had dozens > >> of methods which mixed database, business, and application > >> functionality. They were unwieldy, hard-to-understand, and > >> hard-to-extend. I simply copied the class into a module, stripped > >> out the instance stuff (properties and module-level variables), and > >> turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning > >> them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality > >> much more obvious. Compatibility is maintained, but the new system > >> is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to > >> those who want to re-use your code, but can't because they need > >> some method that > is > >> marked private in a class. They typically demand that all methods > >> be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write > >> their own classes. Heck, I even find myself cramped by my own > >> classes at times, > and > >> having the option to call underlying functions directly has > >> benefited > me. > >> > >> Writing test code for functions is much easier than for complex > >> class systems. Test code provides reasonable proof of reliability. > >> Reliable complexity can only be built out of small, simple, > >> understandable, and testable pieces. > >> > >> -Ken > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 13:02:26 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 22:02:26 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: Hi Jim -- <<< As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. >>> That would be called "integration tests" wouldn't they? That above is a bit "provocative" question I must admit to "fire" new here (?) Unit testing vs. Integration testing vs. Regression testing vs. ... testing Great Debate :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: 12 ?????? 2011 ?. 18:09 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up >> to the >> old "I need to modify this method... oops... that change breaks >> something else that uses the code". ... From kismert at gmail.com Tue Apr 12 15:11:57 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:11:57 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken From charlotte.foust at gmail.com Tue Apr 12 15:22:00 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 12 Apr 2011 13:22:00 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: NUnit testing is a learning experience in itself. Many of the basic tests can be scripted, which my previous employer finally did. However, the business rules tests needed to be hand written, and they largely dispensed with them, which didn't make a lot of sense to me. Every time a new rule was created, all the test would be run again just to be sure nothing got knocked sideways in the process. It is an incredible tool in .Net. Wish it were/had been available in Access. Charlotte Foust On Tue, Apr 12, 2011 at 7:09 AM, Jim Dettman wrote: > John, > > ?If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > ?As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > ?For example, I develop a customer class, which handles CRUD operations for > customers. > > ?As result, I would develop four separate basic unit tests for that object: > > ?1. Adding a record. > ?2. Deleting a record. > ?3. Reading a record. > ?4. Updating a record. > > ?Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > ?So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". ?OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. ?If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. ?To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. ?A function > can be made to accept > args and return a value and never modify anything external to itself. ?It > would make programming > some functionality much more complicated however. ?Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). ?Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". ?The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". ?It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. ?So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. ?Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. ?The > process builds that. ?No flag > is used, we just ask SQL server whether the objects exist and create them if > not. ?When we *fill* > that table, a piece of SQL code executed in a function. ?That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. ?*IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. ?The function itself does not modify the parameters passed > in. ?It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. ?There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? ?Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. ?I went to a > great deal of effort to get all of this stuff working this way. ?I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. ?They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". ?I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... ?This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ?;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. ?I am not sitting at a desk collecting a paycheck regardless of what > I produce. ?I do not > have a test department, I am the test department. ?I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kismert at gmail.com Tue Apr 12 15:48:47 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:48:47 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Let me give some examples of how I use function libraries, which might help illustrate what I'm talking about. Example 1: Factoring a Monolithic Business Class ======================================= I had a class, that I will call CPart, that had dozens and dozens of functions for dealing with parts. I had methods like CPart.Read and CPart.Save, with a CPart.Part property that I set before reading or saving a part. All was good until I got into situations where I just wanted to read an arbitrary part, without upsetting all of the delicate state that had built up for the 'Current' part. Yes, I could have created another instance of CPart, but it was monolithic, and represented the current (complex) state of the application, which seemed like a lot of effort just to read a part. So, for my first (bad) fix, I made optional parameters, like CPart.Read(Optional vPart As Variant), with internal code: If IsMissing(vPart) Then ' use member variable mvPart Else ' use given vPart End If ' specific code to read part ... Yes, my class inevitably got peppered with these optional parameters and If constructs, which started getting in the way of what the class was really trying to do, added extra complexity, and made it harder to debug and understand. During refactoring, I realized how I could simplify things: I built a module called MPart, with a function PartRead that took a required vPart parameter and returned a part structure or an error. The CPart methods lost their optional parameters and all the If statement nonsense, and the Part method's internal code reduced down to: tPart = MPart.PartRead(mvPart). External code could just call MPart.PartRead directly, without having to bother with creating and initializing a temporary CPart instance. Simplicity, readability, and testability improved all around. CPart shrank dramatically, making it easier to factor in the future. Example 2: Topical Function Libraries ============================= Over time, I have built up quite a few specialized modules for dealing with standard things in standard ways. For instance, MArray deals with arrays. MCollection holds very useful functions for Collections, similarly MString for strings and MVariant for variants. There are also more specialized libraries, like MMD5 for md5 hashes, and MMJD for Modified Julian Dates. There are lots of application-specific function libraries like MPart as well. These module functions have replaced sometimes a dozen half-assed and inconsistently written variations on a theme with one well-tested and thought-through piece of code that is portable among all of my applications. Moving standard code to a new application often reveals unknown weaknesses, which when fixed, strengthen the code for all applications. I find this to be a profitable way to bring consistency, flexibility and stability to my coding efforts. -Ken From accessd at shaw.ca Tue Apr 12 16:16:33 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:16:33 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <528397A8E9B14C68B8F6ACE8E43D0F39@creativesystemdesigns.com> The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking togther applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes closed...in another 5 years...maybe. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Apr 12 16:22:32 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:22:32 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <1E56BD82BB8A46A5A1A19FAB77E0B0C4@creativesystemdesigns.com> Sorry about the previous post but I was typing too fast and hit the mouse pad with the heel of my palm and the post was on it way. The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking together applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes (nearly) closed...in another 5 years...maybe. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 12 21:12:35 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 22:12:35 -0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <4DA50693.1040907@colbyconsulting.com> Ken, This stuff is all C# / SQL Server (and a Virtual Machine running a third party app) and is not the same as my framework in Access. This thing is really a custom written application specific to the needs of a single client. I wrote it and have re-factored it a couple of times as my knowledge increased in C#. It is slowly turning into an impressive system. I really wrote it because I was doing everything manually and it was a PITA, error prone (because it was all manual) and just plain not fun! The more I automated the process, the more the client was impressed. To this day the client really has no idea what what the system looks like or how it really works. He is in New York and I am in NC, and he basically has no knowledge of what is involved to do this stuff. He has his business, and I have mine - which is to make his business hum. What impresses him is that he knows (because I billed him for the hours) that doing an order used to take two days for the simplest order. Now it takes well under a day and for simple orders it can be done in a few hours. He used to send me count requests and it used to take an hour and it was a big enough pain that I might not get the results back to him until the next day. Now I get the count order and I can get the results back to him in 5-10 minutes if I can give it my immediate attention. I now have a program where I select a CSV file containing zips and the program does the counts, I press a button and the counts are pasted into an email and emailed off to him (and CC myself). So while he can't see the system (or understand it if he could) he can *feel* the system. I didn't do this to impress the customer I did this to keep the customer and to save my sanity. I now have nine lists which total about 350 million names, and I really need to process every list every month. I can only process 2 million names at a time through the third party software and each chunk takes about 50 minutes average. That's 175 chunks * 50 minutes of processing monthly - 146 hours of computer time every month. To do this stuff "manually" took me 2-3 times that long I am finally getting to the point where the system can do all of that unattended. And... I can process orders on-the-fly and they will break into the queue and jump to the head of the processing line. I'm here to tell you I could not do that manually, and if I were able to the customer would not be willing to pay me the hours required to do that. It really is an impressive system and it has been written (evolved really) starting somewhere around December 2009, so about 16 months, and I was learning C# as I went, which explains much of the refactoring. Now I finally get to relax a little bit and enjoy the fruits of my labor. John W. Colby www.ColbyConsulting.com On 4/12/2011 4:11 PM, Kenneth Ismert wrote: > All, > >> jwcolby: >> ... >> But in general the class functions are only used in the class. A function >> can be made to accept args and return a value and never modify anything >> external to itself. It would make programming some functionality much more >> complicated however. Let's take an example. ... >> > > You have a very impressive system with a lot of capability. But frameworks > have their own inertia: for all that they do, they unquestionably limit your > choices and reduce your options for their sheer bulk. I have wrestled with > this in building my own frameworks, and have entirely dismissed third party > frameworks (Symphony comes to mind) for the thunderous overhead they impose. From shamil at smsconsulting.spb.ru Wed Apr 13 08:24:42 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 17:24:42 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <7732C63F31AF47ADA03F1D17DE33837F@nant> Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 13 08:59:27 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 13 Apr 2011 09:59:27 -0400 Subject: [AccessD] mscomctl In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA5AC3F.4060602@colbyconsulting.com> I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com From phpons at gmail.com Wed Apr 13 09:27:35 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 16:27:35 +0200 Subject: [AccessD] How to hide info within a db? Message-ID: Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS From edzedz at comcast.net Wed Apr 13 09:38:47 2011 From: edzedz at comcast.net (Edward Zuris) Date: Wed, 13 Apr 2011 08:38:47 -0600 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <000001cbf9e8$802246d0$5bdea8c0@edz1> Thanks for the information. I was thinking of getting that book. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 7:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Wed Apr 13 10:11:51 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Wed, 13 Apr 2011 10:11:51 -0500 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> There is no encryption available at the table level. However, there are a few things that can be done to hide information... although if a person is a good VBA / Access programmer they could get around them. Creating an encrypted version does nothing to hide the data if one chooses to link or import tables. 1. Hiding the table is the first step... I might consider pending the table with "USys" to signify the table is a user system table. That hides the table unless the user unhides it in the parameters. 2. Roll your own encryption to the field. I call it encryption, but actually all you can do is store the data in Unicode using the StrConv function. When a user attempts to view the data in the table view, all they see is the first character of the field. If you change the field's input mask to password then the length of the field is seen but the number of characters represents the number of bytes in Unicode. For example: Social Security Numbers are nine digits in length, but in Unicode its stored as 18. Just make sure the field's length is long enough to store the extra digits. If they click into the field only one asterisk is seen. They can't copy or paste the data either. Of course this requires that you "encrypt" and "decrypt" each time you need to use the data. One more caveat... a person who sees the asterisk or the one character in length to be able decrypt the field they need to first realize HOW it was modified. 3. In Access 2007, create a ACCDE file. This locks everything down and enables the code to run faster. After the file is created... change the extension to ACCDR. This tells Access it's a runtime version. If someone tries to link or import tables from a runtime version, the file does not show BUT they could paste the name of the file into the dialog box and then it can be linked or imported. I do all three, although my table is not a system table. To the inexperienced or the casual user, these are adequate to keep the information safe. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 9:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Wed Apr 13 10:17:56 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 13 Apr 2011 11:17:56 -0400 Subject: [AccessD] mscomctl In-Reply-To: <4DA5AC3F.4060602@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> <4DA5AC3F.4060602@colbyconsulting.com> Message-ID: <6D90731D044D4616A0CBB207291B4C5C@Gateway> Usually, just regsvr32 "fullpath_in_quotes" Can be done in bat, but may need permissions. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 13, 2011 9:59 AM To: Access Developers discussion and problem solving Subject: [AccessD] mscomctl I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 13 11:01:11 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 09:01:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Keep in mind that I come from a .Net world where everything is an object, so I learned to deal with that orientation. Once you get accustomed to that, it makes sense to do it that way. It's all black boxes. Charlotte Foust On Tue, Apr 12, 2011 at 8:38 AM, Kenneth Ismert wrote: >>Charlotte Foust: >> I have to say, that I would put those module level functions into a >> utility class and call the class method. ?I don't like calling module >> level stuff from a class. ?The built in things you call are already >> part of a library/dll so it isn't the same. > > But if they are just utility functions, why go through the effort of > instantiating a class, when you can just call it directly in a module? If a > block of code doesn't require state, why should it be in a class? > > As long as you write side-effect-free functions, you can write libraries > that work just as well as the built-in stuff. > >> jwcolby: >> Do you program in .Net? ?Everything is an object. ?There is >> no "module", though there can be static classes / functions. >> I haven't done a poll, but I doubt seriously that anyone uses >> your paradigm in .net. > > Static classes would work just fine for function libraries -- they meet the > criteria of being globally available, and not requiring instantiation. You > can use Namespaces to group and name function libraries, as well. > >> Shamil Salakhetdinov >> http://fsharp.net ? > > F# is one of the most interesting .NET languages for me. I dabbled with > Nemerle years ago, which had all kinds of Lispy features, but it doesn't > seem to be very actively developed now. > >> No, wait - in fact VB.NET and C# do support first-order >> functional programming paradigms (LINQ and related stuff...) >> http://www.info.ucl.ac.be/~pvr/paradigms.html >> And here they say that MS Excel is a kind of functional >> programming environment >> http://en.wikipedia.org/wiki/Functional_programming >> So you should know and use them for quite some time already - >> foundations of functional programming paradigm... ?:) > > Having functions as first-class data types (like strings, doubles, etc) > turns out to be very handy. > The Lisp idea of closures is fundamental to getting Javascript to do lots of > useful things. > Test-driven programming comes from loosely-typed languages like Lisp and > Python. It is a way to define and enforce function, just contracts in > Eiffel. > > VBA is not a very capable language, but you can directly use most of these > ideas, and approximate and simulate others in a more-or-less satisfactory > way. > > You can treat VBA as a loosely-typed, partly functional, test-driven > programming language, and get tangible benefits. > > -Ken > > > ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Mon, 11 Apr 2011 15:09:32 -0500 >> Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 >> John, >> >> I understand the reasoning and all however... because the code is no longer >> > contained within the object that needs it, you now open yourself up to >> the >> > old "I need to modify this method... oops... that change breaks something >> > else that uses the code". >> > >> >> It is always possible to over-factor, and merge two similar pieces of code >> together that really should be separate. In that case, you factor the code >> back into multiple pieces, and correct the dependencies. >> >> >> > Class programming exists for a reason. ?Placing code in the object that >> > needs the code exists for a reason. ?Black box programming exists for a >> > reason. ?The reason in many cases is to prevent exactly this kind of >> > interaction when we accidentally change a piece of code used in many >> places >> > and break one of those places. >> > >> >> I would submit that calling side-effect free functions from a class does >> not >> pierce the black box. The important things, state and access, are protected >> by the class. But the function can be anywhere: built-in VBA functions, >> Access application methods, or DAO library calls. You undoubtedly call >> these >> functions from within your classes. >> >> >> > Yes, there are instances where lots of different things need the exact >> same >> > code, and yes, I have been known to call module functions from classes, >> but >> > it truly is a questionable practice in most cases. >> > >> >> Test cases replace questionability with a guarantee of proper function. The >> function shouldn't define what it does -- the test cases should. If changes >> to a function break a test, then you know immediately that there is a >> problem. Functional unit testing guards against changes that would break >> dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted and >> tested module-level functions. >> >> -Ken >> >> >> > >> > John W. Colby >> > www.ColbyConsulting.com >> > >> > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> > >> >> John, All: >> >> >> >> I'm going to expand a little on what I'm trying to get at. This post >> >> really >> >> isn't advice on what you should do. And it certainly isn't criticism. >> >> >> >> I have been returning to the old Lisp idea of functional programming: >> >> libraries of functions that act only on their inputs and only return a >> >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> >> external variables are never referenced. If a function needs to return >> >> complex information, it returns either a type or an object. Database >> >> functions unavoidably have side-effects, but these are regarded as >> >> 'external' to the code, and are explicitly documented. >> >> >> >> The thing that surprised me was how well libraries play with objects. >> >> Libraries provide discrete, testable chunks of code that support any >> >> instance. Libraries separate functions into common-sense groups. Classes >> >> provide an instance wrapper over the libraries, stringing functions >> >> together >> >> to support the application. >> >> >> >> Plus, it is pretty easy to convert classes to this scheme while >> >> maintaining >> >> compatibility. >> >> >> >> The advantages became apparent when I refactored some of my early >> >> monolithic >> >> classes. These large, 'kitchen sink' classes had dozens of methods which >> >> mixed database, business, and application functionality. They were >> >> unwieldy, >> >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> >> module, stripped out the instance stuff (properties and module-level >> >> variables), and turned the methods into side-effect-free functions. I >> then >> >> stripped out the code within the original class methods, turning them >> into >> >> wrappers calling library functions with their instance variables. >> >> >> >> The result: classes become lightweight, making their functionality much >> >> more >> >> obvious. Compatibility is maintained, but the new system is much easier >> to >> >> refactor and extend. >> >> >> >> The class on-top-of function approach is also a good answer to those who >> >> want to re-use your code, but can't because they need some method that >> is >> >> marked private in a class. They typically demand that all methods be >> made >> >> public, which is usually silly because the class designer has good >> reasons >> >> for limiting the public visibility of certain methods or properties. >> >> >> >> But with a function library, you can have your cake and eat it, too. >> >> Classes >> >> hold the instance information, and interact with libraries in an >> >> instance-safe way, because the functions never modify their inputs. >> Others >> >> with different needs can call the functions directly, or write their own >> >> classes. Heck, I even find myself cramped by my own classes at times, >> and >> >> having the option to call underlying functions directly has benefited >> me. >> >> >> >> Writing test code for functions is much easier than for complex class >> >> systems. Test code provides reasonable proof of reliability. ?Reliable >> >> complexity can only be built out of small, simple, understandable, and >> >> testable pieces. >> >> >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Wed Apr 13 13:19:12 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 20:19:12 +0200 Subject: [AccessD] How to hide info within a db? In-Reply-To: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> References: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> Message-ID: Thank's a lot, Jim, I will try to use you advice. Philippe 2011/4/13 jm.hwsn > There is no encryption available at the table level. > However, there are a few things that can be done to hide information... > although if a person is a good VBA / Access programmer they could get > around > them. Creating an encrypted version does nothing to hide the data if one > chooses to link or import tables. > > 1. Hiding the table is the first step... I might consider pending the > table > with "USys" to signify the table is a user system table. That hides the > table unless the user unhides it in the parameters. > > 2. Roll your own encryption to the field. I call it encryption, but > actually all you can do is store the data in Unicode using the StrConv > function. When a user attempts to view the data in the table view, all > they > see is the first character of the field. If you change the field's input > mask to password then the length of the field is seen but the number of > characters represents the number of bytes in Unicode. For example: Social > Security Numbers are nine digits in length, but in Unicode its stored as > 18. > Just make sure the field's length is long enough to store the extra digits. > If they click into the field only one asterisk is seen. They can't copy or > paste the data either. Of course this requires that you "encrypt" and > "decrypt" each time you need to use the data. One more caveat... a person > who sees the asterisk or the one character in length to be able decrypt the > field they need to first realize HOW it was modified. > > 3. In Access 2007, create a ACCDE file. This locks everything down and > enables the code to run faster. After the file is created... change the > extension to ACCDR. This tells Access it's a runtime version. If someone > tries to link or import tables from a runtime version, the file does not > show BUT they could paste the name of the file into the dialog box and then > it can be linked or imported. > > I do all three, although my table is not a system table. To the > inexperienced or the casual user, these are adequate to keep the > information > safe. > > HTH > Jim > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Wednesday, April 13, 2011 9:28 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] How to hide info within a db? > > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Wed Apr 13 13:37:11 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Wed, 13 Apr 2011 11:37:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <004701cbfa09$cd8869b0$68993d10$@cox.net> Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code > which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 14:02:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 05:02:02 +1000 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4DA5F32A.1919.28625544@stuart.lexacorp.com.pg> Jim has aleady given you some ideas, but there other options depending on exactly what it is you want to hide. How much information? What type of information? Under what cirucmstances? i.e when does it need to hidden and when does it need to be visible? There are a number of simple and resaonable secure encrytion routines you can use when you save/retreive data which just rely on a password which you can have the user enter when they open the application. -- Stuart On 13 Apr 2011 at 16:27, philippe pons wrote: > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 14:22:52 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 14:22:52 -0500 Subject: [AccessD] Dir command trouble Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> I am running the following code to get a list of file folders. All it returns is an empty string. What might I be missing? Sub FileFolderLIst() Dim FileFolder As Variant strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, vbDirectory) End Sub Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From shamil at smsconsulting.spb.ru Wed Apr 13 14:35:07 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 23:35:07 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <004701cbfa09$cd8869b0$68993d10$@cox.net> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> <004701cbfa09$cd8869b0$68993d10$@cox.net> Message-ID: Hi Doug, Not at all - in fact that was Ken who posted that link here: <<< Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: 13 ?????? 2011 ?. 22:37 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, <<< skip>>> Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. <<< skip >>> -Ken -- From kismert at gmail.com Wed Apr 13 14:45:56 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 13 Apr 2011 14:45:56 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: > Charlotte Foust: > Keep in mind that I come from a .Net world where everything is an > object, so I learned to deal with that orientation. Once you get > accustomed to that, it makes sense to do it that way. It's all black > boxes. > One of my points is that you don't have to think about programming constructs in the terms that their designers intended. If, in C#, you have a static class with all public methods, no properties, and no member variables, then it is a 'function library', for all intents and purposes. Write your methods so that they are side-effect free, and you are an instant functional programmer. VBA has no static classes. But, VBA modules allow properties and member variables, so all you have to do is hack in some initialization code, and voila, a VBA 'static class'. If you aren't proud about the 'purity' of the solution, (and trust me, I am not proud), you can approximate a lot of programming concepts the language wasn't intended to support. -Ken From stuart at lexacorp.com.pg Wed Apr 13 15:15:58 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:15:58 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> Message-ID: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:24:23 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:24:23 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> I found my mistake just as you responded. A one character error in the path name. Thanks for the assistance. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:29:42 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:29:42 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> Message-ID: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:34:35 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:34:35 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Problem found! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:43:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:43:18 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Message-ID: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> PEBCAK :-) On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > Problem found! > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > "Pablic" ? :-) > > -- > Stuart > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > I found my mistake just as you responded. A one character error in > > the path name. Thanks for the assistance. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > It works for me on "C:\" > > > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > Dim strPathname As String > > strPathname = "C:\" > > FileFolder = Dir(strPathname) > > FileFolder = Dir(strPathname, vbDirectory) > > Debug.Print FileFolder > > End Sub > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > *only* list the directories rather all files as well. > > > > Sub Test() > > Dim MyPath As String > > Dim MyName As String > > MyPath = "c:\" ' Set the path. > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > While MyName <> "" ' Start the loop. > > ' Ignore the current directory and the encompassing directory. > > If MyName <> "." And MyName <> ".." Then > > ' Use bitwise comparison to make sure MyName is a directory. > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > Then > > Debug.Print MyName ' Display entry only if it > > End If ' it represents a directory. > > End If > > MyName = Dir ' Get next entry. > > Loop > > End Sub > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > I am running the following code to get a list of file folders. All > > > it returns is an empty string. What might I be missing? > > > > > > Sub FileFolderLIst() > > > > > > Dim FileFolder As Variant > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > vbDirectory) > > > > > > End Sub > > > > > > > > > Chester Kaup > > > Engineering Technician > > > Kinder Morgan CO2 Company, LLP > > > Office (432) 688-3797 > > > FAX (432) 688-3799 > > > > > > ? > > > No trees were killed in the sending of this message. However a > > > large number of electrons were terribly inconvenienced. > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Wed Apr 13 15:46:23 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 13 Apr 2011 13:46:23 -0700 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> Message-ID: I hate it when that happens! :) On Wed, Apr 13, 2011 at 1:43 PM, Stuart McLachlan wrote: > PEBCAK :-) > > On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > > > Problem found! > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > "Pablic" ? :-) > > > > -- > > Stuart > > > > > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > > > I found my mistake just as you responded. A one character error in > > > the path name. Thanks for the assistance. > > > > > > -----Original Message----- > > > From: accessd-bounces at databaseadvisors.com > > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > > command trouble > > > > > > It works for me on "C:\" > > > > > > Sub FileFolderLIst() > > > Dim FileFolder As Variant > > > Dim strPathname As String > > > strPathname = "C:\" > > > FileFolder = Dir(strPathname) > > > FileFolder = Dir(strPathname, vbDirectory) > > > Debug.Print FileFolder > > > End Sub > > > > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > > *only* list the directories rather all files as well. > > > > > > Sub Test() > > > Dim MyPath As String > > > Dim MyName As String > > > MyPath = "c:\" ' Set the path. > > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > > While MyName <> "" ' Start the loop. > > > ' Ignore the current directory and the encompassing directory. > > > If MyName <> "." And MyName <> ".." Then > > > ' Use bitwise comparison to make sure MyName is a directory. > > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > > Then > > > Debug.Print MyName ' Display entry only if it > > > End If ' it represents a directory. > > > End If > > > MyName = Dir ' Get next entry. > > > Loop > > > End Sub > > > > > > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > > > I am running the following code to get a list of file folders. All > > > > it returns is an empty string. What might I be missing? > > > > > > > > Sub FileFolderLIst() > > > > > > > > Dim FileFolder As Variant > > > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > > vbDirectory) > > > > > > > > End Sub > > > > > > > > > > > > Chester Kaup > > > > Engineering Technician > > > > Kinder Morgan CO2 Company, LLP > > > > Office (432) 688-3797 > > > > FAX (432) 688-3799 > > > > > > > > > > > > No trees were killed in the sending of this message. However a > > > > large number of electrons were terribly inconvenienced. > > > > > > > > > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Wed Apr 13 17:22:27 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 17:22:27 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Wed Apr 13 18:05:57 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 16:05:57 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheid at sc.rr.com Wed Apr 13 19:04:56 2011 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 13 Apr 2011 20:04:56 -0400 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <000301cbfa37$97917a30$c6b46e90$@rr.com> Philippe, If this is data, and it is important that it not be read, I would encrypt it. Not sure how you would do it in Access (probably some API), but in .Net Framework, there are library functions to do this. Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 10:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Wed Apr 13 19:58:30 2011 From: df.waters at comcast.net (Dan Waters) Date: Wed, 13 Apr 2011 19:58:30 -0500 Subject: [AccessD] FE's Disconnecting from BE Message-ID: <004301cbfa3f$12cd7710$38686530$@comcast.net> At just one of my customers, we've recently had the experience where the FE files have all, at the same time, had one or more table links disconnect from the BE file, and then all the table links reconnected no more than 15 minutes later. As far as we know, there was no human intervention. A Disk or Network Error was recorded by the FE in the GlobalErrors table with is in the BE file, so this table link did not disconnect. The network setup is a little complex - they use a Storage Area Network (SAN) with multiple disks, virtual server (VMWare), and Citrix. The system is 3 - 6 times slower with data intensive activity compared to my other customers using a LAN and a physical server. Anyone have any ideas on a cause, what I can monitor, or what I could do? Thanks! Dan From accessd at shaw.ca Wed Apr 13 21:05:58 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 13 Apr 2011 19:05:58 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Apr 13 22:45:55 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:45:55 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Wed Apr 13 22:49:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:49:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Does it affect anything other than Reflection? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 13, 2011 6:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Wed Apr 13 23:55:38 2011 From: rockysmolin at bchacc.com (rockysmolin at bchacc.com) Date: Wed, 13 Apr 2011 21:55:38 -0700 Subject: [AccessD] New Language Message-ID: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Thu Apr 14 00:36:21 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 22:36:21 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). ?Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. ?So here is what I stumbled on. ?I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ?The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Thu Apr 14 00:44:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 00:44:08 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Ok, thanks. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 12:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or >> thinking about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', >> to retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I >> could find, to do this, was to put in extra code into a class module >> to create a 'Properties' Property. ?In fact, I had written an Add-on >> in VB6 that did this for me (created a properties property). ?Put a >> LOT of extra code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the >> Reflection Library. ?So here is what I stumbled on. ?I was all >> excited to use the Reflection library on a particalur class where I >> needed to dynamically list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ? >> The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting >> at all of my properties...until I figured out that some were >> properties some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From accessd at shaw.ca Thu Apr 14 02:02:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 00:02:38 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: <7DEDE1F783024A28A3C5D53E63803261@creativesystemdesigns.com> Hi Drew: OK... Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 8:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 14 04:39:03 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:39:03 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C0B7.9070509@colbyconsulting.com> Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. From jwcolby at colbyconsulting.com Thu Apr 14 04:42:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:42:48 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C198.7060305@colbyconsulting.com> > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From Gustav at cactus.dk Thu Apr 14 05:27:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 14 Apr 2011 12:27:05 +0200 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. From jwcolby at colbyconsulting.com Thu Apr 14 07:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 08:47:23 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6ECDB.2020702@colbyconsulting.com> LOL. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. Whatever. Why doesn't he do that to start with? Class public fields exist for a reason. http://www.codinghorror.com/blog/2006/08/properties-vs-public-variables.html Read down through the comments. Like everything else programming, there are very opinionated people on both sides of the isle. But notice that *referencing* code breakage is very real. Kind of like natural vs surrogate keys, you can get away with either... until you can't! And when you can't you have created problems for yourself that you never would have had had you just "done it right" to start with. John W. Colby www.ColbyConsulting.com On 4/14/2011 6:27 AM, Gustav Brock wrote: > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39>>> > > I understand that you are a lazy programmer .. > > From kismert at gmail.com Thu Apr 14 10:17:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Thu, 14 Apr 2011 10:17:32 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: Speaking of Unit-testing, I bumped into this: http://cobra-language.com/ Cobra is a .NET/Mono language, with language constructs that directly support: * Contracts * Unit-testing * Lambdas and closures * Doc strings * Mixins and extensions Familiar .NET features like Generics are there, and it plays nice with C# and VB.NET, too. It offers the clean syntax and convenience of Ruby or Python, but provides strong compile-time checking, and compiled performance. -Ken From accessd at shaw.ca Thu Apr 14 11:38:24 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 09:38:24 -0700 Subject: [AccessD] New Language In-Reply-To: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Message-ID: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 12:16:41 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 10:16:41 -0700 Subject: [AccessD] New Language In-Reply-To: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Message-ID: Noah recommends starting with Java. Says LUA data types are confusing and Java is more structured and object oriented. Debugging is harder in LUA as well. I'll see if I can post a video of the competition they did at the regionals. I have it - just have to figure out how and where to post. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 9:38 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] New Language Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 14 13:01:00 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:01:00 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C0B7.9070509@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: Wow... a little snarky today, are we? Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, both were considered properties... and that isn't me 'protesting till the cows come home', it's how it is. If it's not, if you can show me some documentation that refers to 'Public SomeVariable As String' as being a FIELD in VB 6, I will gladly apologize and bow to your superior knowledge. ;) As for the lazy programmer comment..... who's the one that uses the 'canned' bound format? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:03:01 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:03:01 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C198.7060305@colbyconsulting.com> References: <4DA6C198.7060305@colbyconsulting.com> Message-ID: Man, did I piss in your wheaties or something? Programming style, safety of my code? Wow, you like kicking dirt.... be careful there buddy.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:43 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:04:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:04:19 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: No, I hand code the properties... I encapsulate my data tables in classes that handle the data the way I want it handled. Directly linking tables to user 'visible' controls is the lazy and dangerous way to do things.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, April 14, 2011 5:27 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Thu Apr 14 13:16:22 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Thu, 14 Apr 2011 11:16:22 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Thu Apr 14 13:20:38 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Thu, 14 Apr 2011 13:20:38 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From DWUTKA at Marlow.com Thu Apr 14 13:55:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:55:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Nah, this is like two geeks arguing over who is faster, Superman or the Flash. Just break out the popcorn. ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:57:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:57:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> References: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: And we can send them to camp JWC, to be trained by the Fuhrer himself! 'You call that code?' 'It's sloppy, lazy!' 'Wrap that simple class field in 100 lines of code!' 'Drop and give me 300 lines of error handling! On the double!' ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rusty Hammond Sent: Thursday, April 14, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 14 14:26:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 15:26:37 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: <4DA74A6D.7000706@colbyconsulting.com> LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. From DWUTKA at Marlow.com Thu Apr 14 14:43:23 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 14:43:23 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA74A6D.7000706@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: Well VBA is a subset of VB 6. Can you show me any documentation where it defines a Public statement as setting a 'field' to a class, versus Property statement setting a property, in VBA? When in the IDE, if you have Public MyValue or Property Get MyOther value, both will show up with the same 'property' icon in the IDE. No declaration that 'MyValue' (in this case) is a 'field' in the Object browser. In .Net, it DOES have a different icon in the IDE. Fields and Properties are given completely different icons in autosensing drop downs. It makes a clear distinction. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 2:27 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 15:04:47 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 13:04:47 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky From DWUTKA at Marlow.com Thu Apr 14 15:20:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 15:20:08 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 16:20:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:20:26 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <03E535F8605A444BA1A55E3B9B4D1058@HAL9005> Client found these links: http://en.kioskea.net/forum/affich-26059-rename-file-with-datetime-appended- to-filenam http://www.computing.net/answers/dos/can-a-batch-file-get-a-files-datetime-s tamp/318.html Reminds me of how much stuff we used to do with batch files. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 14, 2011 1:20 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 16:35:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:35:49 -0700 Subject: [AccessD] 2010 Version Message-ID: Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From garykjos at gmail.com Thu Apr 14 16:43:15 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 16:43:15 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From BradM at blackforestltd.com Thu Apr 14 16:43:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Thu, 14 Apr 2011 16:43:22 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From accessd at shaw.ca Thu Apr 14 16:44:28 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 14:44:28 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Thu Apr 14 16:54:25 2011 From: df.waters at comcast.net (Dan Waters) Date: Thu, 14 Apr 2011 16:54:25 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <003f01cbfaee$85bd3080$91379180$@comcast.net> Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Apr 14 16:55:14 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 14 Apr 2011 14:55:14 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Thu Apr 14 17:47:34 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:47:34 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:19 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:45 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:45 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> Message-ID: <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 2:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:50:18 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:50:18 -0700 Subject: [AccessD] 2010 Version In-Reply-To: <003f01cbfaee$85bd3080$91379180$@comcast.net> References: <003f01cbfaee$85bd3080$91379180$@comcast.net> Message-ID: <0A5CEF40B05C4D5D9E0F77A5CAAAAB5E@HAL9005> Good thinkin'. Covers me for the rest of my life. Or the product 's life. Of course, that's assuming that DoCmd.ShowToolbar "Ribbon", acToolbarNo works so well and is so bulletproof that MS will feel compelled to replace it with something else we'll have to learn. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Thursday, April 14, 2011 2:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:51:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:51:26 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <20E088CEE08447F1BEB51DD59AB3EAE9@HAL9005> Dunno. If it happened more than three weeks ago, it's gone from my cache. But, law of averages says, I got it from this list. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 14, 2011 2:55 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Thu Apr 14 17:59:01 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 17:59:01 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From Darryl.Collins at iag.com.au Thu Apr 14 19:26:56 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:26:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150027.p3F0R3lU012257@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hahaha, reminds me of the logic when you are using code to write from Access to Excel. Used to be 5.0 (has been for years - ie Excel 5.0;HDR=YES;IMEX=2;DATABASE=etc...). Now XL2007+ is being used you have use Excel 8.0 or it fails. Now neither of those numbers align with the XL versions being used. And what happened to 6 & 7? Logically you would think, "ok change it to 6". I am not really asking, I am sure if I Google it hard enough I could find out for myself. It is just one of those things that trip you up when you least expected it and the obvious answer is the wrong one. :) fun stuff. Just having a cheap and quiet little rant over here... cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, 15 April 2011 8:48 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Darryl.Collins at iag.com.au Thu Apr 14 19:27:55 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:27:55 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150028.p3F0S1RN012807@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ and yet it was still cursed... Guess you cannot escape ya fate ;) -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, 15 April 2011 8:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Thu Apr 14 22:40:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 15 Apr 2011 13:40:24 +1000 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DA7BE28.31054.5F4DF65@stuart.lexacorp.com.pg> Not file renaming :-( -- Stuart On 14 Apr 2011 at 15:20, Drew Wutka wrote: > Not sure about xcopy, but robocopy has that kind of ability. Robocopy > used to be only available the extra resources CD you had to buy > separately, but it's included in Windows 7 now. > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers > discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp > to xcopy target > > Dear List: > > Client wants to do regular backup to his EHD using Windows Scheduler. > He's almost there but has a question: > > The following in a batch file seems to work for backing up > DocketWorks: > > > > xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" > > > > Do you know if there is some way to append a date time stamp to it so > it does not always overwrite the previous backup? > > Anyone know? > > > > TIA > > > > Rocky > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for > the person or entity to which it is addressed and may contain II-VI > Proprietary and/or II-VI Business Sensitive material. If you are not > the intended recipient, please contact the sender immediately and > destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended > recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Fri Apr 15 03:33:33 2011 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 15 Apr 2011 10:33:33 +0200 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim From jwcolby at colbyconsulting.com Fri Apr 15 07:43:58 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 08:43:58 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: <4DA83D8E.5020106@colbyconsulting.com> Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if you > have Public MyValue or Property Get MyOther value, both will show up > with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew From shamil at smsconsulting.spb.ru Fri Apr 15 09:26:41 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 18:26:41 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 10:05:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:05:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: LOL.... what a long winded way of saying 'No, it's not documented, it's my personal definition'. Your view here is based on a granular perspective of VB6 (remember, we are talking about VBA and VB6 here, there is a CLEAR defined difference between a Field and a Property in .Net). You are looking at the definition of a property from INSIDE the class. If you take a more bird's eye view of class a property is a value. A class is an object. Regardless of what each individual line of code within a class module says, a class is an object defined and structured to represent something. A Function is set of instructions that you start with a call. A Class is an object, that you create, mold, store, manipulate, etc. With this type of view, it is irrelevant as to whether a property is defined with a Public statement or a property statement, it is still a 'property' of a class. If you were to build a 'Rubber Ball' class, and gave it a Color property, from the outside world (to the class), the property is a value that can be set or retrieved (or one or the other). The outside world, to the class, doesn't care how it is defined. .Net makes a distinction, in documentation and intellisense. But Property is a keyword and Field is not. But back to VBA and VB6, let's go even more granular then your view here. What is the machine code difference between: Public MyValue as string And Property Get MyValue() as String MyValue=strValue End Property Property Let MyValue(strEnter as String) strValue=strEnter End Property ??? Do you think that thep code, when this is compiled, is doing anything different? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 7:44 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Fri Apr 15 10:08:21 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:08:21 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com><4DA83D8E.5020106@colbyconsulting.com> Message-ID: Bingo, you said it better though... thanks! Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, April 15, 2011 9:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jedi at charm.net Fri Apr 15 11:10:26 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 15 Apr 2011 12:10:26 -0400 (EDT) Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> You forgot Preparation H. Mike > They took off a year? (Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Fri Apr 15 14:26:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 15:26:20 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA89BDC.4020409@colbyconsulting.com> So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com On 4/15/2011 10:26 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Public class modules variables are implemented in VB6 and VBA the same way > as properties IOW they have the same programmatic interface from VB6/VBA > (and COM) internals point of view. - this is what Drew has been telling > about here... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 15 ?????? 2011 ?. 16:44 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a property > is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns a > value. It has a keyword in the VB language. It can run any amount of code > inside of the "function", and do anything that is legal for a function to do > including dimensioning, reading and writing other variables, running loops, > doing if then / select case etc., reading and writing to the disk, > downloading files from the internet, formatting your hard disk... you name > it. > > A property is a function. It happens to be targeted to wrapping variables > and exposing them to the outside world but that is not all it can do. A > property does not *define* the variable, that is done in the dimension > statement. A property does not "own" the variable that it wraps, it is > simply > *returning* the variable. A property does not have any data storage area on > the heap unless it happens to dimension its own variables inside of the > property, and even then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved area > of memory on the heap sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a property is and what a variable is. How can you > possibly expect them to be or work the same. They are different things > entirely. The fact that the IDE displays the same icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the language, I > just look at what things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > > On 4/14/2011 3:43 PM, Drew Wutka wrote: >> Well VBA is a subset of VB 6. Can you show me any documentation where >> it defines a Public statement as setting a 'field' to a class, versus >> Property statement setting a property, in VBA? When in the IDE, if >> you have Public MyValue or Property Get MyOther value, both will show >> up with the same 'property' icon in the IDE. No declaration that > 'MyValue' >> (in this case) is a 'field' in the Object browser. >> >> In .Net, it DOES have a different icon in the IDE. Fields and >> Properties are given completely different icons in autosensing drop >> downs. It makes a clear distinction. >> >> Drew > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From shamil at smsconsulting.spb.ru Fri Apr 15 14:54:31 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 23:54:31 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <3870F1BDA6774925B9CD59D1B66F5C3F@nant> Hi John -- <<< Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not >>> But they are the same from *technical* (VBA/VB6/COM) point of view - that is what Drew is telling... IOW: they are looking the same for outer world. Drew doesn't care about their internal implementation or high level concepts... Nobody argues here when one or another coding style/approach should be used or that one is better than another one because of ... OA: They are the same from *technical* point of view/perspective of VBA/VB6/COM. Try the following VBA/VB6 code: ------------- cut here ----- ' class MyClass Public MyTestVar As String Private m_myTestVar2 As String Property Get MyTestVar2() As String MyTestVar2 = m_myTestVar2 End Property Property Let MyTestVar2(ByVal v As String) m_myTestVar2 = v End Property ------------- cut here ----- ' standard module - MyTestModule Public Sub MyTest() Dim c As MyClass Set c = New MyClass Dim result As String CallByName c, "MyTestVar", VbLet, "MyTestValue" result = CallByName(c, "MyTestVar", VbGet) Debug.Print "Result from public variable = " + result CallByName c, "MyTestVar2", VbLet, "MyTestValue2" result = CallByName(c, "MyTestVar2", VbGet) Debug.Print "Result from public variable2 = " + result End Sub ------------- cut here ----- Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 23:26 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Apr 15 15:11:48 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 15:11:48 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: Boy John, you don't read anything I wrote. The entire point was about a difference between .Net and VB6/VBA. No point in explaining further, your soapbox is above the level I care to engage at. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 2:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Apr 15 15:18:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 16:18:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8A816.9000705@colbyconsulting.com> Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com On 4/15/2011 11:05 AM, Drew Wutka wrote: > LOL.... what a long winded way of saying 'No, it's not documented, it's > my personal definition'. > > Your view here is based on a granular perspective of VB6 (remember, we > are talking about VBA and VB6 here, there is a CLEAR defined difference > between a Field and a Property in .Net). You are looking at the > definition of a property from INSIDE the class. If you take a more > bird's eye view of class a property is a value. A class is an object. > Regardless of what each individual line of code within a class module > says, a class is an object defined and structured to represent > something. A Function is set of instructions that you start with a > call. A Class is an object, that you create, mold, store, manipulate, > etc. > > With this type of view, it is irrelevant as to whether a property is > defined with a Public statement or a property statement, it is still a > 'property' of a class. If you were to build a 'Rubber Ball' class, and > gave it a Color property, from the outside world (to the class), the > property is a value that can be set or retrieved (or one or the other). > The outside world, to the class, doesn't care how it is defined. > > .Net makes a distinction, in documentation and intellisense. But > Property is a keyword and Field is not. > > But back to VBA and VB6, let's go even more granular then your view > here. > > What is the machine code difference between: > > Public MyValue as string > > And > > Property Get MyValue() as String > MyValue=strValue > End Property > Property Let MyValue(strEnter as String) > strValue=strEnter > End Property > > ??? Do you think that thep code, when this is compiled, is doing > anything different? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 7:44 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a > property is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns > a value. It has a keyword > in the VB language. It can run any amount of code inside of the > "function", and do anything that is > legal for a function to do including dimensioning, reading and writing > other variables, running > loops, doing if then / select case etc., reading and writing to the > disk, downloading files from the > internet, formatting your hard disk... you name it. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the > outside world but that is not all it can do. A property does not > *define* the variable, that is > done in the dimension statement. A property does not "own" the variable > that it wraps, it is simply > *returning* the variable. A property does not have any data storage > area on the heap unless it > happens to dimension its own variables inside of the property, and even > then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap > sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a > property is and what a variable is. How can you possibly expect them to > be or work the same. They > are different things entirely. The fact that the IDE displays the same > icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the > language, I just look at what > things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From rockysmolin at bchacc.com Fri Apr 15 15:30:27 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 15 Apr 2011 13:30:27 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target + New Language In-Reply-To: References: Message-ID: <9DC7EA07277745B39387C0607ACA09F4@HAL9005> John: I gave the task to Noah - he knows batch files. Told him $25. He's learned a bit more about batch files a lot more about testing, communicating with the user, and reworking based on finding out 'what they really want'. Between that, the $15 he got for recycling bottles, and his allowance, he's having a really good day. :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 15, 2011 1:34 AM To: accessd at databaseadvisors.com; accessd at shaw.ca Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 16:09:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 16:09:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: Actually John, now that you've come down a bit on your soapbox, I will try to clarify for you. As a VB/VBA programmer, nothing I ever read about VB referred to 'Public SomeValue as string' as a FIELD. In fact, it was always referred to it as a PROPERTY of a class object. I have ASKED if you have any supporting documentation, like some Microsoft white paper, or something I should have read when becoming proficient in VB(6/VBA), where I would have learned that the correct term for 'Public SomeValue As SomeType' in a VB/VBA class module was FIELD. I can show you PLENTY of documentation where the reverse is the case. http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual Basic Concepts / Customizing Form Classes' Straight out of the MSDN, when talking about Class modules in VB6. It refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public Comment As String' as 'click on it to play back its Comment PROPERTY'. Or how about: http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual Basic Concepts / Class Module Step by Step'. You won't find the WORD 'field' on that page, and it refers to 'Public Name As String' AS A PROPERTY. Straight from the designers of VB 6's mouth, JWC. Now admittedly, I'm only bringing MSDN articles into the fray. I'm not taking your approach, that you've been programming since you built THE FIRST Antikythera mechanism, so what you say is how it is. To begin with, you are absolutely, 100% incorrect in stating that there is ANY difference in performance OR FUNCTIONALITY between: Public MyValue as String And Dim strMyValue as string Property Get MyValue() As String MyValue=strMyValue End Property Property Let MyValue(strEnter As String) strMyValue=strEnter End Property The only difference above is that one uses 1 line of code, the other uses 7 lines of code, in the source code. That is it. When you express what else you can do with Get/Let statements, you are going OUTSIDE the scope of declaring what a BASIC property is. Yes, you can put error handling into the statements above, but that changes the strictest definition of a 'SIMPLE' property. You can add extra arguments, logic, processes, etc. All going OUTSIDE of the definition of a 'simple property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 liner property, and converting it until actual Get and Let statements (or Set) for more functionality down the road. In .Net, there IS a problem, because if you are using Reflection, the Field is now a Property (in .Net terms), so it will be in a different collection in Reflection. Back to my original point, to this thread, I have been using .Net for about a year now, since I was out of the development world for a while. I have only recently had a reason to use Reflection, which I stumbled on, because as a VB 6 Programmer, there WAS no distinction between property declaration types like there is in .Net. I am not complaining that there is a difference, in fact, it is quite handy to have two separate Reflection collections to use. I was simply stating that it was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or are just crossing the bridge into the .Net world. Like saying that there is no more Variant variable type. Would you like to give us a tirade about how Variant types never truly existed, and how I personally will never understand that concept? Seriously John, you need to read more than a few lines of my posts. A lot of what you have said makes you sound like an a$$, not as a skilled professional. My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 3:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Fri Apr 15 17:33:59 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:33:59 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Sorry, I can't agree with you there. A METHOD is a function. A PROPERTY is the external name given to a variable which is encapsulated in the class. i.e. for all intents and purposes outside of the object, it IS the variable. "PROPERTY SET" and "PROPERTY GET" are methods. The fact that you can also perform other actions when you SET a variable is irrelevant. You should be doing what it is saying and setting the value of the variable. When you GET it, you should be retrieving the value of the variable. Wiile it is possible to create SET/GET functions for a property so that GET doesn't return what is SET, it is a gross abuse of the whole Object concept. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the outside world but that is not all > it can do. A property does not *define* the variable, that is done in > the dimension statement. A property does not "own" the variable that > it wraps, it is simply *returning* the variable. A property does not > have any data storage area on the heap unless it happens to dimension > its own variables inside of the property, and even then (except for > strings and statics) most variables inside of functions are stored on > the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap sized to accept a specific data type. > From jwcolby at colbyconsulting.com Fri Apr 15 17:37:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 18:37:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8C8AA.6000102@colbyconsulting.com> >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From stuart at lexacorp.com.pg Fri Apr 15 17:38:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:38:02 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: , , <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > From stuart at lexacorp.com.pg Fri Apr 15 17:48:25 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:48:25 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> The problem as I see it is that "Public fields" are an abomination. Because Java has then, .Net has to as well :-( You should not be able to accept any "properties" of an object other than through GET/SET processes. -- Stuart On 15 Apr 2011 at 16:18, jwcolby wrote: > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" which absolutely one of many English > language (and programming) definitions of property. > > You have already told us (as have I) that a public field and a > property (keyword / function) behave differently. > > The problem is yours not mine. I understand and use your definition > in the same way you do. I do not expect a public field to behave in > the same way that a property (keyword / function) does because they > are fundamentally different things. Personally I do not call a public > field a property, I call it a public field (in programmer speak), > though of course it is a property in English language speak. > > You no longer expect them to behave the same because you have > discovered that they are fundamentally different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and moan that they behave differently. To > which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > From jwcolby at colbyconsulting.com Fri Apr 15 18:28:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:28:47 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> References: , , <4DA83D8E.5020106@colbyconsulting.com> <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Message-ID: <4DA8D4AF.8050107@colbyconsulting.com> >> A PROPERTY is the external name given to a variable which is encapsulated in the class. LOL, absolutely and unequivocally not true. It is the name of some data value associated with or encapsulated by the class but it is simply *not* always and necessarily a variable. Nor is it an invalid use of a property if it is not a wrapped variable! There are properties that do not even reference a variable at all and they are perfectly valid uses of property. I can take three booleans and return a true of all are true (and I do exactly that in one of my properties). It is a property (English definition) that the class is stopped when three child classes are all stopped. The child objects use threads and write to a status control on a form. I cannot (don't want to) close the form until they are all stopped - their threads are no longer running. The form asks the manager if it is stopped when I try to close the form. It does so by checking the boolean stopped property of the manager. The boolean stopped property (get) asks the child objects if they are stopped and returns a true if all three are true else returns a false. It is not wrapping a variable, you can't set the stop variable, there isn't one. It is a valid property however. I can take 16 booleans and "translate them" into an integer value from 0 to 16 if that is what I need to do. A property (English) is a data value, but it is not necessarily a stored value and in fact it is quite often a calculated value. The fact that you personally say that is bad practice doesn't impress me. If I use the property to calculate a state (data item) of the class that is a property (English) of the class the same as your stored value is. I understand perfectly well that a property is not a function (or method) but it has more properties (English) of a function than a variable - public or otherwise. I used "function with quotes at the start of the thread to clearly denote that a property was not a function. However a property (keyword) is a call. It pushes the current address pointer on the stack. A property set (or let) pushes the value on the stack. Inside of the property other lines of code can and do run. A property does not inherently have any storage. They can do anything that is logical for a property to do. When it returns it's value (if a get) is placed on the stack and it unwinds the stack. Sounds much more "function" than a dimensioned variable. Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > Sorry, I can't agree with you there. > > A METHOD is a function. > > A PROPERTY is the external name given to a variable which is encapsulated in the class. > i.e. for all intents and purposes outside of the object, it IS the variable. > > "PROPERTY SET" and "PROPERTY GET" are methods. > > The fact that you can also perform other actions when you SET a variable is irrelevant. You > should be doing what it is saying and setting the value of the variable. When you GET it, you > should be retrieving the value of the variable. > > Wiile it is possible to create SET/GET functions for a property so that GET doesn't return > what is SET, it is a gross abuse of the whole Object concept. From jwcolby at colbyconsulting.com Fri Apr 15 18:29:09 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:09 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: <4DA8D4C5.8000902@colbyconsulting.com> Nonsense. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:38 PM, Stuart McLachlan wrote: > That is a gross abuse of the whole Object paradigm. > > On 15 Apr 2011 at 15:26, jwcolby wrote: > >> I have had properties which did not wrap a variable at all. >> > > From jwcolby at colbyconsulting.com Fri Apr 15 18:29:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:50 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> References: , , <4DA8A816.9000705@colbyconsulting.com> <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> Message-ID: <4DA8D4EE.80503@colbyconsulting.com> Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > From davidmcafee at gmail.com Fri Apr 15 18:35:38 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 15 Apr 2011 16:35:38 -0700 Subject: [AccessD] is this date affected? Message-ID: I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From vbacreations at gmail.com Fri Apr 15 19:15:04 2011 From: vbacreations at gmail.com (William Benson) Date: Fri, 15 Apr 2011 20:15:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> Message-ID: Dumb question maybe... but have you tested that code in anything earlier than 2007?? I would think that the intrinsic constant is not recognized.... maybe compatibility mode handles...? On Apr 15, 2011 11:11 AM, "Michael Bahr" wrote: > You forgot Preparation H. > > Mike > >> They took off a year? (Whatever happened to Preparations A through G?) >> >> R >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos >> Sent: Thursday, April 14, 2011 2:43 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] 2010 Version >> >> 14 is the magic number >> >> http://en.wikipedia.org/wiki/Microsoft_Access >> >> GK >> >> On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin >> wrote: >>> Dear List: >>> >>> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >>> using: >>> >>> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >>> acToolbarNo >>> >>> If I want to check for 2010, what version number should I use? >>> >>> MTIA >>> >>> >>> Rocky Smolin >>> >>> Beach Access Software >>> >>> 858-259-4334 >>> >>> Skype: rocky.smolin >>> >>> www.e-z-mrp.com >>> >>> www.bchacc.com >>> >>> >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> Gary Kjos >> garykjos at gmail.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 15 19:15:20 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:15:20 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. There, that's fixed it :-) -- Stuart On 15 Apr 2011 at 19:28, jwcolby wrote: > >> A PROPERTY is the external name given to a variable which is > encapsulated in the class. > > > LOL, absolutely and unequivocally not true. It is the name of some > data value associated with or encapsulated by the class but it is > simply *not* always and necessarily a variable. Nor is it an invalid > use of a property if it is not a wrapped variable! > > There are properties that do not even reference a variable at all and > they are perfectly valid uses of property. I can take three booleans > and return a true of all are true (and I do exactly that in one of my > properties). It is a property (English definition) that the class is > stopped when three child classes are all stopped. The child objects > use threads and write to a status control on a form. I cannot (don't > want to) close the form until they are all stopped - their threads are > no longer running. > > The form asks the manager if it is stopped when I try to close the > form. It does so by checking the boolean stopped property of the > manager. The boolean stopped property (get) asks the child objects if > they are stopped and returns a true if all three are true else returns > a false. > > It is not wrapping a variable, you can't set the stop variable, there > isn't one. It is a valid property however. > > I can take 16 booleans and "translate them" into an integer value from > 0 to 16 if that is what I need to do. A property (English) is a data > value, but it is not necessarily a stored value and in fact it is > quite often a calculated value. The fact that you personally say that > is bad practice doesn't impress me. If I use the property to > calculate a state (data item) of the class that is a property > (English) of the class the same as your stored value is. > > I understand perfectly well that a property is not a function (or > method) but it has more properties (English) of a function than a > variable - public or otherwise. I used "function with quotes at the > start of the thread to clearly denote that a property was not a > function. > > However a property (keyword) is a call. It pushes the current address > pointer on the stack. A property set (or let) pushes the value on the > stack. Inside of the property other lines of code can and do run. A > property does not inherently have any storage. They can do anything > that is logical for a property to do. > > When it returns it's value (if a get) is placed on the stack and it > unwinds the stack. > > Sounds much more "function" than a dimensioned variable. > > Drew mentioned my "soap box". I do not have a soap box, I am simply > insisting that we acknowledge the facts. I have no idea what goes on > in VB6 because I do not use it. However I have used a class or two > (or three maybe?) in Access so I do understand VBA. Obviously Drew is > a better (and wittier) programmer than I but let's attempt to > understand (and discuss so others can understand) what these things > are, what they do and when we are using an English definition and when > we are using a keyword, and when we are just using a vague kinda sorta > definition. > > And when we are using an object. A property is also often an object > in OO environments. > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > > Sorry, I can't agree with you there. > > > > A METHOD is a function. > > > > A PROPERTY is the external name given to a variable which is > > encapsulated in the class. i.e. for all intents and purposes outside > > of the object, it IS the variable. > > > > "PROPERTY SET" and "PROPERTY GET" are methods. > > > > The fact that you can also perform other actions when you SET a > > variable is irrelevant. You should be doing what it is saying and > > setting the value of the variable. When you GET it, you should be > > retrieving the value of the variable. > > > > Wiile it is possible to create SET/GET functions for a property so > > that GET doesn't return what is SET, it is a gross abuse of the > > whole Object concept. > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 15 19:50:56 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:50:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net>, Message-ID: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Application.Version has been around for a long time. That code certainly works in A2K3. It does nothing. because Application.Version = 11. I use it for frequently for mdbs that are runnning in a mixed environment (A2K3 and A2007). On 15 Apr 2011 at 20:15, William Benson wrote: > Dumb question maybe... but have you tested that code in anything > earlier than 2007?? I would think that the intrinsic constant is not > recognized.... maybe compatibility mode handles...? ... > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo From jwcolby at colbyconsulting.com Fri Apr 15 21:47:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 22:47:06 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> Message-ID: <4DA9032A.1060304@colbyconsulting.com> > OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. Why do you insist on tying it to at least one variable? It isn't. I have a flag class (in C#). When that class instantiates, the constructor is fed a table, field and PK of a specific record and promptly loads the contents of that field into a variable. The variable may be a date (when an event occurred) or an integer (one means that process occurred, a zero means that process has not occurred). That class has a boolean which can be read or set. If it is set true, the property sets the variable "behind the scene" to either now() or 1 depending on the kind of flag it is. Additionally the property set causes a function to execute which dynamically constructs a sql statement and writes the date or integer into SQL Server. When you read the variable it returns the value associated with that flag, which is really a field in SQL server. So the property is boolean, but the actual variable read / written can be either a date or an integer. The property causes a fair bit of code to run which "interprets" something and returns a true / false. In fact if I so desired I could make the "variable" the actual data in the field in the specific record in SQL Server. This property exposes the boolean through a property (keyword) and that property is exposed to internal code of the parent object so that the parent object can read / write flags from SQL Server in a logical and consistent manner. I could, if I so desired, cause the property to read a serial port and return a value on a strain gauge, or the temperature of a sensor in a machine, or a frequency of a phase lock loop, or a value of an Analog to digital converter or the value of 2/3 rounded to 4 decimal places... In the end all you can really say about a property (get) is that it returns a unit of data. You may or may not be able to set the value. To call a register in a DToA a variable is a bit of a stretch, but if you insist that's fine. But the value of 2/3? No variables involved there. A property get returns a value, a property let accepts a value and does something with it. Storing it? Not necessarily. It may just feed it off to a machine somewhere which does something with the value. It could fire a stepper motor, or set a voltage in a Digital to Analog converter, or it could pull in a relay and spray water all over your computer. By the way that is a write only property which I lovingly call HoseTheTwitsdown. ;) It is a property of the Colbyizer class which has many different properties to allow me to do everything from HoseTheTwitsDown to BoottheTwitsOutTheDoorAt20000Feet. Don't make me use the more extreme properties. :) John W. Colby www.ColbyConsulting.com On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > OK. A property is the the external name given to the state of one or more variables ( scalar > or object) encapsulated within the class.. > > There, that's fixed it :-) > From stuart at lexacorp.com.pg Fri Apr 15 23:20:36 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 14:20:36 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA9032A.1060304@colbyconsulting.com> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> Message-ID: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Sorry, I can't accept that; A write-only property is the local equivalent of this: http://www.supersimplestorageservice.com/ If you can't get a meaningful value from it, then it is not a property - it is a method ( and I don't mean a return value indicating success or failure of the SET) HoseTheTwits Down is a Method. -- Stuart On 15 Apr 2011 at 22:47, jwcolby wrote: > A property get returns a value, a property let accepts a value and > does something with it. Storing it? Not necessarily. It may just > feed it off to a machine somewhere which does something with the > value. It could fire a stepper motor, or set a voltage in a Digital > to Analog converter, or it could pull in a relay and spray water all > over your computer. By the way that is a write only property which I > lovingly call HoseTheTwitsdown. > > ;) > > It is a property of the Colbyizer class which has many different > properties to allow me to do everything from HoseTheTwitsDown to > BoottheTwitsOutTheDoorAt20000Feet. > > Don't make me use the more extreme properties. > > :) > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > > OK. A property is the the external name given to the state of one > > or more variables ( scalar or object) encapsulated within the > > class.. > > > > There, that's fixed it :-) > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From vbacreations at gmail.com Fri Apr 15 23:59:04 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 00:59:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Message-ID: This is quite a surprise. This implies that the code compiles even though vba for access 2003 ought to have no idea what that constant is. Thus compiler is ignoring the code on the "Then" part of the statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" wrote: > Application.Version has been around for a long time. That code certainly works in A2K3. It > does nothing. because Application.Version = 11. I use it for frequently for mdbs that are > runnning in a mixed environment (A2K3 and A2007). > > > On 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question maybe... but have you tested that code in anything >> earlier than 2007?? I would think that the intrinsic constant is not >> recognized.... maybe compatibility mode handles...? > > ... >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 16 01:59:33 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 16:59:33 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg>, Message-ID: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is a toolbar called "Ribbon". That constant is only evaluated at runtime if the Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. -- Stuart On 16 Apr 2011 at 0:59, William Benson wrote: > This is quite a surprise. This implies that the code compiles even > though vba for access 2003 ought to have no idea what that constant > is. Thus compiler is ignoring the code on the "Then" part of the > statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" > wrote: > Application.Version has been around > for a long time. That code certainly works in A2K3. It > does nothing. > because Application.Version = 11. I use it for frequently for mdbs > that are > runnning in a mixed environment (A2K3 and A2007). > > > On > 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question > maybe... but have you tested that code in anything >> earlier than > 2007?? I would think that the intrinsic constant is not >> > recognized.... maybe compatibility mode handles...? > > ... >> If > Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From vbacreations at gmail.com Sat Apr 16 05:51:23 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 06:51:23 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> References: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Message-ID: Great, thanks! On Apr 16, 2011 3:02 AM, "Stuart McLachlan" wrote: > Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is > a toolbar called "Ribbon". That constant is only evaluated at runtime if the > Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. > > -- > Stuart > > > On 16 Apr 2011 at 0:59, William Benson wrote: > >> This is quite a surprise. This implies that the code compiles even >> though vba for access 2003 ought to have no idea what that constant >> is. Thus compiler is ignoring the code on the "Then" part of the >> statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" >> wrote: > Application.Version has been around >> for a long time. That code certainly works in A2K3. It > does nothing. >> because Application.Version = 11. I use it for frequently for mdbs >> that are > runnning in a mixed environment (A2K3 and A2007). > > > On >> 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question >> maybe... but have you tested that code in anything >> earlier than >> 2007?? I would think that the intrinsic constant is not >> >> recognized.... maybe compatibility mode handles...? > > ... >> If >> Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 16 10:59:22 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 16 Apr 2011 17:59:22 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From rockysmolin at bchacc.com Sat Apr 16 12:14:10 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 16 Apr 2011 10:14:10 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: <130733C3468C4FEB89AC6671E8846036@HAL9005> There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 16 12:51:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 16 Apr 2011 13:51:16 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Message-ID: <4DA9D714.8060503@colbyconsulting.com> Stuart, C# of course. http://msdn.microsoft.com/en-us/library/w86s7x04%28v=vs.80%29.aspx Unlike fields, properties are not classified as variables. Therefore, it is not possible to pass a property as a ref (C# Reference) or out (C# Reference) parameter. Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields. >>> from Stack Overflow: >>> One use for a write-only property is to support setter dependency injection. Let's say I had a class: public class WhizbangService { public WhizbangProvider Provider { set; private get; } } The WhizbangProvider is not intended to be accessed by the outside world. I'd never want to interact with service.Provider, it's too complex. I need a class like WhizbangService to act as a facade. Yet with the setter, I can do something like this: service.Provider = new FireworksShow(); service.Start(); And the service starts a fireworks display. Or maybe you'd rather see a water and light show: service.Stop(); service.Provider = new FountainDisplay(new StringOfLights(), 20, UnitOfTime.Seconds); service.Start(); Expand your mind. Sit in the sun, close your eyes, contemplate your belly button. And yes, HoseTheTwitsDown actually is a method - which I was fantasizing about using... ;) John W. Colby www.ColbyConsulting.com On 4/16/2011 12:20 AM, Stuart McLachlan wrote: > Sorry, I can't accept that; A write-only property is the local equivalent of this: > http://www.supersimplestorageservice.com/ > > If you can't get a meaningful value from it, then it is not a property - it is a method ( and I > don't mean a return value indicating success or failure of the SET) > > HoseTheTwits Down is a Method. > From DWUTKA at Marlow.com Sat Apr 16 16:36:37 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:36:37 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8AA.6000102@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> <4DA8C8AA.6000102@colbyconsulting.com> Message-ID: Finally, we agree on something. Glad you finally came to your wits... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:39:03 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:39:03 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: Actually, I have to disagree with you Stuart, a property doesn't necessarily have to wrap a variable. It could wrap a constant. It could wrap a value that is not directly related to a variable, say it could represent some 'condition'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:41:44 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:41:44 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com><4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: Yes, and if you were referring to a property as a field, in VBA, you were using incorrect terminology in that environment. ;) Drew Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:42:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:42:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4EE.80503@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com><4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> <4DA8D4EE.80503@colbyconsulting.com> Message-ID: That's like saying that it would be a good thing if there was no way to make a form 'bound' in some way to data automatically.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 6:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From adtp at airtelmail.in Sat Apr 16 22:57:47 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Sun, 17 Apr 2011 09:27:47 +0530 Subject: [AccessD] is this date affected? References: <130733C3468C4FEB89AC6671E8846036@HAL9005> Message-ID: <00475C102A0F4440809644E445155921@personal4a8ede> David, Another alternative could be considered. You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: IsAffected = ((Dt2 - Dt1) Mod 14 = 0) If the condition is to be checked in an If / End If block, the syntax could be as follows: If (Dt2 - Dt1) Mod 14 = 0 Then Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Rocky Smolin To: 'Access Developers discussion and problem solving' Sent: Saturday, April 16, 2011 22:44 Subject: Re: [AccessD] is this date affected? There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From davidmcafee at gmail.com Mon Apr 18 12:52:44 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 10:52:44 -0700 Subject: [AccessD] is this date affected? In-Reply-To: <00475C102A0F4440809644E445155921@personal4a8ede> References: <130733C3468C4FEB89AC6671E8846036@HAL9005> <00475C102A0F4440809644E445155921@personal4a8ede> Message-ID: Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal > ------------ > > ----- Original Message ----- > From: Rocky Smolin > To: 'Access Developers discussion and problem solving' > Sent: Saturday, April 16, 2011 22:44 > Subject: Re: [AccessD] is this date affected? > > > There's a Weekday function in VBA that you pass a date to and it returns a > number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, April 16, 2011 8:59 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] is this date affected? > > Hi David > > You can build a collection of the dates using a loop and DateAdd. > Then look up your date in this collection. > > /gustav > > > >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> > I was wondering if anyone already has some code or Jet SQL to determine if > a > date is affected? > > Such as Every other Saturday for the next x Saturdays starting 4/16/2011 > (2011.04.16 ;) ) > > Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) > > I was going to write a function, but I was wondering I am re-inventing the > wheel, or if there is some built in too to do so. > > Thanks, > David > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Mon Apr 18 13:11:51 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 18 Apr 2011 20:11:51 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". /gustav >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal From davidmcafee at gmail.com Mon Apr 18 15:01:32 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 13:01:32 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the > next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had > to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate > > Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the > > following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax > > could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Tue Apr 19 04:57:50 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Apr 2011 11:57:50 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Not exactly. That will loosen the condition to satisfy the question: "such as Every other Saturday before x weeks after 4/16/2011". For example, 2011-03-19 will be accepted, and these values will be as well: StartingSat = #2011/04/17# NumOfSats = 5 SiQ = #2011/05/15# Of course, you may have validated SiQ to be larger than StartingSat as well as StartingSat to be a Saturday prior to calling your easy expression, but how can we know? Also, the DateAdd formula could be reduced to: DateAdd("ww", NumOfSats, StartingSat) /gustav >>> davidmcafee at gmail.com 18-04-2011 22:01 >>> Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal From jwcolby at colbyconsulting.com Tue Apr 19 13:26:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 19 Apr 2011 14:26:18 -0400 Subject: [AccessD] Exact reports are such a pita Message-ID: <4DADD3CA.7010106@colbyconsulting.com> I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Tue Apr 19 13:32:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 13:32:06 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <004301cbfec0$16c2eb40$4448c1c0$@comcast.net> I think I would just build a string, using the values if I have them, underscores if I don't. If you're using Access 2002+, you can use the OpenArgs parameter when you open the report, if that would work out. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Tue Apr 19 13:33:54 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 19 Apr 2011 13:33:54 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Tue Apr 19 13:45:32 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 11:45:32 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Tue Apr 19 14:32:45 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Wed, 20 Apr 2011 07:32:45 +1200 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> References: <4DADD3CA.7010106@colbyconsulting.com> <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Message-ID: <9728D49895B043959AFD82816DBD3DBF@stevelaptop> I agree. I don't think the idea of a temp table is over the top. That's how I would do it. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Wednesday, April 20, 2011 6:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Exact reports are such a pita Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? From john at winhaven.net Tue Apr 19 15:30:34 2011 From: john at winhaven.net (John Bartow) Date: Tue, 19 Apr 2011 15:30:34 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <00bf01cbfed0$a2f48e60$e8ddab20$@winhaven.net> That's how I handle "previously done on a form" reports with my apps. Makes the form look perfect and it relieves you of having to fudge around with data. I've honestly had to do this and then duplicate the report and remove the image background, and include a choice for the user to either insert preprinted forms or print the entire form (there was no discernable difference). Supposedly this was because the client didn't want to waste all of those preprinted forms they had. I did a follow up about a year later and the client had actually ordered more preprinted forms! Yes, you guessed it. It was a government job. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, April 19, 2011 1:34 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Exact reports are such a pita Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 19 15:37:24 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 13:37:24 -0700 Subject: [AccessD] Hide Form Title Bar Message-ID: Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From df.waters at comcast.net Tue Apr 19 16:39:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 16:39:06 -0500 Subject: [AccessD] OT: Windows Kinect SDK Beta Message-ID: <002401cbfeda$35f42730$a1dc7590$@comcast.net> If you combine this with XKCD, there's going to be a lot of trouble. I'm not saying anything more. Dan From ab-mi at post3.tele.dk Tue Apr 19 16:45:26 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Tue, 19 Apr 2011 23:45:26 +0200 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: Don't think you can eliminate the title bar on a sizable form. But you can eliminate the contents of the bar using these settings: Caption: ControlBox: No MinMaxButtons: None CloseButton: No Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Rocky Smolin Sendt: 19. april 2011 22:37 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Tue Apr 19 17:23:20 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Tue, 19 Apr 2011 17:23:20 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # References: <07230D1FF5AD4611A350B33814B094C6@HAL9005><74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad From charlotte.foust at gmail.com Tue Apr 19 20:15:41 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:15:41 -0700 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: I'm not sure this is an Access issue. I seem to recall that the # sign has a specific meaning in passing data into and out of delimited text file. Maybe someone else can recall the specifics. You might be able to work around it by either using a double # in the export spec for the field name, or else export and then rename the field in the csv file using text IO code. Charlotte Foust On Tue, Apr 19, 2011 at 3:23 PM, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our testing) > and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't understand. > > Is there a way to force Access to not replace the "#" with a "." ?? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 19 20:23:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:23:15 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: If you want to use a continuous subform, you could count the records you have and then add dummy records to fill out the count. You would want to either use a temp table or create a new recordset and add the dummy records to that, then dispose the recordset when done. Charlotte Foust On Tue, Apr 19, 2011 at 11:26 AM, jwcolby wrote: > I need to build a report that looks as close as possible to a state form. > ?This includes a couple of subforms which look like: > > 1) From:_____________ To:___________ > 2) From:_____________ To:___________ > 3) From:_____________ To:___________ > > And if I don't have a line 2 or line 3 I still need to fake it, put in the > number and underline. > > IOW it should be indistinguishable from a copy of their form casually > compared side by side. > > Can you say PITA. > > The only thing I can think of is to build a temp table, place the 1) 2) and > 3) in three records (programmatically) and then fill in each record as > needed. > > That seems rather over the top. ?Any suggestions for easy ways to fake this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Darryl.Collins at iag.com.au Tue Apr 19 20:26:03 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Wed, 20 Apr 2011 11:26:03 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: Message-ID: <201104200126.p3K1QAR6009307@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Perhaps a cheap and easy solution that may work nicely is to use a valid placeholder during the export and creation of the CSV file instead of the "#". Maybe something like "Employee$" and then once the CSV is exported use code to perform a global search and replace on the .txt file where the "#" char is not going to be an issue. .replace ""Employee$", ""Employee#" or similar. hth a bit Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Wednesday, 20 April 2011 8:23 AM To: Access Developers discussion and problem solving Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Tue Apr 19 22:40:09 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 13:40:09 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DAE5599.938.1FB46483@stuart.lexacorp.com.pg> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Apr 20 02:59:26 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 20 Apr 2011 09:59:26 +0200 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # Message-ID: Hi Brad Listen to Stuart. Once you have this set up you are in total control and will never look back. The same goes for importing text files. /gustav >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad From stuart at lexacorp.com.pg Wed Apr 20 04:53:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 19:53:45 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: Message-ID: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 20 09:46:23 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 20 Apr 2011 10:46:23 -0400 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 10:28:40 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 08:28:40 -0700 Subject: [AccessD] Search as you type Message-ID: I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug From charlotte.foust at gmail.com Wed Apr 20 11:01:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 09:01:06 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Try using a disconnected ADO recordset and apply a filter to return the limited recordset. That should make the search fast because the recordset is no longer connected to the back end. What are you planning to do if there are multiple results for the find? The user could actually edit the record if you require that and then you would have to reconnect the recordset and update the source. I have an old demo on roger's access site that was built in 2000 (AFAIR) that uses disconnected recordsets to load and update data. You might have a look at it and see if it gives you any ideas. Watch out for a wrap. http://www.rogersaccesslibrary.com/forum/foust-charlotte_forum14&SID=f27a794a-684c-f2495918-e4c25924-463bez2z.html Charlotte Foust On Wed, Apr 20, 2011 at 8:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 11:03:00 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 12:03:00 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: <4DAF03B4.3060501@colbyconsulting.com> In the onchanged event of the text box you can set a form timer to fire X ticks later. Every time the onchanged fires the timer is "reset" to be x ticks out. When the timer fires, reset the timer to not fire ( a value of 0 ticks I think) and then go do the search. Each tick is a millisecond so set it for 1000 to get a 1 second delay. Something like that. John W. Colby www.ColbyConsulting.com On 4/20/2011 11:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug From shamil at smsconsulting.spb.ru Wed Apr 20 11:14:14 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 20 Apr 2011 20:14:14 +0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Hi Doug -- I suppose you can try to use KeyDown event and run search only when {Enter} or any other special char(s) combination is pressed. Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then MsgBox (txtSearch.Text) ' suppress if needed => KeyCode = 0 End If End Sub Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: 20 ?????? 2011 ?. 19:29 To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed Apr 20 11:21:46 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 20 Apr 2011 09:21:46 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 20 12:17:48 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 20 Apr 2011 13:17:48 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Doug, How many records will they be searching against roughly? You can do a reasonable incremental search character by character with DAO by using a seek on an index (which is the fastest method for finding a match), but that tops out at about 50,000 records depending on the speed of the network and PC. Might also want to consider searching on a snapshot. Using a snapshot, the data will be cached locally in a temp file. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 11:29 AM To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 13:28:18 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 11:28:18 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Thanks for the responses. I'll do some experimenting and report back. Jim, the recordset is fairly small (500 or so records) but is based on about 15 large tables. The form isn't editable, so I guess a snapshot should work. Doug On Wed, Apr 20, 2011 at 10:17 AM, Jim Dettman wrote: > Doug, > > ?How many records will they be searching against roughly? > > ?You can do a reasonable incremental search character by character with DAO > by using a seek on an index (which is the fastest method for finding a > match), but that tops out at about 50,000 records depending on the speed of > the network and PC. > > ?Might also want to consider searching on a snapshot. ?Using a snapshot, > the data will be cached locally in a temp file. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, April 20, 2011 11:29 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Search as you type > > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 15:39:02 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 16:39:02 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working Message-ID: <4DAF4466.7010506@colbyconsulting.com> I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the move but it isn't working. Has anyone ever seen this and a fix? -- John W. Colby www.ColbyConsulting.com From BradM at blackforestltd.com Wed Apr 20 15:49:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 15:49:22 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # References: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Message-ID: All, Thanks for the advice and insights. I am planning to experiment with the ideas posted. I like the sounds of the "roll your own" export (I am a product of the 1960s :-) I have never used Access to tweak a flat file, so that also is something that sounds interesting, at least to have in the bag-of-tricks. (If someone has a simple example that they are willing to share, I would appreciate it). Thanks again, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 15:58:31 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 13:58:31 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: ADO or DAO recordset? Charlotte Foust On Wed, Apr 20, 2011 at 1:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. ?The bookmark is the > accepted way of doing the move but it isn't working. > > Has anyone ever seen this and a fix? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 16:02:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 17:02:36 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: <4DAF49EC.7070606@colbyconsulting.com> Never mind. PBKAC! John W. Colby www.ColbyConsulting.com On 4/20/2011 4:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the > move but it isn't working. > > Has anyone ever seen this and a fix? > From dbdoug at gmail.com Wed Apr 20 16:05:34 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 14:05:34 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF49EC.7070606@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Wed Apr 20 16:07:42 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 16:07:42 -0500 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working References: <4DAF4466.7010506@colbyconsulting.com><4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem Between Keyboard and Chair ? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 4:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Me.Bookmark = rst.Bookmark not working OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 16:08:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 14:08:06 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem (exists) Between Keyboard And Chair Charlotte Foust On Wed, Apr 20, 2011 at 2:05 PM, Doug Steele wrote: > OK, I'll bite - what is PBKAC? > Doug > > On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: >> Never mind. PBKAC! >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/20/2011 4:39 PM, jwcolby wrote: >>> >>> I am trying to lookup and move to a record in a form. The bookmark is the >>> accepted way of doing the >>> move but it isn't working. >>> >>> Has anyone ever seen this and a fix? >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Wed Apr 20 16:37:35 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 21 Apr 2011 07:37:35 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # In-Reply-To: References: , Message-ID: <4DAF521F.5986.238ED302@stuart.lexacorp.com.pg> One useful "flat file tweak" is when you are supplied with a Unix file that has LF as line terminators instead of CRLF. You need to convert such files before you can read them in with Line Input. Here's a simple function to read the whole file into memory and change LFs to CRLFs. It works fine as long as the export file doesn't exceed about 2 billion characters, which is the limit of a single string length. :-) There are lots of other things you can do in a similar vein. You could for instance parse the file into an array of lines instead using strMyArray() = Split(strTemp,Chr$(10)) Function UnixToDosFile(filename) As Long Dim fileroot As String Dim fileext As String Dim newfile As String Dim ff As Long Dim flen As Long Dim strTemp As String 'Create a name for the output file fileext = Right$(filename, Len(filename) - InStrRev(filename, ".")) fileroot = Left$(filename, InStrRev(filename, ".") - 1) newfile = fileroot & "-DOS." & fileext 'Get a file handle ff = FreeFile 'Load complete Unix file into memory Open filename For Binary As #ff flen = LOF(ff) ' how big is the file strTemp = Space$(flen) 'make our buffer the same size. Get #ff, , strTemp 'get the file into memory Close #ff 'Replace LF with CRLF strTemp = Replace(strTemp, Chr$(10), Chr$(13) & Chr$(10)) 'Save new file Open newfile For Binary As #ff Put #ff, , strTemp Close #ff End Function -- Stuart On 20 Apr 2011 at 15:49, Brad Marks wrote: > All, > > Thanks for the advice and insights. > > I am planning to experiment with the ideas posted. > > I like the sounds of the "roll your own" export (I am a product of the > 1960s :-) > > I have never used Access to tweak a flat file, so that also is > something that sounds interesting, at least to have in the > bag-of-tricks. (If someone has a simple example that they are willing > to share, I would appreciate it). > > Thanks again, > Brad > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] > Problem Exporting to a CSV file with a Column Namethat has a # > > Hi Brad, > > Listen to Gustav ;-) > > Especially for import. You willl find all sorts of CSV file formats. > The biggest problem is the inconsistent use of "quotes". Sometime all > dates and strings are quoted, sometimes they are only quoted if they > contain a comma, sometimes you will get numbers quoted because they > are formatted to include commas and others which are not because they > don't include commas, sometimes you will get embedded real quotes > represented as double quotes. You can get all of these variations in > a single file. The built in Import function can't handle many of > them. > > What I do is import the line, strip the quotes and convert it into Tab > delimited strings without extraneous quotes. > > Function ConvertLine(strIn As String) As String > 'Converts CSV(either quoted or non-quoted text) to TAB delimited > Dim inquotes As Boolean Dim strC As String Dim x As Long > > 'Change real delimiter commas to Tabs > 'ie those that aren't inside quotes > For x = 1 To Len(strIn) > strC = Mid$(strIn, x, 1) > If strC = "," And Not inquotes Then > Mid$(strIn, x, 1) = Chr$(9) > End If > If strC = """" Then > inquotes = Not inquotes > End If > Next > > ' there may be real quotes escaped as "paired" quotes > ' so change them temporarily to a non print character > strln = Replace(strln,"""""",chr$(1)) > > 'get rid of all the remaining quotes > strln = Replace(strIn, """", "") > > 're-instate the escaped quotes > ConvertLine = Replace(strln,Chr$(1),"""") > End Function > > Then I split the record using > ... > Line Input #ff strInputLine > strData() = Split(Convertline(strInputLine),Chr$(9)) > ... > > Once you have done that, you can convert the strings to other data > types as required. > > -- > Stuart > > On 20 Apr 2011 at 9:59, Gustav Brock wrote: > > > Hi Brad > > > > Listen to Stuart. > > Once you have this set up you are in total control and will never > > look back. The same goes for importing text files. > > > > /gustav > > > > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > > The best solution is not to use the built in Access export routine. > > Roll your own and you can put anything you want in the file. > > > > Aircode: > > > > Function Export() as Long > > Dim rs as DAO.Recordset > > Dim ff as long > > ff = Freefile > > set rs = CurrentDB.Openrecordset("qryMyExport") > > ff = Freefile > > Open "myExportFile.csv" for Output as #ff > > Print #1,"First fieldname,Employee #,Third fieldname" > > While not rs.Eof > > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > > rs.movenext > > Wend > > Close #ff > > End Function > > > > -- > > Stuart > > > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > > > All, > > > > > > We are just starting to use an Access 2007 application to feed > > > data to another outside system via a CSV file. > > > > > > This outside system is very rigid and we need to use exact field > > > names on the CSV file that we are creating. > > > > > > The catch is that one of the fields is call "Employee #". > > > > > > We set up an Export Specification (called Export-Query1 for our > > > testing) and we are using the following command to do the export > > > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > > > When we run the application, everything works nicely, except the > > > field named "Employee #" is somehow being renamed "Employee ." in > > > the generated CSV file. > > > > > > We have run a number of tests and it looks like we have stumbled > > > upon either a "bug" a "feature", or something that we just don't > > > understand. > > > > > > Is there a way to force Access to not replace the "#" with a "." > > > ? > > > > > > Thanks for your help, > > > > > > Brad > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Thu Apr 21 10:33:09 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 21 Apr 2011 08:33:09 -0700 Subject: [AccessD] Search as you type (note to JC) Message-ID: John, the timer logic you suggested for the search box worked like a charm. It makes the search much smoother to use. I'm still going experiment with ADO for this when I have a bit of time. Doug From DWUTKA at Marlow.com Thu Apr 21 10:33:51 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 10:33:51 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:22:40 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:22:40 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 21 11:28:37 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:28:37 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <2F55242637C64867956F4EF369D6E259@HAL9005> Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:30:28 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:30:28 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:39:20 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:39:20 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <64BB5603B8E945EC97F03BBD8B503D18@HAL9005> Yep. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:50:38 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:50:38 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <2F55242637C64867956F4EF369D6E259@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> <2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 21 12:26:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 21 Apr 2011 13:26:38 -0400 Subject: [AccessD] Search as you type (note to JC) In-Reply-To: References: Message-ID: <4DB068CE.9040408@colbyconsulting.com> > John, the timer logic you suggested for the search box worked like a charm. Its nice to occasionally get one right. :) Long ago I built a system to take a list and populate it with the matches to the characters being typed into a text box. I sized the list to just a single line and positioned it butted up to the bottom of the text box. As the user typed the first character into the text box, the logic "opened" the list by causing the size to change to some value (a few inches). Then I populated the list with "like CharactersTypedIn*". When the user tabbed out (onExit of the text box) the top value in the list was pulled into the text box and the list pulled back up to a single line. It worked just like a combo box basically. John W. Colby www.ColbyConsulting.com On 4/21/2011 11:33 AM, Doug Steele wrote: > John, the timer logic you suggested for the search box worked like a > charm. It makes the search much smoother to use. > > I'm still going experiment with ADO for this when I have a bit of time. > > Doug From accessd at shaw.ca Thu Apr 21 13:17:13 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 21 Apr 2011 11:17:13 -0700 Subject: [AccessD] Slightly off topic In-Reply-To: <4DB068CE.9040408@colbyconsulting.com> References: <4DB068CE.9040408@colbyconsulting.com> Message-ID: Hi All: Does anyone know of a little routine that will open a DVD drive and then re-close it. I have some remote processes that have this requirement. MTIA Jim From jwcolby at colbyconsulting.com Fri Apr 22 07:44:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 08:44:50 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: <4DB17842.4020604@colbyconsulting.com> I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Apr 22 08:06:23 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 09:06:23 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB17842.4020604@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Hi John, I've just finished a similar project for downloading all pdf and xls from a site and the iron is still hot. I know its volunteer - just send the relevant access info to my address and I'll get your pics for you. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 8:45 AM To: Access Developers discussion and problem solving Subject: [AccessD] How do I Grab the picture from the web page I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Fri Apr 22 08:31:15 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 08:31:15 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad From jwcolby at colbyconsulting.com Fri Apr 22 08:34:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 09:34:49 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4DB183F9.90006@colbyconsulting.com> Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading > all pdf and xls from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info > to my address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From rockysmolin at bchacc.com Fri Apr 22 08:44:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 06:44:36 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Fri Apr 22 08:48:18 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 22 Apr 2011 08:48:18 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4db18725.06c7640a.18cc.75b7@mx.google.com> Brad, I'm with you. Although after ten years working with Access, I still get confused between ADO and DAO. As a matter of preference, maybe because I don't understand the issues, I routinely use DAO anytime I need to create a TableDef or anything else that needs to connect to a database, etc. Maybe someone on this list can give us definitions of the two and give examples where one is better than the other. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 8:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 09:09:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 10:09:05 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <4db18725.06c7640a.18cc.75b7@mx.google.com> References: <4DB17842.4020604@colbyconsulting.com> <4db18725.06c7640a.18cc.75b7@mx.google.com> Message-ID: <4DB18C01.3000202@colbyconsulting.com> DAO is the object model for the the Access database object. DAO knows about things like *Microsoft ACCESS* databases, tables, fields, properties, queries, forms, reports and so forth. IOW *anything* that is an object in Access is manipulated using DAO. You can modify the tabledef object with DAO I believe. DAO knows nothing about *anything* other than objects inside of an Access database container. ADO is an object model for manipulating very specific objects related to *data* and will work with any data store which has an ADO provider - which includes SQL Server, Access, MySQL, etc. It knows about the command object, datasets, tables, columns, relationships and the like. It is possible to change a table with SQL. There are keywords for adding and dropping columns, the data type for the column, adding indexes and the like. You can execute SQL using the ADO command object. That is different from doing so directly with ADO. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:48 AM, jm.hwsn wrote: > Brad, > I'm with you. Although after ten years working with Access, I still get > confused between ADO and DAO. > As a matter of preference, maybe because I don't understand the issues, I > routinely use DAO anytime I need to create a TableDef or anything else that > needs to connect to a database, etc. > > Maybe someone on this list can give us definitions of the two and give > examples where one is better than the other. > > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 8:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > From michael at mattysconsulting.com Fri Apr 22 09:40:42 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 10:40:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> John, OK, I think the best way to approach this is for you to visit http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp It took me an hour or two to get the right elements for my project and then lots more to loop through the relevant tables, rows, childnodes, and cells to get the right info. Basically, you want the href of the image and then it's a simple binary save object to file, thus http://www.devx.com/vb2themax/Tip/18441 Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 9:35 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa ge=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading all pdf and xls > from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info to my > address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 09:42:48 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 09:42:48 -0500 Subject: [AccessD] Trouble using Split command Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> I am trying to use the split command on the following string " 0.000 243.729 - 61.495 -" I have a dim statements as follows Dim LineText As String Dim Test() As String The split statement is as follows Test = Split(LineText)(0) No matter how I dim Test() I get an error message of Run Time Error 13 Type Mismatch This seems like it should be real simple but I am obviously missing something. Thanks. Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From phpons at gmail.com Fri Apr 22 09:57:35 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 16:57:35 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Fri Apr 22 10:04:58 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 17:04:58 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:06:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:06:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C9C@houex1.kindermorgan.com> Still generates the same error of Type Mismatch -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 9:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Fri Apr 22 10:12:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:12:20 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:18:05 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:18:05 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From charlotte.foust at gmail.com Fri Apr 22 10:35:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:35:20 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Yes, it is possible to change a table (not a tabledef, please note) with ADO, but you have to use the ADOX library, and the process is different. ADOX is the library that lets you create and edit tables using ADO. The 2010 help files aren't very helpful when it comes to ADOX, I've noticed. However, the MSDN files are better. Take a look at http://support.microsoft.com/kb/291264/fr to see about manipulating tables and links in ADOX. Charlotte Foust On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks wrote: > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jackandpat.d at gmail.com Fri Apr 22 10:44:52 2011 From: jackandpat.d at gmail.com (jack drawbridge) Date: Fri, 22 Apr 2011 11:44:52 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Here's a link to some ADO examples and tips by Allen Browne. http://allenbrowne.com/func-adox.html Specific to Modify table is http://allenbrowne.com/func-adox.html#ModifyTableAdox On Fri, Apr 22, 2011 at 11:35 AM, Charlotte Foust wrote: > Yes, it is possible to change a table (not a tabledef, please note) > with ADO, but you have to use the ADOX library, and the process is > different. ADOX is the library that lets you create and edit tables > using ADO. The 2010 help files aren't very helpful when it comes to > ADOX, I've noticed. However, the MSDN files are better. Take a look > at http://support.microsoft.com/kb/291264/fr to see about manipulating > tables and links in ADOX. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks > wrote: > > All, > > > > We have an existing Access 2007 application that uses ADO. > > > > We now want to enhance this application to be able to change a TableDef > > with VBA code so that we can change the path to an Excel file on the > > fly. > > > > Is it possible to change TableDefs with ADO? > > > > I have seen many examples of how to change TableDefs with DAO, but I > > have not yet discovered an example of how to do this with ADO. > > > > I am fairly new to the world of Access and I am still trying to wrap my > > little brain around the "ADO vs DAO" debate. > > > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > > > Thanks, > > Brad > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:48:15 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:48:15 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. Correct me if I am wrong. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 10:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:50:18 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:50:18 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB7@houex1.kindermorgan.com> The (0) is to put the first element of the array into the variable Test -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:12 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:51:38 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:51:38 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB8@houex1.kindermorgan.com> The - is part of the string that is being read from a text file using a lineinput statement. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:18 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 10:53:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 11:53:08 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1A464.3090708@colbyconsulting.com> OK, thanks for that! John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:55:46 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:55:46 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Fri Apr 22 11:01:18 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 09:01:18 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: This is how I use it: 'Opening ARgs = "ReturnForm|ReturnField" Dim arrX As Variant If Nz(Me.OpenArgs, "") <> "" Then arrX = Split(Me.OpenArgs, "|") strReturnForm = arrX(0) strReturnField = arrX(1) End If On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the > first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a large > >> number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 11:08:53 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 11:08:53 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> I tried changing the dim statement to Dim Test as Variant I then did Test = Split(LineText) Test2=Test(0) Both variables test and test2 are empty I ran a LEN test on the variable LineText and got 98 I am puzzled. Thanks for everyone's help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:56 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From phpons at gmail.com Fri Apr 22 11:32:32 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 18:32:32 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Fri Apr 22 11:50:14 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 11:50:14 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From jedi at charm.net Fri Apr 22 12:25:08 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:25:08 -0400 (EDT) Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <2419.24.35.19.37.1303493108.squirrel@mail.expedient.net> John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or > obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page > to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn > how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first > string, but it would be good (for another project) to know how I insert > data into the controls and > click the search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table > collection etc. The web control is found by clicking the ellipsis in the > toolbox bar in form design > and going down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I > have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they > apparently did not program the web site in a "nice" manner, tables just > have one big long string > etc. the following is the code that I use to poke through the dozens of > tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading >> all pdf and xls from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info >> to my address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Fri Apr 22 12:33:43 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:33:43 -0400 (EDT) Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <2432.24.35.19.37.1303493623.squirrel@mail.expedient.net> Chester, if you are still having trouble consider using the debugger. Stop on the line Test = Split(LineText) and view the contents of LineText to make sure there is something there. If there is a valid string then view the properties of Split(LineText), there should be a bunch. You may need to place them in the Inspection window. Goodluck, Mike... > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: >> My understanding is that the result of the split statement is a one >> dimensional array. Thus the Dim test() as Variant >> The Test = Split(LineText)(0) statement is meant to put the contents of >> the first array element into the variable Test. >> Correct me if I am wrong. >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons >> Sent: Friday, April 22, 2011 10:05 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Trouble using Split command >> >> Better! >> >> Public Sub test() >> ? ?'I have a dim statements as follows >> ? ?Dim LineText As String >> ? ?Dim test As Variant ' no parenthesis for the name of the variable >> ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 >> 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" >> ? ?'The split statement should be as follows >> ? ?test = Split(LineText, "0") ' the split separator must be within the >> () >> of the split function >> End Sub >> Philippe >> 2011/4/22 philippe pons >> >>> Dim Test() As Variant >>> >>> Philippe >>> >>> 2011/4/22 Kaup, Chester >>> >>> I am trying to use the split command on the following string >>>> >>>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? >>>> - >>>> ? ? 61.495 ? ? ? ? ? ? ?-" >>>> >>>> I have a dim statements as follows >>>> Dim LineText As String >>>> Dim Test() As String >>>> >>>> The split statement is as follows >>>> Test = Split(LineText)(0) >>>> >>>> No matter how I dim Test() I get an error message of >>>> Run Time Error 13 >>>> Type Mismatch >>>> >>>> This seems like it should be real simple but I am obviously missing >>>> something. >>>> >>>> Thanks. >>>> >>>> >>>> >>>> >>>> Chester Kaup >>>> Engineering Technician >>>> Kinder Morgan CO2 Company, LLP >>>> Office (432) 688-3797 >>>> FAX (432) 688-3799 >>>> >>>> >>>> No trees were killed in the sending of this message. However a large >>>> number of electrons were terribly inconvenienced. >>>> >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >>> >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 12:43:28 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 13:43:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: Whoa. Well, you may be right ... however, I think one can actuate the link like this: Dim ITM as HTMLLINKELEMENT Set ITM = Doc.Links(ThatLink) ITM.Click The picture will then be visible. That may not be enough, though. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Bahr Sent: Friday, April 22, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchre > sults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter > data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they apparently did not program the web site in > a "nice" manner, tables just have one big long string etc. the > following is the code that I use to poke through the dozens of tables > they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 13:05:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 13:05:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Thanks for everyone's help and suggestions. I wanted to get out just the 5 data elements. Obviously I need a different plan. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 11:33 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 13:13:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 14:13:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1C556.70804@colbyconsulting.com> Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 13:55:36 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 14:55:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: John, Please elaborate on what is meant by early binding, since the control can be placed on a form and it shows all properties and methods in the Object Browser? Or did you mean late binding? Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 2:14 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project and > then lots more to loop through the relevant tables, rows, childnodes, > and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults& > listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I need to learn how it is done so I can > do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is > the code that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 14:00:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 12:00:19 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <8147EC9653BF4537B0067252FF8940A7@HAL9005> IIRC if you define all the DOA and ADO objects explicitly they'll play well together. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 9:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Apr 22 15:05:08 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 13:05:08 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > From rockysmolin at bchacc.com Fri Apr 22 16:40:00 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:40:00 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 16:41:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:41:22 -0700 Subject: [AccessD] Hide Form Title Bar References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <6864E3DD26DE4AB1A32DA74295F92233@HAL9005> Actually, I just noticed that there's a tiny sliver of bar at the top that lets you drag the form. Why do they DO THAT??!!! Rocky -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Friday, April 22, 2011 2:40 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , Message-ID: <4DB1FB8D.3278.2DF4AAA1@stuart.lexacorp.com.pg> No, even worse. I repeat - Variants are an abomination A comparison of your two examples shows why this is so. -- Stuart On 22 Apr 2011 at 17:04, philippe pons wrote: > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within > the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 > >> - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a > >> large number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, Message-ID: <4DB1FB8D.7908.2DF4AA15@stuart.lexacorp.com.pg> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" The Split() function returns a String array. So Dim Test() as Stinrg is correct. -- Stuart On 22 Apr 2011 at 16:57, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > > I am trying to use the split command on the following string > > > > " 0.000 243.729 > > - > > 61.495 -" > > > > I have a dim statements as follows > > Dim LineText As String > > Dim Test() As String > > > > The split statement is as follows > > Test = Split(LineText)(0) > > > > No matter how I dim Test() I get an error message of > > Run Time Error 13 > > Type Mismatch > > > > This seems like it should be real simple but I am obviously missing > > something. > > > > Thanks. > > > > > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:14:32 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:14:32 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <4DB1FDC8.23134.2DFD5E85@stuart.lexacorp.com.pg> Why didn't you say so :-) Dim LineText as string Dim Elements() as string DIm x as long LineText = " 0.000 243.729 - 61.495 - " 'Reduce multiple spaces to singles While instr(Linetext," ") > 0 LineText = Replace(LineText," "," ") Wend 'Get the data Elements() = Split(LineText," ") 'Do something with the data For x = 1 to UBound(Elements()) debug.print Elements(x) Next On 22 Apr 2011 at 13:05, Kaup, Chester wrote: > Thanks for everyone's help and suggestions. I wanted to get out just > the 5 data elements. Obviously I need a different plan. > From jwcolby at colbyconsulting.com Fri Apr 22 17:40:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 18:40:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB203E4.6000305@colbyconsulting.com> In order to pass the object to a class or method of a module any way other than "as object" you need to know what it is. IOW As textbox, as combobox etc. If you pass it "as object" then intellisense no longer works inside of the method or class. "As object" is late binding. In order te sink events in a class you have to ue early binding. Dim WithEvents XYZ as SomeObjType. John W. Colby www.ColbyConsulting.com On 4/22/2011 2:55 PM, Michael Mattys wrote: > John, > > Please elaborate on what is meant by early binding, > since the control can be placed on a form and it shows > all properties and methods in the Object Browser? > Or did you mean late binding? > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From charlotte.foust at gmail.com Fri Apr 22 17:48:27 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 15:48:27 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <8147EC9653BF4537B0067252FF8940A7@HAL9005> References: <4DB17842.4020604@colbyconsulting.com> <8147EC9653BF4537B0067252FF8940A7@HAL9005> Message-ID: You can use both, if you declare them specifically, but don't try to mix them because ADO calls don't work on a DAO object! Charlotte Foust On Fri, Apr 22, 2011 at 12:00 PM, Rocky Smolin wrote: > IIRC if you define all the DOA and ADO objects explicitly they'll play well > together. > > Rocky > > > -----Original Message----- > From: accOessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 9:50 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All - Thanks for the help/advice/insights ... Brad > > ~~~~~~~~~~~ > > Rocky, > > In the situation that I am dealing with, the Excel file is a "Linked Table". > > This works fine. > > Now we want to be able to change the Path to this Linked Table with VBA > code. > > I have this working using DAO, but I have some concern about using both DAO > and ADO in the same application. > > It appears that using both DAO and ADO is Okay, but I am not 100% sure. > > Thanks, > Brad > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin > Sent: Friday, April 22, 2011 8:45 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > What kind of change do you want to make? ?Wouldn't the path to the Excel > file be stored as data in a text field in the table? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 6:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef with > VBA code so that we can change the path to an Excel file on the fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I have > not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Fri Apr 22 19:42:41 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 22 Apr 2011 19:42:41 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Fri Apr 22 20:03:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 18:03:02 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <171D63778466419685EA3C5EE9C24CB0@HAL9005> On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 23 06:37:51 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 23 Apr 2011 13:37:51 +0200 Subject: [AccessD] Trouble using Split command Message-ID: Hi Stuart Let me guess: Stuart loves programming VBScript! /gustav >>> stuart at lexacorp.com.pg 23-04-2011 00:05:01 >>> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" From dhb at flsi.com Sat Apr 23 07:20:00 2011 From: dhb at flsi.com (Darrell Burns) Date: Sat, 23 Apr 2011 05:20:00 -0700 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases Message-ID: <032a01cc01b0$c4a1c630$4de55290$@com> Howdy. First-time on AccessD. I've tried all the other forums and can't get an answer to this one. I have a FE A2007 app linked to a BE A2007 database. There's a master form with 6 tabs. Each tab contains a subform that's bound to a query. Plus I open recordsets on the the BE tables to fetch stuff for the form. You can drill down from any subform to a detailed form by double-clicking a data field. I started getting the above error message after opening 2 or 3 of these forms, so I created a form handler method that shuts down the calling form and closes all the DB connections before opening the target form. I'm still getting that error. I've gone thru my code and diligently set all DBs to nothing at the end of each sub, but I can't seem to lick the problem. Suggestions from other forums have been to unbind the tables from the subforms. I buy that, but the question I can't get an answer to is how can I monitor how many connections I have open at one time so I can diagnose the problem? I feel like I'm debugging in the dark. Please turn on the light for me. Thanx, Darrell From jwcolby at colbyconsulting.com Sat Apr 23 08:13:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:13:11 -0400 Subject: [AccessD] Trouble using Split command In-Reply-To: References: Message-ID: <4DB2D067.20705@colbyconsulting.com> LOL. The reality is that variants are a specialized tool used for specific situations. There are things that you cannot accomplish without them but if you know what the data type you need is, you should use that type rather than a variant. John W. Colby www.ColbyConsulting.com On 4/23/2011 7:37 AM, Gustav Brock wrote: > Hi Stuart > > Let me guess: Stuart loves programming VBScript! > > /gustav > > >>>> stuart at lexacorp.com.pg 23-04-2011 00:05:01>>> > NO! > > Repeat after me, seven times... > > "Variants are an abomination. They are rarely required and must be used with caution" > > > From DWUTKA at Marlow.com Sat Apr 23 08:16:32 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 08:16:32 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <171D63778466419685EA3C5EE9C24CB0@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> <171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sat Apr 23 08:51:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:51:18 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB2D956.50309@colbyconsulting.com> Darrell, This is one of those misleading error messages. Every single open query or or table uses a "database". This means every combo box (uses a query to display the data), bound form, bound report, open recordset and so forth. The usual villain is a bound form with bound subforms with dozens of combo boxes open. I investigated this extensively a few years ago and what I discovered is that Access has some magic number which is the maximum number of recordsets available to the application. It seems that the number was somewhere around 1800. Every time you opened a query (combo, report, sub-report etc) the number available dropped. When you got low enough (and "low enough was not zero) you started getting this error. There is no fix, this is a "by design" limitation. You work around it by using JIT subforms and the like to minimize the number of objects using queries. BTW, you can discover for yourself what this number is fairly easily but there is no place (that I could discover) that you could go to see how many were left. The following code is not pretty but it does the job. In my case I am getting only 408 recordsets. I could swear the number was much higher. this is against linked SQL Server databases so maybe that has something to do with it. If we could get a bunch of people to run the code and report back their numbers that would help us to see better. Function rstOpen(db As DAO.Database, intTheLimit As Integer) As DAO.Recordset Dim rst As DAO.Recordset On Error Resume Next Set rst = db.OpenRecordset("SELECT * from tblLocation", dbOpenSnapshot, dbSeeChanges) If Err Then MsgBox intTheLimit & " is the max number of recordsets you can open" Else Set rstOpen = rst End If End Function Function TestTheLimit() Dim db As DAO.Database Dim col As Collection Dim intTheLimit As Integer Set db = CurrentDb Set col = New Collection On Error Resume Next While True intTheLimit = intTheLimit + 1 col.Add rstOpen(db, intTheLimit) Debug.Print intTheLimit DoEvents Wend End Function John W. Colby www.ColbyConsulting.com On 4/23/2011 8:20 AM, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master form > with 6 tabs. Each tab contains a subform that's bound to a query. Plus I > open recordsets on the the BE tables to fetch stuff for the form. You can > drill down from any subform to a detailed form by double-clicking a data > field. I started getting the above error message after opening 2 or 3 of > these forms, so I created a form handler method that shuts down the calling > form and closes all the DB connections before opening the target form. I'm > still getting that error. I've gone thru my code and diligently set all DBs > to nothing at the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how can I > monitor how many connections I have open at one time so I can diagnose the > problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > From accessd at shaw.ca Sat Apr 23 09:18:30 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 23 Apr 2011 07:18:30 -0700 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: Hi John: It is done via a process call screen-scraping and it can only be done using webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 11:14 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 09:25:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 07:25:26 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 23 10:10:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 11:10:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB2EBE4.7060009@colbyconsulting.com> > ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Uh... this kind of thing needs to be done many different places. It is rarely about "pick your tool to do this", rather "this app uses X tool, how do I do it there". This app uses Access / VBA. How do I do it there? Telling me to go off and rewrite my app in some other tool so that I can use that tool to do one tiny piece is... draconian. It turns out that there is an IE object which knows how to do most of this kind of thing, and can be automated from VBA. It is really a matter of studying that long enough to figure it out. John W. Colby www.ColbyConsulting.com On 4/23/2011 10:18 AM, Jim Lawrence wrote: > Hi John: > > It is done via a process call screen-scraping and it can only be done using > webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... > > ...and that is a whole different subject/environment/topic. ASP.Net would be > your best all around solution. > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 11:14 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Has anyone here ever figured out how to early bind the WebBrowser activeX > object? > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 10:40 AM, Michael Mattys wrote: >> John, >> >> OK, I think the best way to approach this is for you to visit >> http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp >> >> It took me an hour or two to get the right elements for my project >> and then lots more to loop through the relevant tables, rows, >> childnodes, and cells to get the right info. >> >> Basically, you want the href of the image and then it's a simple >> binary save object to file, thus >> >> http://www.devx.com/vb2themax/Tip/18441 >> >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, April 22, 2011 9:35 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] How do I Grab the picture from the web page >> >> Michael, >> >> Thanks. The web page I navigate to is as follows: >> >> > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 >> > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa >> ge=1 >> >> I literally replace the offenderID with the ID (called an OPUS number) of >> the inmate I am viewing or obtaining the record for. >> >> What you are viewing if you go to this link is an actual record of some >> inmate. Open this web page to view the html behind. >> >> Notice that the picture is obscured, with a "click to show photo" which I >> assume is actually a button? >> >> It is not that I need to get one or even several photos. I need the > *code* >> to do it from VBA, and I need to learn how it is done so I can do it again >> by myself. >> >> I would prefer to actually retrieve the photo to a file stored on disk, >> however I also want to learn how to click buttons (and enter data). >> >> The following is the actual search website. >> >> http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view >> >> I don't need it for this project because I can do a simple replace of the >> OPUS ID in that first string, but it would be good (for another project) > to >> know how I insert data into the controls and click the search button, how > to >> click the Clear Selection button etc. >> >> I currently use an ActiveX control inserted into a subform to retrieve >> pages, get the table collection etc. The web control is found by clicking >> the ellipsis in the toolbox bar in form design and going down until you >> find the Microsoft Web Browser control. >> >> I have found code in Google to do this other ways but this is the way I > have >> managed to get working. >> I wrote a class "wrapper" with methods that I call to parse out the > data. >> It is ugly but they apparently did not program the web site in a "nice" >> manner, tables just have one big long string etc. the following is the > code >> that I use to poke through the dozens of tables they use. >> >> Again, there might be an easier way but this is how I got it working. >> >> Function mSearchTable(wbbWebsite As Object) >> >> Dim varTables As Variant >> Dim varTable As Variant >> >> Dim strOffenderInfo As String >> Dim strMostRecent As String >> >> >> Set varTables = wbbWebsite.Document.All().tags("table") >> Set varTables = wbbWebsite.Document.All.tags("TABLE") >> For Each varTable In varTables >> >> Dim strInnerText As String >> strInnerText = varTable.innerText >> 'Use the innerText to see if this is the table we want. >> 'Debug.Print varTable.innerText >> >> If (InStr(strInnerText, "Offender Information")) And (Not >> mblnOffenderInfoFound) Then >> strOffenderInfo = strInnerText >> mParseInfoOffender strInnerText >> Else >> If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not >> mblnMostRecentInfoFound) Then >> strMostRecent = strInnerText >> mParseMostRecent strMostRecent >> End If >> >> End If >> Next varTable >> >> End Function >> >> So what I need is not a fish, but to learn *how* to fish. >> >> Any assistance gratefully accepted. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/22/2011 9:06 AM, Michael Mattys wrote: >>> Hi John, >>> >>> I've just finished a similar project for downloading all pdf and xls >>> from a site and the iron is still hot. >>> >>> I know its volunteer - just send the relevant access info to my >>> address and I'll get your pics for you. >>> >>> Michael R Mattys >>> Business Process Developers >>> www.mattysconsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From rockysmolin at bchacc.com Sat Apr 23 10:26:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 08:26:16 -0700 Subject: [AccessD] Autocorrect Dialog Box Message-ID: Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky From jwcolby at colbyconsulting.com Sat Apr 23 11:06:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 12:06:45 -0400 Subject: [AccessD] SQL Server times link as str Message-ID: <4DB2F915.1070407@colbyconsulting.com> I am linking to tables with date / time fields in SQL Server. The field in Access says it is a date. This appears to be causing all kinds of issues. I cannot see any way to intercept the link and tell the wizard that a specific field is a specific data type. Is there any way to fix this? -- John W. Colby www.ColbyConsulting.com From rockysmolin at bchacc.com Sat Apr 23 11:12:08 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:12:08 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: Message-ID: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 11:16:44 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:16:44 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> Message-ID: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Sat Apr 23 12:33:23 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 23 Apr 2011 10:33:23 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 12:57:11 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 10:57:11 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005><23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Bill: Not trying to set the autocorrect options but just trigger the dialog box so that the user can fiddle with it. Apparently, from what I've been able to find on the internets, it works in Excel - there's a constant for it in the Application.Dialogs object. But I can't find the equivalent for Access. Although, IME, anything you can do through the menus you can do through code. Since I can get that dialog box by clicking Tools-->AutoCorrectOptions in 2003 (there's a different sequence of course, in 2007) I'm thinking this has to be doable in code as well. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Patten Sent: Saturday, April 23, 2011 10:33 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 16:28:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:28:18 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB2F915.1070407@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com> Message-ID: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> What sort of issues? Is the SQL Server field a datetime or a smalldatetime? Using ODBC? What Client? AFAIK, Access doesn't have a "Date" field type, only a Date/Time -- Stuart On 23 Apr 2011 at 12:06, jwcolby wrote: > I am linking to tables with date / time fields in SQL Server. The > field in Access says it is a date. This appears to be causing all > kinds of issues. I cannot see any way to intercept the link and tell > the wizard that a specific field is a specific data type. Is there > any way to fix this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sat Apr 23 16:55:17 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:55:17 +1000 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <>, <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> >From everything that I have read, Access maintains TableIDs internally and the number currently used is not exposed in any way, so sadly it appears that the answer to your question is - You can't. -- Stuart On 23 Apr 2011 at 5:20, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master > form with 6 tabs. Each tab contains a subform that's bound to a query. > Plus I open recordsets on the the BE tables to fetch stuff for the > form. You can drill down from any subform to a detailed form by > double-clicking a data field. I started getting the above error > message after opening 2 or 3 of these forms, so I created a form > handler method that shuts down the calling form and closes all the DB > connections before opening the target form. I'm still getting that > error. I've gone thru my code and diligently set all DBs to nothing at > the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how > can I monitor how many connections I have open at one time so I can > diagnose the problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 17:16:51 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 18:16:51 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com> <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> Message-ID: <4DB34FD3.4050800@colbyconsulting.com> The SQL Server fields are time(0) and DateTime. It is picked up by Access as a string, IOW the field in design view of the linked table is a string. That probably happens because Access does not understand the miliseconds in the time, and AFAIK Access doesn't have a time field, only datetime. The issues are many but small, including weird displays of the values, necessity to convert to a date - cdate() - to do compares with other times (it converts to date just fine) and finally, I was trying to use the conditional display to color a date where it was <= date() + 180 (for example) and it just doesn't work, the colors do happen but there is no rhyme or reason to the colors. Things like that. So Access thinks it is a string, SQL Server thinks it is a date or time(0) and I am constantly fiddling with it to make it right. John W. Colby www.ColbyConsulting.com On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > What sort of issues? > > Is the SQL Server field a datetime or a smalldatetime? > Using ODBC? What Client? > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > From jimdettman at verizon.net Sat Apr 23 17:53:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 23 Apr 2011 18:53:33 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: 2048 is the table ID limit. While that sounds like a lot, every field reference carries a table I'd reference. Jim Sent from my iPhone On Apr 23, 2011, at 5:55 PM, "Stuart McLachlan" wrote: > From everything that I have read, Access maintains TableIDs internally and the number > currently used is not exposed in any way, so sadly it appears that the answer to your question > is - You can't. > > -- > Stuart > > On 23 Apr 2011 at 5:20, Darrell Burns wrote: > >> Howdy. First-time on AccessD. >> >> I've tried all the other forums and can't get an answer to this one. >> >> I have a FE A2007 app linked to a BE A2007 database. There's a master >> form with 6 tabs. Each tab contains a subform that's bound to a query. >> Plus I open recordsets on the the BE tables to fetch stuff for the >> form. You can drill down from any subform to a detailed form by >> double-clicking a data field. I started getting the above error >> message after opening 2 or 3 of these forms, so I created a form >> handler method that shuts down the calling form and closes all the DB >> connections before opening the target form. I'm still getting that >> error. I've gone thru my code and diligently set all DBs to nothing at >> the end of each sub, but I can't seem to lick the problem. >> >> >> >> Suggestions from other forums have been to unbind the tables from the >> subforms. I buy that, but the question I can't get an answer to is how >> can I monitor how many connections I have open at one time so I can >> diagnose the problem? I feel like I'm debugging in the dark. >> >> >> >> Please turn on the light for me. >> >> >> >> Thanx, >> >> Darrell >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 18:05:22 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 09:05:22 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34FD3.4050800@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> Message-ID: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not DateTime2 (also new in 2008)? Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to "down-level clients" as strings, rather than as the numerics which are used to store them, so you will have to parse then back to compatible Access datatypes yourself. See http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom patibilityforDownlevelClients "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data types added in SQL Server 2008. The following table shows the type mapping between an up-level instance of SQL Server 2008 and down-level clients." -- Stuart On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. That probably happens because Access does not understand > the miliseconds in the time, and AFAIK Access doesn't have a time > field, only datetime. > > The issues are many but small, including weird displays of the values, > necessity to convert to a date - cdate() - to do compares with other > times (it converts to date just fine) and finally, I was trying to use > the conditional display to color a date where it was <= date() + 180 > (for example) and it just doesn't work, the colors do happen but there > is no rhyme or reason to the colors. > > Things like that. > > So Access thinks it is a string, SQL Server thinks it is a date or > time(0) and I am constantly fiddling with it to make it right. > > John W. Colby > www.ColbyConsulting.com > > On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > > What sort of issues? > > > > Is the SQL Server field a datetime or a smalldatetime? > > Using ODBC? What Client? > > > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 18:11:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 19:11:42 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Message-ID: <4DB35CAE.20209@colbyconsulting.com> Thanks Stuart. I kinda figured I was screwed! ;) John W. Colby www.ColbyConsulting.com On 4/23/2011 7:05 PM, Stuart McLachlan wrote: > Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not > DateTime2 (also new in 2008)? > > Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to > "down-level clients" as strings, rather than as the numerics which are used to store them, so > you will have to parse then back to compatible Access datatypes yourself. > > See > http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom > patibilityforDownlevelClients > > "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data > types added in SQL Server 2008. The following table shows the type mapping between an > up-level instance of SQL Server 2008 and down-level clients." > From DWUTKA at Marlow.com Sat Apr 23 21:18:15 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 21:18:15 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Interesting. Not sure why 2007 would do anything different, but then again, it is 2007... LOL Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From gustav at cactus.dk Sun Apr 24 08:00:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2011 15:00:44 +0200 Subject: [AccessD] SQL Server times link as str Message-ID: Hi John What to do in such cases is to create a straight select query - an interface query - for this table only. Select all fields that come through all right; the remaining offending fields you convert or manipulate as needed. Your date field you could probably convert with CDate (or CVDate if zero length strings appear). Now use this query as source whenever your application have to pull data from the linked table. Of course, if you need to write to the linked table you will need another query to interface in the other direction. /gustav On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. .. From Chester_Kaup at kindermorgan.com Mon Apr 25 07:09:42 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 25 Apr 2011 07:09:42 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693D8D@houex1.kindermorgan.com> Thanks for the piece of code. I am going to keep it. The data is delimitated by a variable number of spaces. What I ended up doing was reading through the line and replacing double spaces with single spaces until there were no more double spaces. The split commend then worked. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Friday, April 22, 2011 3:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dhb at flsi.com Mon Apr 25 12:18:11 2011 From: dhb at flsi.com (Darrell Burns) Date: Mon, 25 Apr 2011 10:18:11 -0700 Subject: [AccessD] Tab control click event In-Reply-To: References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: <038701cc036c$c1856d40$449047c0$@com> Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB From rockysmolin at bchacc.com Mon Apr 25 12:58:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 10:58:36 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <><032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <40DAFC36A8754DC0B84338A405880D3A@HAL9005> Are you doing refresh or requery? If the refresh is because of a change on the previous page, can you refresh the data in the after update event of the control on the previous page that causes a change in the other pages? Then when the tab is clicked the data will already be refreshed. Or would that cause too much delay? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 13:00:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 11:00:49 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box Message-ID: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From andy at minstersystems.co.uk Mon Apr 25 14:06:32 2011 From: andy at minstersystems.co.uk (Andy Lacey) Date: Mon, 25 Apr 2011 20:06:32 +0100 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> Message-ID: <49C5A426F1974C2EAFCE2421DC6CF9B1@MINSTER> Hi Darrell Wouldn't just an Echo False and an Echo True around the Requery do it for you? Andy -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: 25 April 2011 18:18 To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Mon Apr 25 15:53:30 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 25 Apr 2011 13:53:30 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <000c01cc038a$e12db120$a3891360$@cox.net> Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 16:42:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 14:42:22 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <000c01cc038a$e12db120$a3891360$@cox.net> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> <000c01cc038a$e12db120$a3891360$@cox.net> Message-ID: <88183A49169647A0A40576475839C469@HAL9005> Come to think of it Doug, I did something like that on a tab form where I disappeared the tab and replaced it with a label, which looks nicer, you can format it, and has a Click event where you can do whatever and then set the focus to that page: Me.TabCtl140.Pages(1).SetFocus HTH Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 25, 2011 1:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Tab control click event Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Tue Apr 26 01:49:49 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 26 Apr 2011 16:49:49 +1000 Subject: [AccessD] Karen's Powertools Message-ID: <201104260653.p3Q6rCr3016190@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am sure a few of you have heard of or even user Karen's solutions. Got this today and maybe of interest for some of you. Very Sad '======== copied email follows =================== Dear Friends, I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. I know that Karen touched many of you with her kindness, wit, creativity and encouragement. She was a loving daughter, sister, aunt and friend. And she was a pretty darned good programmer, too. We are deeply grieving her loss. For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. We are also working to fill all CD orders that have been submitted or mailed. It is difficult to make business decisions while grieving. So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. Many of you have already written many kinds words of condolence and comfort. Please know that we greatly appreciate you. If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. You can learn more about them at www.DohnavurFellowship.org. All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. May God richly bless you, as He has all those who knew Karen. Bill Kenworthy Karen?s brother '============ end of copy ========= Regards Darryl _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From jwcolby at colbyconsulting.com Tue Apr 26 07:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 08:46:37 -0400 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: <4DB6BEAD.1000507@colbyconsulting.com> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Apr 26 08:08:45 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 26 Apr 2011 17:08:45 +0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Hi John -- Just importing everything into a new DB - wouldn't that be a solution to workaround the "bugger"? Is it MDE? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 26 ?????? 2011 ?. 16:47 To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Tue Apr 26 08:09:19 2011 From: garykjos at gmail.com (Gary Kjos) Date: Tue, 26 Apr 2011 08:09:19 -0500 Subject: [AccessD] Karen's Powertools In-Reply-To: <201104260653.p3Q6rCr3016190@databaseadvisors.com> References: <201104260653.p3Q6rCr3016190@databaseadvisors.com> Message-ID: Thanks for passing this sad news along Darryl. I have used some of Karen's tools over the years. GK On Tue, Apr 26, 2011 at 1:49 AM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > I am sure a few of you have heard of or even user Karen's solutions. ?Got this today and maybe of interest for some of you. ?Very Sad > > '======== copied email follows =================== > > Dear Friends, > > I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. ?It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. > > I know that Karen touched many of you with her kindness, wit, creativity and encouragement. ?She was a loving daughter, sister, aunt and friend. ?And she was a pretty darned good programmer, too. ?We are deeply grieving her loss. > > For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. ?We are also working to fill all CD orders that have been submitted or mailed. ?It is difficult to make business decisions while grieving. ?So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. > > Many of you have already written many kinds words of condolence and comfort. ?Please know that we greatly appreciate you. ?If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. ?You can learn more about them at www.DohnavurFellowship.org. > > All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. > > May God richly bless you, as He has all those who knew Karen. > > Bill Kenworthy > Karen?s brother > > '============ end of copy ========= > > Regards > Darryl > _______________________________________________________________________________________ > > The information transmitted in this message and its attachments (if any) is intended > only for the person or entity to which it is addressed. > The message may contain confidential and/or privileged material. Any review, > retransmission, dissemination or other use of, or taking of any action in reliance > upon this information, by persons or entities other than the intended recipient is > prohibited. > > If you have received this in error, please contact the sender and delete this e-mail > and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, disclose or distribute > the information contained in this e-mail and any attached files, with the permission > of the sender. > > This message has been scanned for viruses. > _______________________________________________________________________________________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From rockysmolin at bchacc.com Tue Apr 26 08:24:53 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 06:24:53 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <1D0DAC4651364E11BC5253FF51FB991E@HAL9005> Data in temp tables? Otherwise although a PITA, binary search. Import half the objects, see what the size is after C/R. Import half the remaining, etc. Eventually, you'll find the culprit. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 5:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Tue Apr 26 08:28:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 26 Apr 2011 09:28:33 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Create a new DB and import everything in. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 08:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 26 08:49:32 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 26 Apr 2011 08:49:32 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? From jwcolby at colbyconsulting.com Tue Apr 26 09:05:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:05:07 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <4DB6D113.3020906@colbyconsulting.com> Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution to > workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Tue Apr 26 09:14:49 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 26 Apr 2011 09:14:49 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6D113.3020906@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> What about a decompile then compact/repair? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution > to workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From dbdoug at gmail.com Tue Apr 26 09:17:25 2011 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 26 Apr 2011 07:17:25 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Any embedded graphics? Doug On Tue, Apr 26, 2011 at 7:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 26 09:29:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:29:47 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4DB6D6DB.4090509@colbyconsulting.com> I tried all of that, no help. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From Gustav at cactus.dk Tue Apr 26 09:38:55 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 26 Apr 2011 16:38:55 +0200 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: Hi John Then I guess you are left with the save-as-text and load-from-text method on all objects. /gustav >>> jwcolby at colbyconsulting.com 26-04-2011 16:29 >>> I tried all of that, no help. From john at winhaven.net Tue Apr 26 09:41:55 2011 From: john at winhaven.net (John Bartow) Date: Tue, 26 Apr 2011 09:41:55 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Even jpegs seem to increase the size far too much if one would accidently or otherwise paste a exe, dll, wmv or something into a form I'd imagine it would get huge. Check the forms and reports over and remove any ole objects or embedded images. Then decompile, compact, compile, compact. If that accomplishes nothing then I'd import it into a new db. Best of luck, John B BTW have you tried running Eatbloat on it? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 7:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 11:07:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 12:07:39 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> Message-ID: <4DB6EDCB.1090202@colbyconsulting.com> >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in one > of the forms or report. Even jpegs seem to increase the size far too much if > one would accidently or otherwise paste a exe, dll, wmv or something into a > form I'd imagine it would get huge. Check the forms and reports over and > remove any ole objects or embedded images. Then decompile, compact, compile, > compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Tue Apr 26 11:47:20 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 12:47:20 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Tue Apr 26 12:53:46 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 26 Apr 2011 12:53:46 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6EDCB.1090202@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> Message-ID: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> John, I made and have been testing an essentially one-click access utility which will do export to text and import from text of all the objects except tables. Do you want to try it? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 11:08 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. Even jpegs seem to increase the size far > too much if one would accidently or otherwise paste a exe, dll, wmv or > something into a form I'd imagine it would get huge. Check the forms > and reports over and remove any ole objects or embedded images. Then > decompile, compact, compile, compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 13:01:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 11:01:16 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Tue Apr 26 13:05:06 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 14:05:06 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 15:41:30 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 13:41:30 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: beautiful -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 11:05 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 21:59:24 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 22:59:24 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> Message-ID: <4DB7868C.4080705@colbyconsulting.com> sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility which > will do export to text and import from text of all the objects except > tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever in >> one of the forms or report. Even jpegs seem to increase the size far >> too much if one would accidently or otherwise paste a exe, dll, wmv or >> something into a form I'd imagine it would get huge. Check the forms >> and reports over and remove any ole objects or embedded images. Then >> decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jengross at gte.net Wed Apr 27 17:40:29 2011 From: jengross at gte.net (Jennifer Gross) Date: Wed, 27 Apr 2011 15:40:29 -0700 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <007b01cc052c$1d002370$1201a8c0@Schroeder> Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title? .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Apr 28 00:38:39 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 28 Apr 2011 09:38:39 +0400 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: Hi Chester -- Your code works here well - MS Access/Office 2003. What code line does report Error 430 on your system? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: 26 ?????? 2011 ?. 17:50 To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 07:20:41 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 07:20:41 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <007b01cc052c$1d002370$1201a8c0@Schroeder> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <007b01cc052c$1d002370$1201a8c0@Schroeder> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20412@houex1.kindermorgan.com> Thanks for the code example. I am going to keep it. Turns out the problem was I had to reregister DAO 3.6 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jennifer Gross Sent: Wednesday, April 27, 2011 5:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Copy recordset to excel spreadsheet Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title" .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 28 10:18:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 28 Apr 2011 08:18:01 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: having a "ODBC - Call failed" message from A97 when running the code below. RTE is a long var. code generates no errors up to the last line. I can link to tables using the log on info and password successfully. any ideas?? 'populate the object variables Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, CONNECT_STR) conTest.QueryTimeout = 0 'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE From davidmcafee at gmail.com Thu Apr 28 11:04:07 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 28 Apr 2011 09:04:07 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) > DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jm.hwsn at gmail.com Thu Apr 28 12:00:04 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 12:00:04 -0500 Subject: [AccessD] Field Level AES Encryption Message-ID: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim From Lambert.Heenan at chartisinsurance.com Thu Apr 28 12:35:53 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 13:35:53 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Thu Apr 28 13:19:11 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 13:19:11 -0500 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Thu Apr 28 13:55:59 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 14:55:59 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Message-ID: Well that's different then. :-) Access 2007 huh? Still plodding along with A2003 here. No security at all really. :-) Thanks again for the information. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 2:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Field Level AES Encryption Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 14:38:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 14:38:26 -0500 Subject: [AccessD] Acrobat question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20572@houex1.kindermorgan.com> Will this code work with Acrobat reader or is a full version necessary? Dim AcroXApp As Object Dim AcroXAVDoc As Object Dim AcroXPDDoc As Object Set AcroXApp = CreateObject("AcroExch.App") AcroXApp.Hide Set AcroXAVDoc = CreateObject("AcroExch.AVDoc") AcroXAVDoc.Open PDF_PATH & filename, "Acrobat" AcroXAVDoc.BringToFront Set AcroXPDDoc = AcroXAVDoc.GetPDDoc Dim jsObj As Object Set jsObj = AcroXPDDoc.GetJSObject jsObj.SaveAs OUTPUT_PATH & OutputFile, "com.adobe.acrobat.plain-text" AcroXAVDoc.Close False AcroXApp.Hide AcroXApp.Exit Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From newsgrps at dalyn.co.nz Thu Apr 28 15:09:14 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 29 Apr 2011 08:09:14 +1200 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) >DoEvents >conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 28 15:10:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Apr 2011 16:10:20 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4DB9C9AC.9060400@colbyconsulting.com> Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > From ab-mi at post3.tele.dk Thu Apr 28 16:21:16 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Thu, 28 Apr 2011 23:21:16 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DB9C9AC.9060400@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: How do you create the hash - any generator to recommend? Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 28. april 2011 22:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:00:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:00:07 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBAD277.8080507@colbyconsulting.com> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 ' Can be used freely even for commercial applications ' ' MS Access 97 version by ' Gustav Brock, Cactus Data ApS ' gustav at cactus.dk ' ' 2002-03-09. V1.0 ' Initial port from Visual Basic. ' 2002-06-23. V1.1 ' Code clean up and constants added. ' Redundant code removed. ' Modified to fully comply with VB datatypes. ' Modified to not crash for certain passwords. ' Modified for high speed conversion of long strings ( > 32K). ' 2002-06-24. V1.2 ' Functions added for en/decrypting to/from binary strings. ' Usage: ' SetPassword(password) sets password prior to en/decryption. ' GetPassword() retrieves current password. ' StrEncrypt(DecryptedString) returns encrypted ascii string. ' StrDecrypt(EncryptedString_ascii) returns decrypted string. ' StrEncryptBin(DecryptedString) returns encrypted binary string. ' StrDecryptBin(EncryptedString_binary) returns decrypted string. ' ' Encrypted ascii string is twice the length of the decrypted string. ' Encrypted ascii string contains low ascii chars from a to p only. ' Encrypted binary string is same length as the decrypted string. ' Encrypted binary string may contain any char including Chr(0). ' Password may contain any ascii char including Chr(0). ' Password is maintained in global variable strPC1Password16. Private Const clngHexMax As Long = &H10 Private Const clngBytMax As Long = &H100 ' Maximum value of unsigned Integer. Private Const clngIntMax As Long = &H10000 ' clngAscMin defines beginning of a 16 letter range from a to p. Private Const clngAscMin As Long = &H61 Private strPC1Password16 As String * clngHexMax Private x1a0(9) As Long Private cle(17) As Long Private x1a2 As Long Private lngInt As Long Private lngRes As Long Private lngTmp As Long Private ax As Long Private bx As Long Private cx As Long Private dx As Long Private si As Long Private i As Long Private c As Long Private d As Long Private e As Long Private strEncrypted As String Private strDecrypted As String Public Function SetPassword(ByRef strPassword As String) As Integer Dim intPasswordLength As Integer ' Remove leading and trailing spaces from password. strPassword = Trim(strPassword) ' Set global variable and limit password to fixed length of 16 characters. strPC1Password16 = strPassword ' Find and return net length of password. intPasswordLength = Len(strPassword) SetPassword = intPasswordLength End Function Public Function GetPassword() As String ' Get global variable strPC1Password16. GetPassword = RTrim(strPC1Password16) End Function Public Function StrEncrypt(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(False) StrEncrypt = strEncrypted End Function Public Function StrDecrypt(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(False) StrDecrypt = strDecrypted End Function Public Function StrEncryptBin(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(True) StrEncryptBin = strEncrypted End Function Public Function StrDecryptBin(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(True) StrDecryptBin = strDecrypted End Function Private Sub Encrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strDecrypted lngX = Len(strX) strEncrypted = Space(lngX * (2 - Abs(booBinary))) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX c = Asc(mID(strX, lngN, 1)) ' Calculate lngInt. Call Assemble lngC = lngInt \ clngBytMax lngD = lngInt Mod clngBytMax For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM c = c Xor (lngC Xor lngD) If booBinary = False Then ' Build ascii string. d = (c \ clngHexMax) Mod clngHexMax e = c Mod clngHexMax ' clngAscMin + d gives one letter range from a to p for the 4 high bits of c. ' clngAscMin + e gives one letter range from a to p for the 4 low bits of c. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, (lngN * 2) - 1, 1) = Chr(clngAscMin + d) Mid(strEncrypted, (lngN * 2) - 0, 1) = Chr(clngAscMin + e) Else ' Build binary string. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, lngN, 1) = Chr(c) End If Next lngN End Sub Private Sub Decrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strEncrypted lngX = Len(strX) \ (2 - Abs(booBinary)) strDecrypted = Space(lngX) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX If booBinary = False Then d = Asc(mID(strX, (lngN * 2) - 1, 1)) If d >= clngAscMin Then ' Transform the letter to the 4 high bits of c. d = d - clngAscMin If d < clngHexMax Then d = d * clngHexMax End If End If e = Asc(mID(strX, (lngN * 2) - 0, 1)) If e >= clngAscMin Then ' Transform the letter to the 4 low bits of c. e = e - clngAscMin If e < clngHexMax Then c = d + e End If End If Else c = Asc(mID(strX, lngN, 1)) End If ' Calculate lngInt. Call Assemble lngC = (lngInt \ clngBytMax) Mod clngBytMax lngD = lngInt Mod clngBytMax c = c Xor (lngC Xor lngD) For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM ' Perform high speed insertion of decrypted character. Mid(strDecrypted, lngN, 1) = Chr(c) Next lngN End Sub Private Sub Assemble() Dim lngM As Long Dim lngN As Long x1a0(0) = ((cle(1) * clngBytMax) + cle(2)) Mod clngIntMax Call Code lngInt = lngRes For lngM = 1 To (clngHexMax / 2) - 1 lngN = lngM * 2 x1a0(lngM) = x1a0(lngM - 1) Xor ((cle(lngN + 1) * clngBytMax) + cle(lngN + 2)) Call Code lngInt = lngInt Xor lngRes Next lngM i = 0 End Sub Private Sub Code() Const clngKeyB As Long = &H4E35 Const clngKeyC As Long = &H15A dx = (x1a2 + i) Mod clngIntMax ax = x1a0(i) cx = clngKeyC bx = clngKeyB lngTmp = ax ax = si si = lngTmp lngTmp = ax ax = dx dx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax End If lngTmp = ax ax = cx cx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (si Mod clngIntMax)) Mod clngIntMax cx = (ax + cx) Mod clngIntMax End If lngTmp = ax ax = si si = lngTmp ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax dx = (cx + dx) Mod clngIntMax ax = ax + 1 x1a2 = dx x1a0(i) = ax lngRes = ax Xor dx i = i + 1 End Sub John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger From Gustav at cactus.dk Fri Apr 29 10:07:53 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:07:53 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 From jm.hwsn at gmail.com Fri Apr 29 10:14:26 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 10:14:26 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Which is the similar to using the strConv function in Access to store the data in Unicode. It's unreadable but not really secure. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2011 10:08 AM To: accessd at databaseadvisors.com Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:30:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:30:05 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> References: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Message-ID: <4DBAD97D.3030905@colbyconsulting.com> Well... I am thinking it is waaaaay more secure than that. John W. Colby www.ColbyConsulting.com On 4/29/2011 11:14 AM, jm.hwsn wrote: > Which is the similar to using the strConv function in Access to store the > data in Unicode. > It's unreadable but not really secure. > Thanks, > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2011 10:08 AM > To: accessd at databaseadvisors.com > Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit > ordering on the key (and remove the parity bits) before starting the first > round of the non-invertible s-boxes. These are also left-rotated between > each round (by 1 or 2 bits, in a non-regular pattern) to form what is > commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a > code Alexander Pukall designed himself - and which is widely regarded as > insecure. Pukall shouldn't really have chosen the same name as the DES key > schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text > non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From jwcolby at colbyconsulting.com Fri Apr 29 10:36:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:36:16 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBADAF0.7060304@colbyconsulting.com> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From Gustav at cactus.dk Fri Apr 29 10:46:08 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:46:08 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi John Yes, here: http://www.frez.co.uk/vb6.aspx /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:36 >>> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 From jwcolby at colbyconsulting.com Fri Apr 29 11:41:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 12:41:59 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBAEA57.60602@colbyconsulting.com> Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From jm.hwsn at gmail.com Fri Apr 29 11:48:27 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 11:48:27 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4DBAEA57.60602@colbyconsulting.com> References: <4DBAEA57.60602@colbyconsulting.com> Message-ID: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 29 11:53:28 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 18:53:28 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi Jim Sorry, missed that, I have followed this thread with half an eye only. Anyway, the circle is closed! /gustav >>> jm.hwsn at gmail.com 29-04-2011 18:48 >>> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From df.waters at comcast.net Fri Apr 29 11:57:50 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 29 Apr 2011 11:57:50 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB7868C.4080705@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> Message-ID: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> John - how did it go? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility > which will do export to text and import from text of all the objects > except tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or > whatever in one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever >> in one of the forms or report. Even jpegs seem to increase the size >> far too much if one would accidently or otherwise paste a exe, dll, >> wmv or something into a form I'd imagine it would get huge. Check the >> forms and reports over and remove any ole objects or embedded images. >> Then decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >> 1 report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 12:16:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:16:47 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> References: <4DBAEA57.60602@colbyconsulting.com> <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> Message-ID: <4DBAF27F.9030303@colbyconsulting.com> LOL, I wasn't following this thread closely. In fact I only spoke up to recommend the hash method. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:48 PM, jm.hwsn wrote: > That's the site I emailed earlier. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 29, 2011 11:42 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Wow is that awesome! > > Thanks! > > John W. Colby > www.ColbyConsulting.com > > On 4/29/2011 11:46 AM, Gustav Brock wrote: >> Hi John >> >> Yes, here: >> >> http://www.frez.co.uk/vb6.aspx >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> >> Thanks for the heads up on that. Have you by any chance found an > opensource for this that is considered secure? >> >> John W. Colby >> www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 29 12:17:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:17:53 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> Message-ID: <4DBAF2C1.5020007@colbyconsulting.com> Well... I haven't managed to address this yet. The last few days were pure overload. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:57 PM, Dan Waters wrote: > John - how did it go? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > sure. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 1:53 PM, Dan Waters wrote: >> John, >> >> I made and have been testing an essentially one-click access utility >> which will do export to text and import from text of all the objects >> except tables. Do you want to try it? >> >> Dan >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 11:08 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Access 2003 - 50 meg FE >> >> >>> First thing that comes to mind is an ole object - image or >> whatever in one of the forms or report. >> >> Hmm... I do have an activeX control for the IE object. >> >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/26/2011 10:41 AM, John Bartow wrote: >>> First thing that comes to mind is an ole object - image or whatever >>> in one of the forms or report. Even jpegs seem to increase the size >>> far too much if one would accidently or otherwise paste a exe, dll, >>> wmv or something into a form I'd imagine it would get huge. Check the >>> forms and reports over and remove any ole objects or embedded images. >>> Then decompile, compact, compile, compact. >>> >>> If that accomplishes nothing then I'd import it into a new db. >>> >>> Best of luck, >>> John B >>> >>> BTW have you tried running Eatbloat on it? >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Tuesday, April 26, 2011 7:47 AM >>> To: Access Developers discussion and problem solving >>> Subject: [AccessD] Access 2003 - 50 meg FE >>> >>> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >>> 1 report, a handful of classes and modules. >>> >>> The bugger is 50 megs and won't shrink down when I compact / repair. >>> It should probably be a couple of megs. >>> >>> Has anyone run across anything I should be looking at? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Apr 30 09:40:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 30 Apr 2011 10:40:18 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBC1F52.3070807@colbyconsulting.com> I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com From ab-mi at post3.tele.dk Sat Apr 30 12:37:44 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Sat, 30 Apr 2011 19:37:44 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DBC1F52.3070807@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> <4DBC1F52.3070807@colbyconsulting.com> Message-ID: <670A825F36374733BC58BE25C5DFA4F3@abpc> Thanks for the explanation, John. Could you perhaps send me your hash generator offline - I would appreciate much. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 30. april 2011 16:40 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:03:53 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:03:53 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <9FE47E35DFB047C28D1FD535A4A2FE1B@Seven> thx for responding. I could not get that code to work. been a long time since A97 anyone else? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 28, 2011 9:04 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A97 SQL Server It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, > True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:04:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:04:39 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <356F885A526D46519BE17F64C1E07317@Seven> thanks, but no, that did not help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 28, 2011 1:09 PM To: Access Developers discussion and problem solving; 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A97 SQL Server Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, >True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute >"EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 00:00:18 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 31 Mar 2011 22:00:18 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <201103312301.p2VN0u1M028069@databaseadvisors.com> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> Message-ID: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Our clock numbering system was invented by the ancient Symmerians, 3000+ years ago, so why should we change now? It is simple as everything is calculated on 12s and 60s... |-P Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter I remember when New Zealand went metric with its currency back in the '70s. A friend was going overseas and was told by another friend that we were changing over to metric time next and was asked if could he bring back a metric watch. -- Stuart On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > Metric dates...hmm... 10 days per week, then? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > > ______________________________________________________________________ > ______ ___________ > > Note: This e-mail is subject to the disclaimer contained at the bottom > of this message. > ______________________________________________________________________ > ______ ___________ > > > > Hi Rocky, > > To avoid these sort of issues I use dateserial on each and every date > I process in SQL / VBA to make sure they line up correctly. Also from > memory the VBE treats all dates passed in VBA as American format as > default, regardless of the PC's regional setting. Coming from the land > of "dd-mm-yyyy" as standard it is an issue I need to deal with a lot. > > Now, if only you pesky Americans got with the program, used a proper > date format and just swallowed your pride and admit the French were > right and adopt the (far superior) metric system it would make life > for the rest of the planet much easier. ;) > > cheers > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > discussion and problem solving' Subject: Re: [AccessD] Un-American > Date Filter > > Doug: > > When I change the code to > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > And > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > the sql statement still comes out: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate > >= #31/03/2011# AND DueDate <= #07/04/2011# > > And still no date filtering. > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > Hi Rocky: > > I've dealt with this in the past by forcing the date format to > mm/dd/yy in the SQL, something like: > > WHERE DueDate >= Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > Doug > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > wrote: > Dear List: > > I create a temp table > using a SQL statement I construct in code to > incorporate various > filter - one of which is a date filter. > > Works well here but when I > send it to the user in Bahrain who's > regional setting is (I assume > from the screen shot he sent) English > U.K. where the date format is > dd/mm/yyyy it fails. ?I set my regional > settings on my box to U.K. > and sure enough it fails - returns all > records with no date > filtering. > > Here's the SQL statement that creates the table: > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue > ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand ?WHERE DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed to > filter out any record in tblDemand where the Due > Date is outside of > the range March 31 to April 7. ?But it don't. > > When I look in > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > doesn't this work? ?Should I be using some kind of different > syntax > for this filter? > > MTIA > > > Rocky Smolin > > Beach Access Software > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > www.bchacc.com > > > > > > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ______________________________________________________________________ > ______ ___________ > > The information transmitted in this message and its attachments (if > any) is intended only for the person or entity to which it is > addressed. The message may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, > or taking of any action in reliance upon this information, by persons > or entities other than the intended recipient is prohibited. > > If you have received this in error, please contact the sender and > delete this e-mail and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, > disclose or distribute the information contained in this e-mail and > any attached files, with the permission of the sender. > > This message has been scanned for viruses. > ______________________________________________________________________ > ______ ___________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Fri Apr 1 00:10:28 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Fri, 1 Apr 2011 18:10:28 +1300 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: <759994F1FF5140A1B7081212566A9630@HAL9005><201103312301.p2VN0u1M028069@databaseadvisors.com> Message-ID: Rocky, I always convert dates in code to Long. That way it always works regardless of the locale. I find it simpler like that. ... WHERE DueDate >= " & CLng(Me.txtGEDueDate) & " AND DueDate <= " & CLng(Me.txtLEDueDate) Or preferably... ... WHERE DueDate Between " & CLng(Me.txtGEDueDate) & " And " & CLng(Me.txtLEDueDate) Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, April 01, 2011 12:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Un-American Date Filter When I change the code to "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" And "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" the sql statement still comes out: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# And still no date filtering. From stuart at lexacorp.com.pg Fri Apr 1 00:30:47 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:30:47 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, , <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> Message-ID: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > From stuart at lexacorp.com.pg Fri Apr 1 00:36:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:36:51 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg>, <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Message-ID: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Simple - if you have six digits on each hand. or even better five limbs in total with 12 fingers/toes on each. :-) -- Stuart On 31 Mar 2011 at 22:00, Jim Lawrence wrote: > Our clock numbering system was invented by the ancient Symmerians, > 3000+ years ago, so why should we change now? It is simple as > everything is calculated on 12s and 60s... |-P > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > I remember when New Zealand went metric with its currency back in the > '70s. > > A friend was going overseas and was told by another friend that we > were changing over to metric time next and was asked if could he bring > back a metric watch. > > -- > Stuart > > > On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > > > Metric dates...hmm... 10 days per week, then? > > > > Rocky > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > > > ____________________________________________________________________ > > __ ______ ___________ > > > > Note: This e-mail is subject to the disclaimer contained at the > > bottom of this message. > > ____________________________________________________________________ > > __ ______ ___________ > > > > > > > > Hi Rocky, > > > > To avoid these sort of issues I use dateserial on each and every > > date I process in SQL / VBA to make sure they line up correctly. > > Also from memory the VBE treats all dates passed in VBA as American > > format as default, regardless of the PC's regional setting. Coming > > from the land of "dd-mm-yyyy" as standard it is an issue I need to > > deal with a lot. > > > > Now, if only you pesky Americans got with the program, used a proper > > date format and just swallowed your pride and admit the French were > > right and adopt the (far superior) metric system it would make life > > for the rest of the planet much easier. ;) > > > > cheers > > Darryl. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > > discussion and problem solving' Subject: Re: [AccessD] Un-American > > Date Filter > > > > Doug: > > > > When I change the code to > > > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > > > And > > > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > > > the sql statement still comes out: > > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE > > DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > > > And still no date filtering. > > > > R > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug > > Steele Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > Hi Rocky: > > > > I've dealt with this in the past by forcing the date format to > > mm/dd/yy in the SQL, something like: > > > > WHERE DueDate >= > > Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > > > Doug > > > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > > wrote: > Dear List: > > I create a temp > > table using a SQL statement I construct in code to > incorporate > > various filter - one of which is a date filter. > > Works well here > > but when I send it to the user in Bahrain who's > regional setting > > is (I assume from the screen shot he sent) English > U.K. where the > > date format is dd/mm/yyyy it fails. ?I set my regional > settings on > > my box to U.K. and sure enough it fails - returns all > records with > > no date filtering. > > Here's the SQL statement that creates the > > table: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, > > DueDate, > QuantityDue > ) SELECT tblDemand.PartNumber, > > tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue > > FROM tblDemand ?WHERE DueDate > > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed > > > >to > > filter out any record in tblDemand where the Due > Date is outside > > of the range March 31 to April 7. ?But it don't. > > When I look in > > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > > doesn't this work? ?Should I be using some kind of different > > > syntax for this filter? > > MTIA > > > Rocky Smolin > > Beach Access > > Software > > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > > www.bchacc.com > > > > > > > > > > > > -- > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > > http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > ____________________________________________________________________ > > __ ______ ___________ > > > > The information transmitted in this message and its attachments (if > > any) is intended only for the person or entity to which it is > > addressed. The message may contain confidential and/or privileged > > material. Any review, retransmission, dissemination or other use of, > > or taking of any action in reliance upon this information, by > > persons or entities other than the intended recipient is prohibited. > > > > If you have received this in error, please contact the sender and > > delete this e-mail and associated material from any computer. > > > > The intended recipient of this e-mail may only use, reproduce, > > disclose or distribute the information contained in this e-mail and > > any attached files, with the permission of the sender. > > > > This message has been scanned for viruses. > > ____________________________________________________________________ > > __ ______ ___________ > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:38:39 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:38:39 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: Yes, you bet. In Canada, April Fool's day rules!! Doug On Thu, Mar 31, 2011 at 10:30 PM, Stuart McLachlan wrote: > dd Mmm yyyy .... in sequential order. ?(?) > > You mean "01 Apr 2011" ?comes before "01 Jan 2011" ?in your calendar? > > -- > Stuart > > On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > >> Actually, our government (federal and provincial) uses yyyymmdd which >> sorts as a string, a number or as a date without any translation. The >> other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there >> is never any confusion between month and day...and again everything is >> in sequential order. >> >> Jim >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:43:16 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:43:16 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Message-ID: Well, Jim Lawrence & I are directly in line with the output from Fukushima Daiichi, so that's a distinct possibility for the future. On Thu, Mar 31, 2011 at 10:36 PM, Stuart McLachlan wrote: > Simple - ?if you have six digits on each hand. > > or even better five limbs in total with 12 fingers/toes on each. From davidmcafee at gmail.com Fri Apr 1 09:31:45 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 07:31:45 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> References: <757F90EAE81B4D8587C1948BA52F0E6D@nant> <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> Message-ID: That's how I do it Sent from my Droid phone. On Mar 31, 2011 9:46 PM, "Jim Lawrence" wrote: > How does everyone connect to their data on their SQL server? > > I have never done any other method than by passing parameters and calling > the appropriate SP. Does everyone else actually just send sql strings? > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, March 31, 2011 3:40 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Un-American Date Filter > > That is, unless the backend may be SQL Server, in which case, the > delimiter is a single quote. We used to run into that issue in .Net, > so we built a function to return the date string formatted with the > correct delimiter depending on which database was in use. Easy enough > to create a function to format any date to US format as well. > > Charlotte Foust > > On Thu, Mar 31, 2011 at 2:58 PM, Shamil Salakhetdinov > wrote: >> Hi Rocky -- > >> Of course date string used in SQL expression in American format should be >> enclosed in a pair of '#' symbols - #04/01/2011# .... >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 10:47:26 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 1 Apr 2011 08:47:26 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: <152C372724D34FF3BA3B91793BA65146@creativesystemdesigns.com> It was a date format for human viewing; a number delimitated by letters and then numbers again...found to be the best standard and for easy reading, because of its symmetry and order. OTOH if given a date like 03/06/11, no one will ever know whether it is referring to the Mar 06 1911 or 03 Jun 1911 or Mar 06 2011 or 03 Jun 2011. Worked on a government project to bring all the old data into the computers. When I left 6 months later they were still working on it. With no standards and mixed formats many dates had to be interpeted by manually going through related files. I understand that people are still working on the project and that was almost 15 years ago. ;-) We know of a friend who is tasked with translating of church records which go back over a thousand years...too bad there were no stanadrds in the parishes. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 10:31 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 1 12:37:43 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 01 Apr 2011 19:37:43 +0200 Subject: [AccessD] Un-American Date Filter Message-ID: Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From davidmcafee at gmail.com Fri Apr 1 13:37:04 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 11:37:04 -0700 Subject: [AccessD] Weird issues with one user Message-ID: I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub From iggy at nanaimo.ark.com Fri Apr 1 16:31:40 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Fri, 01 Apr 2011 13:31:40 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D96443C.9090400@nanaimo.ark.com> Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. From rockysmolin at bchacc.com Fri Apr 1 15:56:51 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 13:56:51 -0700 Subject: [AccessD] Can it be done? In-Reply-To: References: Message-ID: <3E670D818042446CB0D4BC865203BB45@HAL9005> Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 1 16:00:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 14:00:02 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: Message-ID: <352C74FE2635434CA41704AD49475FAB@HAL9005> Demonstrating once again why I've been on this list for lo these many years. I'm going to be doing a lot of scheduling work for this client over in Bahrain in the coming months - Creating a whole shop floor scheduling and control system for them - very date intensive. "I pity the fool who's not a member of AccessD" - Mr. T. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 01, 2011 10:38 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Un-American Date Filter Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Fri Apr 1 16:03:15 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Fri, 1 Apr 2011 14:03:15 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: References: Message-ID: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Hi David, A couple of suggestions that might help you determine if your Modal idea is in fact the problem. In form frm_002D_Company open event try setting focus to an enabled control, this should bring it to the front. Since you you have a parameter declared to pass the name of the calling form, perhaps you could add code to hide the calling form in the on load or on open event of frm_002D_Company and then un hide it on form close. HTH Bill -------------------------------------------------- From: "David McAfee" Sent: Friday, April 01, 2011 11:37 AM To: "Access Developers discussion and problem solving" Subject: [AccessD] Weird issues with one user I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 1 16:06:29 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:06:29 -0500 Subject: [AccessD] Can it be done? In-Reply-To: <3E670D818042446CB0D4BC865203BB45@HAL9005> References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Glad it worked perfectly for you! That's what I like to hear about my sample systems. ;) I wonder if MS ever looked at it. Years ago this came up, it was Susan that wanted it, because she was copying and pasting data from the web into an Access form, and wanted the form to always be on top. MS's knowledge base had an article using a form timer... I submitted my solution to them, never heard back. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 01, 2011 3:57 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Can it be done? Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ssharkins at gmail.com Fri Apr 1 16:19:00 2011 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 1 Apr 2011 17:19:00 -0400 Subject: [AccessD] Can it be done? References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > From DWUTKA at Marlow.com Fri Apr 1 16:21:40 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:21:40 -0500 Subject: [AccessD] Can it be done? In-Reply-To: References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: That is true, we did! LOL. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 01, 2011 4:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From df.waters at comcast.net Fri Apr 1 16:24:59 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 1 Apr 2011 16:24:59 -0500 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> References: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <007301cbf0b3$41e65f20$c5b31d60$@comcast.net> Boy do I agree with this! I only occasionally create a pivot query. So, I just start with one I've already done and keep tweaking it until it does what I want. It's the fastest way for me. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Friday, April 01, 2011 4:32 PM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 1 23:54:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 00:54:06 -0400 Subject: [AccessD] Word document merge Message-ID: <4D96ABEE.3050501@colbyconsulting.com> I am setting up a word document merge. The document has a "parent / child" or parent / detail format. This is a state document and it needs to look like they give it to me. FName LName From date From time From time From date From time From time From date From time From time Pickup time Return time Signature The form has room for three date time parts, the rest is just once per document. Is this possible with Mail Merge? Do I need to "automate" this by pushing the data into it a field at a time? The form will be filled out and printed, then faxed - or printed to a fax printer. On that note, can I insert a signature picture somehow? TIA for any assistance in this. -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Sat Apr 2 00:11:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 02 Apr 2011 15:11:55 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D96ABEE.3050501@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com> Message-ID: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Are these "one-off" documents, or do you process several in one run? -- Stuart On 2 Apr 2011 at 0:54, jwcolby wrote: > I am setting up a word document merge. The document has a "parent / > child" or parent / detail format. This is a state document and it > needs to look like they give it to me. > > FName LName > > From date From time From time > From date From time From time > From date From time From time > > Pickup time Return time > > Signature > > The form has room for three date time parts, the rest is just once per > document. > > Is this possible with Mail Merge? Do I need to "automate" this by > pushing the data into it a field at a time? > > The form will be filled out and printed, then faxed - or printed to a > fax printer. > > On that note, can I insert a signature picture somehow? > > TIA for any assistance in this. > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 09:48:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 10:48:54 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com> <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Message-ID: <4D973756.2030605@colbyconsulting.com> Stuart, > Are these "one-off" documents, or do you process several in one run? I am starting to check inmates out of the local camp for AA meetings, church and the like. This is the checkout document that I have to fill out for each time I check someone out. So I will be filling out a checkout parent/child recordset for each inmate for each time I will check them out. I can never check out more than three inmates at a time, so I might fill out for one inmate for church, and two for an AA meeting on Tuesday. Like that. Actually I eventually figured it out. I am using bookmarks and inserting data in the bookmarks. I think the way it will work is that I will have a button on the form where I fill out the data. fill one "checkout", print it, do the next, print it. I have to sign these and then fax them to the prison. I would like to eventually have a signature gif which I insert into the document, and eventually fax them straight out of my machine. John W. Colby www.ColbyConsulting.com On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > Are these "one-off" documents, or do you process several in one run? > From stuart at lexacorp.com.pg Sat Apr 2 09:57:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 03 Apr 2011 00:57:24 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D973756.2030605@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> Message-ID: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) Do you need to insert the signature at print time, or can you just put it in the blank template document? I generally do the latter. -- Stuart On 2 Apr 2011 at 10:48, jwcolby wrote: > Stuart, > > > Are these "one-off" documents, or do you process several in one > run? > > I am starting to check inmates out of the local camp for AA meetings, > church and the like. This is the checkout document that I have to > fill out for each time I check someone out. So I will be filling out > a checkout parent/child recordset for each inmate for each time I will > check them out. I can never check out more than three inmates at a > time, so I might fill out for one inmate for church, and two for an AA > meeting on Tuesday. Like that. > > Actually I eventually figured it out. I am using bookmarks and > inserting data in the bookmarks. I think the way it will work is that > I will have a button on the form where I fill out the data. fill one > "checkout", print it, do the next, print it. > > I have to sign these and then fax them to the prison. I would like to > eventually have a signature gif which I insert into the document, and > eventually fax them straight out of my machine. > > John W. Colby > www.ColbyConsulting.com > > On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > > Are these "one-off" documents, or do you process several in one run? > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 10:20:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:20:47 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> Message-ID: <4D973ECF.7070301@colbyconsulting.com> Well... I am intending to share the app so "at print time" is the best solution. John W. Colby www.ColbyConsulting.com On 4/2/2011 10:57 AM, Stuart McLachlan wrote: > That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) > > Do you need to insert the signature at print time, or can you just put it in the blank template > document? I generally do the latter. > From jwcolby at colbyconsulting.com Sat Apr 2 10:37:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:37:07 -0400 Subject: [AccessD] datatype Time(7) precision Message-ID: <4D9742A3.8050002@colbyconsulting.com> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. -- John W. Colby www.ColbyConsulting.com From iggy at nanaimo.ark.com Sat Apr 2 11:55:30 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Sat, 02 Apr 2011 08:55:30 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D975502.6050102@nanaimo.ark.com> Hey All This is incredible if it wasn't so sad. Been fooling around with the Pivot Tables in Access 2003. I had originally installed the OCW11.dll for Access 2003 in the reference library. Finally found Microsoft's "Programming Pivot Table Reports in Access 2002." All the goodies for programmatically controlling the Pivot Table with Access VBA. Spent the last couple of hours trying their examples. Some worked fine, with others part of it would work other parts wouldn't and with some the examples it just crashed (type mismatch, this property can't be used with this object etc. etc. etc.). Farted around trying to figure out what it was I was doing wrong. Finally the "DUH" light went on, I noticed the Dim Pivot Table properties were preceded with OWC10, eg. Pt as OCW10.PivotTable I had changed these to OCW11. I switched to the OCW10.dll for Access 2002 and changed the OCW11 back to OCW10, and low and behold eveything worked beautifully. Who in they right mind would provide something like this to the developer, without a warning, I am baffled. The time I have wasted over the last couple of days I could have by now designed my own pseudo pivot table. Hey Zeus!!!! From gustav at cactus.dk Sat Apr 2 11:49:59 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 02 Apr 2011 18:49:59 +0200 Subject: [AccessD] datatype Time(7) precision Message-ID: Hi John That should influence the fractions of a second only: http://msdn.microsoft.com/en-us/library/bb677243.aspx Specifies the number of digits for the fractional part of the seconds. This can be an integer from 0 to 7. The default fractional precision is 7 (100ns). As Access out of the box doesn't support fractions of seconds, you must be facing another issue. /gustav >>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07 >>> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. From jwcolby at colbyconsulting.com Sat Apr 2 13:19:14 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 14:19:14 -0400 Subject: [AccessD] datatype Time(7) precision In-Reply-To: References: Message-ID: <4D9768A2.7000105@colbyconsulting.com> As it turns out, it is a driver issue. Using vanilla ODBC rather than the native SQL Server causes the (data entry) issue to go away. John W. Colby www.ColbyConsulting.com On 4/2/2011 12:49 PM, Gustav Brock wrote: > Hi John > > That should influence the fractions of a second only: > > http://msdn.microsoft.com/en-us/library/bb677243.aspx > Specifies the number of digits for the fractional part of the seconds. > This can be an integer from 0 to 7. > The default fractional precision is 7 (100ns). > > As Access out of the box doesn't support fractions of seconds, you must be facing another issue. > > /gustav > > >>>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07>>> > What does the (7) really mean? Is it possible to manipulate that number to determine how many > seconds / milliseconds etc that SQL server is expecting to be entered? > > Im am trying to enter time in Access and I am currently required to enter the seconds part > > hh:mm:ss > > 08:00:00 > > If I don't enter the seconds SQL Server complains as I try to store the field. > > > From gustav at cactus.dk Sun Apr 3 07:45:20 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 03 Apr 2011 14:45:20 +0200 Subject: [AccessD] Rapid Application Development: LightSwitch Beta 2 Message-ID: Hi all Here is a better, though still brief, introduction to the new beta: http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/threads Click at the top under Announcements the topic: Visual Studio LightSwitch Beta 2 Released with Go Live License! .. We'd also like to announce that Beta 2 comes with a "Go Live" license which means you can now start using Visual Studio LightSwitch for production projects /gustav >>> gustav at cactus.dk 03-04-2011 11:07 >>> Hi members of "VS2010 SP1 club" Then those interested in true RAD may proceed obtaining the recent LightSwitch Beta 2 which requires VS2010 SP1: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=cff6c4ef-a29a-4c82-9a59-8a3bbb65ec3d The Beta 1 must be uninstalled first. Apart from many minor improvements "too numerous to mention" as the team tells, an interesting new feature is direct deployment to Windows/SQL Azure. Also, the Visual Studio LightSwitch Beta 2 Training Kit: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=AC1D8EB5-AC8E-45D5-B1E3-EFB8E4E3EBD1 /gustav >>> shamil at smsconsulting.spb.ru 02-04-2011 16:26:55 >>> Hi Gustav at al, <<< So I did and ran the SP1 again. This time - as everything was downloaded - it took about an hour to finish. >>> Yes, I have also got to the "VS2010 SP1 club" today. :) Setup went smoothly and took a bit more than an hour.... Thank you. -- Shamil From rockysmolin at bchacc.com Sun Apr 3 10:05:52 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 3 Apr 2011 08:05:52 -0700 Subject: [AccessD] Solution in Search of a Problem Message-ID: I got a .pages file from a friend and, of course, couldn't open it. It was made on a (shudder) Mac. I got this tip from the web, though on opening it. Save the .pages file, change the extension to .zip, double click to unzip. In the zip file there will be a file called preview.pdf which will be the .pages doc converted to pdf. Walla! Rocky From Darryl.Collins at iag.com.au Sun Apr 3 20:02:54 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Mon, 4 Apr 2011 11:02:54 +1000 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <201104040103.p34133uS024641@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Pivot tables in Access are so insipid and fiddly that almost anyone who needs to use PTs seriously end up using Excel anyway, and either hooks Excel into the database or pushes the source out of the database into an Excel workbook / template which then automatically produces the PT using code. Best of both world then. Excel's PT ability is far superior to what is native in Access. My advice would be that using Excel is still the better approach. Of course your milage may vary depending on what you want to do. Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Saturday, 2 April 2011 8:32 AM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From rusty.hammond at cpiqpc.com Mon Apr 4 10:02:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 4 Apr 2011 10:02:44 -0500 Subject: [AccessD] Windows Terminal Services and RemoteApp - nice Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE117@CPIEMAIL-EVS1.CPIQPC.NET> A nice little introduction to Windows terminal services and the newer RemoteApp feature from FMS. Gives the ability to connect to a Terminal Server session and only show the app(s) you want the user to see. http://www.fmsinc.com/MicrosoftAccess/terminal-services/remoteapp.htm Rusty Hammond IT Dept. - B-20 Senior Developer CPI Qualified Plan Consultants, Inc. (620) 793-8473 ext. 416 rusty.hammond at cpiqpc.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From bheygood at abestsystems.com Mon Apr 4 14:06:54 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:06:54 -0700 Subject: [AccessD] datatype Time(7) precision In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <8BC8D7BC2C9840278F464D0A8CF5B340@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:08:37 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:08:37 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:09:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:09:01 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <0D38443FD37B4E6AAF674630AD1040E7@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From davidmcafee at gmail.com Mon Apr 4 14:58:26 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 4 Apr 2011 12:58:26 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: <5F016B3563E9447A81D7A3AFE217A357@BPCS> References: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Message-ID: I added the set focus. I also noticed that AutoCenter was off, so I turned that on. I put out an update and the user said that it worked, so I'm not sure which one fixed it, but it is fixed. Thanks. David On Fri, Apr 1, 2011 at 2:03 PM, Bill Patten wrote: > Hi David, > > A couple of suggestions that might help you determine if your Modal idea is > in fact the problem. > > In form frm_002D_Company open event try setting focus to an enabled > control, this should bring it to the front. > > Since you you have a parameter declared to pass the name of the calling > form, perhaps you could add code to hide the calling form in the on load or > on open event > of frm_002D_Company and then un hide it on form close. > > HTH > > > Bill > -------------------------------------------------- > From: "David McAfee" > Sent: Friday, April 01, 2011 11:37 AM > To: "Access Developers discussion and problem solving" > > Subject: [AccessD] Weird issues with one user > > I've been struggling with this issue for the last couple of days and it is > driving me nuts. > > The user didn't have problems until they were given a newer computer. > The computer has Vista as the OS and Access2007. > > I have some forms that were originally created in Access 2000, and another > created in (I believe Access 2003). > > Now that they have the new computer, when the user clicks on cmdLocationAdd > (or Edit), Access seems to lock up. > > What I believe is happening is that the form 002D is opening up in modal > mode, but not on top of the form that is calling it. > > I can't recreate it on my machine (also a Vista box with A2007). > > I checked our references and they both match: > > Visual Basic for Applications > Microsoft Access 12.0 Object Library > OLE Automation > Microsoft ActiveX Data Objects 2.1 Library > Microsoft DAO 3.6 Object Library > > Any ideas? > > Here are the related subs: > > > The A2003 calls a form on an OnClick event: > > Private Sub cmdLocationAdd_Click() > Dim strOpenArgs As String > strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & > Me.lstCompaniesFound.Column(1) > 'Debug.Print strOpenArgs > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return > Form | Return Field | CompanyName > End Sub > > Private Sub cmdLocationEdit_Click() > Dim strOpenArgs As String > 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | > strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & > Me.lstCompaniesFound.Column(1) '2 = Edit > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > Me.lstCompanyLocations.Requery > End Sub > > > Private Sub Form_Load() > On Error GoTo Form_Load_Error > 'Dim errNum As Double, errDesc As String, errLine As Integer > > If Not IsNull(Me.OpenArgs) Then > Dim arrX As Variant > arrX = Split(Me.OpenArgs, "|") > intMode = arrX(0) > Select Case intMode > Case 1 'Add Mode > Me.txtCompanyID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Addition" > Me.Caption = "New Address Entry" > 'Hide listbox & cmd button as we don't have an AddressID yet > Me.lstAddtionalInfo.Visible = False > Me.cmdAddAddtionalInfo.Visible = False > Me.cmdEditAddtionalInfo.Visible = False > Me.cmdDelAddtionalInfo.Visible = False > ' Show fields below, so we can write to the appropriate fields > when we append this record > Me.txtPhone.Visible = True > Me.txtfax.Visible = True > Me.txtemail.Visible = True > > Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") > Case 2 'Edit Mode > Me.txtAddrID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Edit" > Me.Caption = "Company Address Edit" > 'Show listbox & cmd button as we now have an AddressID > Me.lstAddtionalInfo.Visible = True > Me.cmdAddAddtionalInfo.Visible = True > Me.cmdEditAddtionalInfo.Visible = True > Me.cmdDelAddtionalInfo.Visible = True > 'No need to show these fields as we have the listbox available > Me.txtPhone.Visible = False > Me.txtfax.Visible = False > Me.txtemail.Visible = False > FillAddress (Me.txtAddrID) > 'Fill Phone/fax/email info: > Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " > & Me.txtAddrID > Case Else > 'Trap code removed > End Select > strReturnForm = arrX(2) 'Parameter 3, the form that we will return the > data to > strReturnField = arrX(3) 'Parameter 4, the field in the above form that > data will return to > Else > 'Do stuff when opened without OpenArgs > End If > > End Sub > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Mon Apr 4 15:20:51 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 13:20:51 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a local > drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading the > resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I still am > not able to use it. > > It's very important as I, like most of you, need to replicate a clients > setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another instance of > MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 16:05:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:05:45 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: References: , , Message-ID: <4D9A32A9.25393.377FC767@stuart.lexacorp.com.pg> I agree with Charlotte completely. That's exactly what I do. Use UNC paths, not mappings, store your development and production paths somewhere in te FE and include a re-link procress to switch between development and production BEs. Triggering the rellink can be controlled in all sorts of ways, including fully automated by checking the location of the FE on startup. -- Stuart On 4 Apr 2011 at 13:20, Charlotte Foust wrote: > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a local > drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading the > resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I still am > not able to > use it. > > It's very important as I, like most of you, need to > replicate a clients > setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another instance of > MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheygood at abestsystems.com Mon Apr 4 16:24:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 14:24:39 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <41760139BA5C46879CDDA9E6D324546D@Seven> Thanks for the response. The client is dictating which drive I have to use. Yes, I tried to set some looser permissions from the properties dialog. Lately sometimes it "sticks" and the changes I made are there next time I check. And sometimes not. Irregardless, I can't write to files in that folder. Error = You do not have permissions..... -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Mapped Drive Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a > local drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading > the resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I > still am not able to use it. > > It's very important as I, like most of you, need to replicate a > clients setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another > instance of MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Mon Apr 4 16:31:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:31:38 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: <41760139BA5C46879CDDA9E6D324546D@Seven> References: , , <41760139BA5C46879CDDA9E6D324546D@Seven> Message-ID: <4D9A38BA.25221.37977B2B@stuart.lexacorp.com.pg> Permissions on a folder are whihcever are the more severe between direct and shared. You need to set appropriate permissions on the actual folder in Explorer as well in the Sharing dialog. -- Stuart On 4 Apr 2011 at 14:24, b heygood wrote: > Thanks for the response. > The client is dictating which drive I have to use. > > Yes, I tried to set some looser permissions from the properties > dialog. Lately sometimes it "sticks" and the changes I made are there > next time I check. And sometimes not. Irregardless, I can't write to > files in that folder. Error = You do not have permissions..... > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Mapped Drive > > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a > local drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading > the resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I > still am not able to > use it. > > It's very important as I, like most of you, need to > replicate a > clients setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another > instance of MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 17:54:16 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 18:54:16 -0400 Subject: [AccessD] Error 3027 Message-ID: <000001cbf31b$3b72b1b0$b2581510$@com> Hello, I wanted to fill a Query with AddNew and Update. But I get the error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." What can I do to fix this problem? TIA. Saludos Actuary Ralf Lister La Paz, Bolivia From stuart at lexacorp.com.pg Mon Apr 4 18:04:12 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:04:12 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000001cbf31b$3b72b1b0$b2581510$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> Message-ID: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Hard to say without seeing the query, but a common reason for a query being RO is that it doesn't include the PK of the table you are trying to update. -- Stuart On 4 Apr 2011 at 18:54, Ralf Lister wrote: > Hello, > > > > I wanted to fill a Query with AddNew and Update. But I get the error > message " Error 3027 at run time./ You can't update. The database a/o > object is "read only"." What can I do to fix this problem? > > > > TIA. > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 18:06:06 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 11:06:06 +1200 Subject: [AccessD] Archives Down Message-ID: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From charlotte.foust at gmail.com Mon Apr 4 18:24:28 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 16:24:28 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 18:49:34 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:49:34 +1000 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com>, <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg>, Message-ID: <4D9A590E.11612.3815C21C@stuart.lexacorp.com.pg> I assumed that the query was the source of a DAO.recordset in VBA. But I was wrong once before, it's conceivable that I am again. -- Stuart On 4 Apr 2011 at 16:24, Charlotte Foust wrote: > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 19:42:32 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 20:42:32 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: <000501cbf32a$5b411900$11c34b00$@com> Thank you all for your help. Charlotte, I`m gathering information data about one person, make some calculations and save this calculations in the fields of a query by Set dbs = CurrentDb Set rst = dbs.OpenRecordset("qryBeneficiosAlt") With rst .AddNew ![FechaCalculo] = Now ![Nombre] = gstrNombre ![Beneficiario] = gstrBeneficiario ![Edad] = gintEdad ![Sexo] = gstrSexo ![Densidad] = gintDensidad ![TasaActualUSD] = gsngTasaActualUSD ![TasaCompUSD] = gsngTasaCompUSD ![CC] = gsngCC ' CC = Compensacion de Cotizaciones ![PBR] = gsngPBR ' PBR = Pension Base Referencial ![LimSolInf] = gsngLimSolInf ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial ![PR] = gsngPR ' Porcentaje Referencial ![BeneficiosAltPension] = gsngBeneficiosAltPension ![ValorAportes] = gsngValorAportes ![GF] = gsngGF .Update End With to be able to make a report on this very query as a Control Source. After printing the report I delete the data in the query with "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. But at "AddNew I get this error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 From stuart at lexacorp.com.pg Mon Apr 4 20:28:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 11:28:51 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> Message-ID: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > .AddNew > > ![FechaCalculo] = Now > > ![Nombre] = gstrNombre > > ![Beneficiario] = gstrBeneficiario > > ![Edad] = gintEdad > > ![Sexo] = gstrSexo > > ![Densidad] = gintDensidad > > ![TasaActualUSD] = gsngTasaActualUSD > > ![TasaCompUSD] = gsngTasaCompUSD > > ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ![LimSolInf] = gsngLimSolInf > > ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ![PR] = gsngPR ' Porcentaje Referencial > > ![BeneficiosAltPension] = gsngBeneficiosAltPension > > ![ValorAportes] = gsngValorAportes > > ![GF] = gsngGF > > .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > > _____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 20:38:48 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 13:38:48 +1200 Subject: [AccessD] Creating ADE's in Access 2010 Message-ID: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Darryl.Collins at iag.com.au Mon Apr 4 20:54:32 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 11:54:32 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <201104050154.p351seYM014934@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hey, that is good to know. So this will create an A2003 version MDE that will run on both A2003 and A2007/10? I will try this at home later and see what happens. Nice if it works like I think it should and much easier than doing it the 'proper' way. cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, 5 April 2011 11:39 AM To: accessd at databaseadvisors.com Subject: [AccessD] Creating ADE's in Access 2010 For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Mon Apr 4 21:03:06 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 12:03:06 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <201104050154.p351seYM014934@databaseadvisors.com> References: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz>, <201104050154.p351seYM014934@databaseadvisors.com> Message-ID: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > From Darryl.Collins at iag.com.au Mon Apr 4 21:51:26 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 12:51:26 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Message-ID: <201104050251.p352pXOH017248@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am been largely ok with forward compatibility so far, although there has been some issues between 2003 and 2007. Might be fun to try this out though and see what happens with a 2007 'mde' in A2003 etc. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, 5 April 2011 12:03 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Creating ADE's in Access 2010 Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Gustav at cactus.dk Tue Apr 5 05:35:25 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 05 Apr 2011 12:35:25 +0200 Subject: [AccessD] Windows 8, Metro and modern UI Message-ID: Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screenshots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experience/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-revealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wallpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-transportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav From accessd at shaw.ca Tue Apr 5 12:47:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 5 Apr 2011 10:47:38 -0700 Subject: [AccessD] [dba-Tech] Windows 8, Metro and modern UI In-Reply-To: References: Message-ID: <0B83A3EE0FDC4839B506AFFA025B107D@creativesystemdesigns.com> Hi Gustav: The new designs looks (more like sounds) really interesting. I like that they are going more towards a flat and clean design with an emphasis on transitions. The only issues, especially if you are working with web based applications is the font options. There is only so much you can do with half dozen standard internal fonts you will find on every computer/browser as even the most fancy CSS has it limitations...and just downloading font images is not the answer if you application is going international. I have been working with this coding to allow a wider range of fonts to be deployed but there has to be a judicious trade off in performance and there is a limited set of size options. http://www.960development.com/how-to-write-cross-browser-font-face-syntax/ Jim -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, April 05, 2011 3:35 AM To: accessd at databaseadvisors.com; dba-tech at databaseadvisors.com Subject: [dba-Tech] Windows 8, Metro and modern UI Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screen shots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experi ence/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-r evealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wa llpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-tra nsportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com From EdTesiny at oasas.state.ny.us Tue Apr 5 14:22:18 2011 From: EdTesiny at oasas.state.ny.us (Tesiny, Ed) Date: Tue, 5 Apr 2011 15:22:18 -0400 Subject: [AccessD] Archives Down In-Reply-To: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> References: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: Nope, looks like it's down Ed Tesiny EdTesiny at oasas.state.ny.us -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, April 04, 2011 7:06 PM To: Access Developers discussion and problem solving Subject: [AccessD] Archives Down Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 5 15:02:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 15:02:26 -0500 Subject: [AccessD] Query grid question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From charlotte.foust at gmail.com Tue Apr 5 15:49:01 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:49:01 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> <000501cbf32a$5b411900$11c34b00$@com> Message-ID: You actually want to add data to tables, so why try to use the query to do so? In any case, if it isn't updateable it's usually because of the structure of the query. However, in your case, depending on the version of Access you're using, you haven't declared a recordset type, so your recordset may be a snapshot, which is not updatable by definition, regardless of whether the query is. Charlotte Foust On Mon, Apr 4, 2011 at 5:42 PM, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations ?and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > ? ?.AddNew > > ? ?![FechaCalculo] = Now > > ? ?![Nombre] = gstrNombre > > ? ?![Beneficiario] = gstrBeneficiario > > ? ?![Edad] = gintEdad > > ? ?![Sexo] = gstrSexo > > ? ?![Densidad] = gintDensidad > > ? ?![TasaActualUSD] = gsngTasaActualUSD > > ? ?![TasaCompUSD] = gsngTasaCompUSD > > ? ?![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ? ?![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ? ?![LimSolInf] = gsngLimSolInf > > ? ?![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ? ?![PR] = gsngPR ' Porcentaje Referencial > > ? ?![BeneficiosAltPension] = gsngBeneficiosAltPension > > ? ?![ValorAportes] = gsngValorAportes > > ? ?![GF] = gsngGF > > ? ?.Update > > End With > > > > to be able to make a report on this very query as a Control Source. After > printing the report I delete the data in the query with "DoCmd.RunSQL > "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You can't > update. The database a/o ?object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust > Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > > > Another possible reason is a multiple table query. ?Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: >> Hard to say without seeing the query, but a common reason for a query > being RO is that it >> doesn't include the PK of the table you are trying to update. >> >> -- >> Stuart >> >> On 4 Apr 2011 at 18:54, Ralf Lister wrote: >> >>> Hello, >>> >>> >>> >>> I wanted to fill a Query with AddNew and Update. But I get the error >>> message " Error 3027 at run time./ You can't update. The database a/o >>> object is "read only"." What can I do to fix this problem? >>> >>> >>> >>> TIA. >>> >>> >>> >>> Saludos >>> >>> Actuary Ralf Lister >>> >>> La Paz, Bolivia >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > ?_____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 5 15:50:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:50:15 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Tue Apr 5 16:03:30 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 16:03:30 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Here is a good example SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM WHERE Groups.Name like "MANIFOLD *" and Groups.Name not like "* AREA" and Groups.GroupingType="CGRP" and Members.ChildPTYPE="COMP" and Members.PID=Groups.PID and CM.PID=Members.ChildPID ORDER BY Members.ChildPID, Groups.Name; -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 3:50 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rlister at actuarial-files.com Tue Apr 5 17:50:03 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 18:50:03 -0400 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Message-ID: <000601cbf3e3$cedce560$6c96b020$@com> Thanks a lot Stuart, The SQL is: SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, tblWerte.BeneficiosAltPension, tblDisposiciones.GF FROM tblWerte, tblDisposiciones; Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations? and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > >???? .AddNew > >???? ![FechaCalculo] = Now > >???? ![Nombre] = gstrNombre > >???? ![Beneficiario] = gstrBeneficiario > >???? ![Edad] = gintEdad > >???? ![Sexo] = gstrSexo > >???? ![Densidad] = gintDensidad > >???? ![TasaActualUSD] = gsngTasaActualUSD > >???? ![TasaCompUSD] = gsngTasaCompUSD > >???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > >???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial > >???? ![LimSolInf] = gsngLimSolInf > >???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > >???? ![PR] = gsngPR ' Porcentaje Referencial > >???? ![BeneficiosAltPension] = gsngBeneficiosAltPension > >???? ![ValorAportes] = gsngValorAportes > >???? ![GF] = gsngGF > >???? .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o? object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query.? Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > >?? _____? > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:07:43 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:07:43 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000601cbf3e3$cedce560$6c96b020$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Tue Apr 5 18:16:11 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 19:16:11 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: <000d01cbf3e7$74facea0$5ef06be0$@com> Thank's Charlotte, Thank's a lot for your help. I wouldn't have found this silly error with your help. I'll join now the tables. Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Martes, 05 de Abril de 2011 07:08 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3553 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:19:03 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:19:03 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 5 22:54:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 05 Apr 2011 23:54:53 -0400 Subject: [AccessD] Autonumber when? Message-ID: <4D9BE40D.8050502@colbyconsulting.com> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From rusty.hammond at cpiqpc.com Tue Apr 5 23:02:58 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 5 Apr 2011 23:02:58 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Hi John, Do the following: .Update .BookMark = .LastModified mlngLogID = !PLSL_ID HTH Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 10:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Wed Apr 6 05:09:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 06:09:49 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C3BED.1000700@colbyconsulting.com> Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From ab-mi at post3.tele.dk Wed Apr 6 05:52:23 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 12:52:23 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <953E20402FC54D7AABE4F2578153A13D@abpc> Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. With rs .AddNew .!PLSL_IDPLSUSR = mlngIDUser .!PLSL_FE = CurrentProject.Name .!PLSL_Login = blnLogIn .!PLSL_WorkstationID = CurrentMachineName() On Error Resume Next .Update mlngLogID = .!PLSL_ID If Err Then mlngLogID = .!PLSL_ID End If .Close End With Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 12:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Wed Apr 6 06:06:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 13:06:52 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John How about: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 05:54 >>> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 06:57:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:57:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C5532.4060906@colbyconsulting.com> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > From jwcolby at colbyconsulting.com Wed Apr 6 06:58:01 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:58:01 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <953E20402FC54D7AABE4F2578153A13D@abpc> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <953E20402FC54D7AABE4F2578153A13D@abpc> Message-ID: <4D9C5549.2050804@colbyconsulting.com> Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> From Gustav at cactus.dk Wed Apr 6 07:44:24 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 14:44:24 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John No, it was not the same. It works! /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 13:57 >>> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? From Chester_Kaup at kindermorgan.com Wed Apr 6 07:38:28 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 6 Apr 2011 07:38:28 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> The grid is completely empty except for the two tables. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 6:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From ab-mi at post3.tele.dk Wed Apr 6 07:52:21 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 14:52:21 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5549.2050804@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><953E20402FC54D7AABE4F2578153A13D@abpc> <4D9C5549.2050804@colbyconsulting.com> Message-ID: <14A5B079377C4684B1473AEB5D140AAE@abpc> Ok, I see. Then try a MoveLast after the Update and before reading the new autonumber, i.e. With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .MoveLast mlngLogID = !PLSL_ID .Close End With Works for me. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 13:58 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Wed Apr 6 08:17:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 06:17:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: I don't know if this helps, but I always call @@IDENTITY in SQL to get the last PKID. Sent from my Droid phone. On Apr 5, 2011 8:56 PM, "jwcolby" wrote: > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 6 08:24:38 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 09:24:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <07790084744342A6AF9FAE17F48AF13D@XPS> John, You may find the following helpful: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6 -4e13-8876-f6e5faae8dba/ It pretty much covers what has already been said, but goes through some of the in's and out's of why one approach works or doesn't. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 11:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:25:29 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:25:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5532.4060906@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 08:25:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:25:45 -0400 Subject: [AccessD] I need help Message-ID: <4D9C69D9.6060702@colbyconsulting.com> In NC where I live, volunteers can check certain inmates out of prison for up to 6 hours for activities like church, AA meetings or pretty much anything legal. I have the required certification to do this and I am writing an application to assist volunteers such as myself in filling out leave pass requests for prison inmates. There is a web search site that anyone can use to search for and observe the information about inmates. I am inserting the URL complete with a random inmate selected. Watch for word wrap. http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=0012345&searchOffenderId=0012345&listurl=pagelistoffendersearchresults&listpage=1 What I need assistance with is reading the info at the very top of the Offender Info in order to extract this and automatically fill in a record in Access. IOW I search for and find an inmate, then I press a button and suck the info in that top area into a record. This will save a fair amount of typing. The problem is I have no idea how to do this. If I view the HTML I find an XML table that holds this stuff but how do I drill down to that area reliably, then extract the info? Preferably without doing it i some code intensive string manipulation way. I already have two other volunteers requesting my program, which I will be making available for free to any volunteers who do checkouts. I am trying to make this as user friendly as possible. Any help is much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 08:34:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:34:07 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C6BCF.1020100@colbyconsulting.com> Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against > a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > From rusty.hammond at cpiqpc.com Wed Apr 6 08:47:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 08:47:44 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> When you set your recordset are you using the dbSeeChanges option? You're code should look something like this: dim db as database dim rs as recordset set db=CurrentDB() set rs = db.openrecordset("tblName", dbOpenDynaset, dbSeeChanges) With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .BookMark = .LastModified mlngLogID = !PLSL_ID .Close End With -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 5:10 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From ab-mi at post3.tele.dk Wed Apr 6 08:49:57 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 15:49:57 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From mwp.reid at qub.ac.uk Wed Apr 6 08:50:21 2011 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 6 Apr 2011 14:50:21 +0100 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <631CF83223105545BF43EFB52CB08295470B44F4C7@EX2K7-VIRT-2.ads.qub.ac.uk> Might help http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6-4e13-8876-f6e5faae8dba/ Martin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 06 April 2011 14:34 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error > check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:58:42 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:58:42 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond Sent: Wednesday, April 06, 2011 9:50 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autonumber when? >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:01:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:01:04 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C7220.3060606@colbyconsulting.com> Lambert, I am actually doing *both*. The code needs to function for an MDB BE or an SQL BE. By testing BEFORE the save it works for DAO, the test AFTER the save (is supposed to) works for SQL. For whatever reason it doesn't work for the sql be. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:25 AM, Heenan, Lambert wrote: > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 6 09:01:47 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 10:01:47 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: As I said, look again John. You have... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With But Gustav (and me if I'd been quick enough) suggests... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. Lambert From jwcolby at colbyconsulting.com Wed Apr 6 09:06:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:06:59 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7383.4080009@colbyconsulting.com> Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? From jwcolby at colbyconsulting.com Wed Apr 6 09:15:41 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:15:41 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C758D.30905@colbyconsulting.com> It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Apr 6 09:19:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:19:34 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <4D9C7676.1000303@colbyconsulting.com> If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert From rusty.hammond at cpiqpc.com Wed Apr 6 09:21:02 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:21:02 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Yeah, there's something about linked SQL tables you have to set the recordset bookmark to the lastmodified record, after the update, before you can read the autonumber value when creating new records. It should work for both linked SQL tables and tables in an mdb so trying to read the value before the update isn't really necessary. Martin sent this link earlier that talks about it: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- 66a6-4e13-8876-f6e5faae8dba/ I've had this code running in an application for several years in Access 97 and 2003. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Wed Apr 6 09:38:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 10:38:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> John, A little code cleanup: Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Should be: Exit_mPLSLogin: On Error Resume Next If Not (rs Is Nothing) Then rs.Close Set rs = Nothing End If Exit Function Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:41:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:41:28 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7B98.9000909@colbyconsulting.com> It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, before > you can read the autonumber value when creating new records. It should > work for both linked SQL tables and tables in an mdb so trying to read > the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From jwcolby at colbyconsulting.com Wed Apr 6 09:45:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:45:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> Message-ID: <4D9C7C79.4070406@colbyconsulting.com> LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? From rusty.hammond at cpiqpc.com Wed Apr 6 09:46:37 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:46:37 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, now I remember what's going on. I had to go to Access 97 Developer's Handbook (page 269)to refresh my memory (page 1540 of the Access 2000 Developer's Handbook volume 1). You mentioned it in your original post that SQL doesn't create the autonumber value until after the record is created. When using the AddNew method on a Dynaset-type recordset, as soon as you do .Update, that new record gets added to the end of the recordset and is NOT the current record. To get to that new record, you use the .LastModified property of the recordset. You can use either of the following methods to get to the new record: .BookMark = .LastModified OR .Move 0, .LastModified Then get the value of the ID field. The nice thing is it works with either a linked SQL table or Access table. You new code should look like the following (I've rem'ed out your existing lines so you can see the changes): ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() 'Take out the following two lines - get the ID value after the Update - RustyH 'On Error Resume Next 'mlngLogID = !PLSL_ID .Update 'Added the following line - RustyH .BookMark = .LastModified 'If Err Then mlngLogID = !PLSL_ID 'End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Wed Apr 6 09:57:51 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:57:51 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7B98.9000909@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7B98.9000909@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12D@CPIEMAIL-EVS1.CPIQPC.NET> Because the record isn't actually saved to the table until you do .Update. It's like creating a new record on a data entry form or directly in the table. You can click the AddNew button and enter data in the fields but until you move to another record or hit the Save Record button, the record isn't saved yet. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:41 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, > before you can read the autonumber value when creating new records. > It should work for both linked SQL tables and tables in an mdb so > trying to read the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c84 > 5- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in > Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As > DAO.Recordset Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or > review by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:12:57 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:12:57 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7676.1000303@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:20 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:17:50 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:17:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: Although that theory may get blown out of the water as Err should in fact retain its value even after the .Update statement. I just checked with this Sub Err_Test() Dim n As Long On Error Resume Next n = 10 / 0 n = 10 Debug.Print n, Err.Number End Sub Which outputs 10, 11 (as error 11 is Div by zero). But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 06, 2011 11:13 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert From Gustav at cactus.dk Wed Apr 6 10:41:41 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 17:41:41 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi Lambert I found out that you read out the value from the record you were at before calling .AddNew. That fooled me. But no error was raised which is what fooled JC. However, Rusty described how to do it with .LastModified which method I tested with success. /gustav >>> Lambert.Heenan at chartisinsurance.com 06-04-2011 17:17 >>> But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. From ab-mi at post3.tele.dk Wed Apr 6 10:31:25 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 17:31:25 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C758D.30905@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> <4D9C758D.30905@colbyconsulting.com> Message-ID: Correct. The identity column I used has a clustered PK. If that's not the case then you could open the recordset using a sql ordering by PLSL_ID and using the dbOpenDynaset, dbSeeChanges option. As for another record being inserted before moving last: if that's a risk then you should make the insert calling a sp in SQL Server. In this sp you can use SCOPE_IDENTITY() to get the last identity ("autonumber") value created by the procedure. (Don't use @@IDENTITY for this, since it might eventually return an identity value created by a trigger for your table.) Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 16:16 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 6 10:39:32 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 6 Apr 2011 08:39:32 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Wed Apr 6 10:43:50 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 11:43:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7C79.4070406@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> <4D9C7C79.4070406@colbyconsulting.com> Message-ID: <1751F81B42C84B468378B7D3CEC911A2@XPS> John, Don't remember exactly why, but it was important not to attempt the close if the object variable was already nothing, so therefore the check. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:45 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 14:45:22 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 15:45:22 -0400 Subject: [AccessD] IE search for table Message-ID: <4D9CC2D2.60402@colbyconsulting.com> Function mSearchTable() Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And Len(strOffenderInfo) = 0 Then strOffenderInfo = strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And Len(strMostRecent) = 0 Then strMostRecent = strInnerText End If End If Next varTable Debug.Print strOffenderInfo Debug.Print strMostRecent Cleanup: Set varTable = Nothing: Set varTables = Nothing 'objIE.Quit 'Set objIE = Nothing End Function -- John W. Colby www.ColbyConsulting.com From kismert at gmail.com Wed Apr 6 15:13:46 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 6 Apr 2011 15:13:46 -0500 Subject: [AccessD] Autonumber when? Message-ID: > > jwcolby > ... > The code needs to work whether going to an MDB or SQL BE. The code works > fine for an MDB BE but fails for a SQL BE. > ... > John, This is probably what you are trying to avoid, but I'll say it anyway: You should write separate code to handle the MDB and SQL Server BEs. First, the obvious: Jet and SQL Server are very different. * It is unlikely that this is the only variation you will have to account for throughout your code * Variations in code make it harder to test * When you do want to use SQL Server-specific features, like stored procedures, you will have to split the code anyway * I have a personal distaste of "On Error Resume Next" coding, which I use only for object cleanup code where there is literally nothing to raise an error to. All told, the cost and effort to make a large existing code base generic will likely exceed the cost of just splitting it neatly into libraries that support each database type. Plus, you get more modular, flexible, testable code. Again, this is what you are trying to avoid, but I felt I should say it, anyway. -Ken From jwcolby at colbyconsulting.com Wed Apr 6 15:38:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 16:38:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9CCF35.3030705@colbyconsulting.com> I hear you Ken. I have written a framework for MDB BEs. It is very large, and has tons of functionality, and was never intended to run against SQL Server simply because nobody was using that back when I wrote it. Now I am trying to use it for a SQL Server back end. It is not just a simple case of "write a library for this and a library for that. Additionally I need it to work where this table (or set of tables) is kept in an MDB and that one is moved to SQL. I write frameworks. The framework does a ton of stuff which is handled automatically. It handles the not in list and the dbl click of combos for example. The dbl click of a combo opens a form and moves to the record that the combo is displaying. Classes instantiate classes which instantiate classes. I am just not sure that "writing separate libs" is a viable option. It would mean a complete rewrite of the framework and then a complete rewrite of the FE. John W. Colby www.ColbyConsulting.com On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >> jwcolby >> ... >> The code needs to work whether going to an MDB or SQL BE. The code works >> fine for an MDB BE but fails for a SQL BE. >> ... >> > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken From davidmcafee at gmail.com Wed Apr 6 15:58:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 13:58:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9CCF35.3030705@colbyconsulting.com> References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: Perfect time to rewrite it for "unbound" >:P On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > On 4/6/2011 4:13 PM, Kenneth Ismert wrote: > >> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >>> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I >> use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries >> that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 6 16:20:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:20:08 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: <4D9CD908.8050904@colbyconsulting.com> ;) John W. Colby www.ColbyConsulting.com On 4/6/2011 4:58 PM, David McAfee wrote: > Perfect time to rewrite it for "unbound">:P > > > On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >>> >>>> jwcolby >>>> ... >>>> The code needs to work whether going to an MDB or SQL BE. The code works >>>> fine for an MDB BE but fails for a SQL BE. >>>> ... >>>> >>>> >>> John, >>> >>> This is probably what you are trying to avoid, but I'll say it anyway: >>> >>> You should write separate code to handle the MDB and SQL Server BEs. >>> >>> First, the obvious: Jet and SQL Server are very different. >>> * It is unlikely that this is the only variation you will have to account >>> for throughout your code >>> * Variations in code make it harder to test >>> * When you do want to use SQL Server-specific features, like stored >>> procedures, you will have to split the code anyway >>> * I have a personal distaste of "On Error Resume Next" coding, which I >>> use >>> only for object cleanup code where there is literally nothing to raise an >>> error to. >>> >>> All told, the cost and effort to make a large existing code base generic >>> will likely exceed the cost of just splitting it neatly into libraries >>> that >>> support each database type. >>> >>> Plus, you get more modular, flexible, testable code. >>> >>> Again, this is what you are trying to avoid, but I felt I should say it, >>> anyway. >>> >>> -Ken >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at colbyconsulting.com Wed Apr 6 16:23:21 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:23:21 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CD9C9.7090909@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 16:25:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:25:39 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CDA53.2090800@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From Chester_Kaup at kindermorgan.com Thu Apr 7 07:41:44 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 7 Apr 2011 07:41:44 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB04055@houex1.kindermorgan.com> The query runs OK. The number of returned records is the same as what I would call a normal query. Something like this. SELECT GroupMaster.Name, dbo_DSS_CompletionMaster.PID, ConfigMaster.WellName FROM dbo_DSS_CompletionMaster INNER JOIN (ConfigMaster INNER JOIN GroupMaster ON ConfigMaster.PID = GroupMaster.PID) ON dbo_DSS_CompletionMaster.PID = ConfigMaster.ChildPID WHERE (((GroupMaster.Name) Like "Manifold*" And (GroupMaster.Name) Not Like "*Area")); -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 06, 2011 10:40 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 7 16:47:24 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 7 Apr 2011 14:47:24 -0700 Subject: [AccessD] E Mail hyperlink In-Reply-To: <4D9C69D9.6060702@colbyconsulting.com> References: <4D9C69D9.6060702@colbyconsulting.com> Message-ID: Hello, I using Access 2003 to create a contact database. I am trying to create a field (which is currently text) in a table (or the related form) which acts as hyperlink to the email address which is typed in there for each contact. i.e. we want to be able to click on the field and have it open to new mail message. Can you tell me how to do this please? I have gotten so far as to be able to right click on the control and edit hyperlink to indicate that it is an email address, but then it wants me to type in the address. I can't do this for all 5K+. Other than just leaving the data in text and automating Outlook via vba when clicking the control.... Just seems like I should be able to do this. bob heygood From stuart at lexacorp.com.pg Thu Apr 7 17:09:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 08 Apr 2011 08:09:55 +1000 Subject: [AccessD] E Mail hyperlink In-Reply-To: References: <4D9C69D9.6060702@colbyconsulting.com>, Message-ID: <4D9E3633.21526.A28319F@stuart.lexacorp.com.pg> Sub txtEmail_DoubleClick() Docmd.SendObject vbSendNoObject,,,txtEmail,,,,,True, End Sub On 7 Apr 2011 at 14:47, b heygood wrote: > Hello, I using Access 2003 to create a contact database. I am trying > to create a field (which is currently text) in a table (or the related > form) which acts as hyperlink to the email address which is typed in > there for each contact. i.e. we want to be able to click on the field > and have it open to new mail message. Can you tell me how to do this > please? > > I have gotten so far as to be able to right click on the control and > edit hyperlink to indicate that it is an email address, but then it > wants me to type in the address. I can't do this for all 5K+. > > Other than just leaving the data in text and automating Outlook via > vba when clicking the control.... Just seems like I should be able to > do this. > > bob heygood > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Apr 7 21:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 07 Apr 2011 22:46:37 -0400 Subject: [AccessD] data validation Message-ID: <4D9E770D.5030102@colbyconsulting.com> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Apr 8 02:27:38 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 08 Apr 2011 09:27:38 +0200 Subject: [AccessD] data validation Message-ID: Hi John I think a lot depends on your user interface. We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. /gustav >>> jwcolby at colbyconsulting.com 08-04-2011 04:46 >>> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From adtp at airtelmail.in Fri Apr 8 04:06:55 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Fri, 8 Apr 2011 14:36:55 +0530 Subject: [AccessD] data validation References: <4D9E770D.5030102@colbyconsulting.com> Message-ID: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> J.C., In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). Best wishes, A.D.Tejpal ------------ Brief Description (Sample Db: DentalAppointments) ========================= This sample db demonstrates Appointments Planner for a dental clinic having two chairs. The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. Caution - (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open & use the sample db. (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. Version - Access 2000 file format Reference - DAO 3.6 ======================================= ----- Original Message ----- From: jwcolby To: Access Developers discussion and problem solving Sent: Friday, April 08, 2011 08:16 Subject: [AccessD] data validation Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 8 08:00:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:00:48 -0400 Subject: [AccessD] data validation In-Reply-To: References: Message-ID: <4D9F0700.7050109@colbyconsulting.com> Thanks Gustav. I haven't wrapped my mind around the "how to" do adjustments. The data is entered into a main form (pass request) sub form (request detail), with the request detail being a continuous form. AFAICT I can't write back to the subform controls because (AFAIK) doing so writes that value into every record. I would have to write them back to the table using SQL and then requery the subform to show the changes. An additional issue is that these forms are bound to SQL Server data through linked tables. I too am looking at using the recordset clone, however one of the issues I am trying to work around is that if I move to binding the form to an ADO recordset, then the RecordsetClone property becomes non-functional. I am going to put this in the "ToDo" file I think and get some other, less... "complicated" issues handled first. John W. Colby www.ColbyConsulting.com On 4/8/2011 3:27 AM, Gustav Brock wrote: > Hi John > > I think a lot depends on your user interface. > > We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. > If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. > > The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. > > /gustav > > >>>> jwcolby at colbyconsulting.com 08-04-2011 04:46>>> > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to > check the details against itself, with a collection to hold the time classes. Time classes have > code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > From jwcolby at colbyconsulting.com Fri Apr 8 08:21:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:21:34 -0400 Subject: [AccessD] data validation In-Reply-To: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> References: <4D9E770D.5030102@colbyconsulting.com> <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> Message-ID: <4D9F0BDE.9010700@colbyconsulting.com> Thanks A.D. These time slots are entirely determined by the user, and can be any length. Basically the user decides "I will be in this location from time X to time Y". The times have to be non-overlapping to other time slots and entirely contained within the pass request times. I actually have a function that takes a pair of data points, each data point consisting of PK, time from and time to and returns a boolean true if they collide. It was written to handle comparing two records. John W. Colby www.ColbyConsulting.com On 4/8/2011 5:06 AM, A.D. Tejpal wrote: > J.C., > > In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: > http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 > > The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. > > When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. > > You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). > > A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). > > Best wishes, > A.D.Tejpal > ------------ > > Brief Description > (Sample Db: DentalAppointments) > ========================= > This sample db demonstrates Appointments Planner for a dental clinic having two chairs. > > The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. > > If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). > > Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. > > Caution - > (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open& use the sample db. > > (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. > > Version - Access 2000 file format > > Reference - DAO 3.6 > ======================================= > > ----- Original Message ----- > From: jwcolby > To: Access Developers discussion and problem solving > Sent: Friday, April 08, 2011 08:16 > Subject: [AccessD] data validation > > > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > -- > John W. Colby > www.ColbyConsulting.com From gustav at cactus.dk Sat Apr 9 03:54:55 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 09 Apr 2011 10:54:55 +0200 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Message-ID: Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug From accessd at shaw.ca Sat Apr 9 20:35:29 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 9 Apr 2011 18:35:29 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! In-Reply-To: References: Message-ID: Hi Gustav: Thanks for posting this. There is a fix/patch for all application other than those using VBA (C++ and .Net) and having installed Windowss7 SP1. Currently there is no solution. http://support.microsoft.com/kb/2517589 This is a major major type ADO error and it may very put an end to a large project I am working on. :-( I think I am going to have a couple of beer tonight and not even think about computers...two months of work shot and no work-around. Most of my large clients (they are banks but I do not program for them just hardware) are still using XP so I am sure they are aware of this issue and how interested will they now be in considering an upgrade? Such an error would mean millions to them. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 09, 2011 1:55 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissue s/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From listmaster at databaseadvisors.com Sat Apr 9 20:50:16 2011 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sat, 9 Apr 2011 21:50:16 -0400 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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 bill_patten at embarqmail.com Sun Apr 10 01:14:18 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 9 Apr 2011 23:14:18 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Resent after meltdown. In-Reply-To: References: Message-ID: <67E0822B933B446893A4CD21E01864DF@BPCS> Thanks for the update Gustav, Finally showing that the problem effected more than dot net and 32/64 client issues helps, and had I known that 2 weeks ago would have probably saved me some time. I am lucky, I only have 2 clients using my ADP's at this time. Both are fully developed and are just in a maintenance mode so I don't have to work on them very much. The problem with both clients was solved by transferring the application to one of my XP machines, decompiling, and recompiling in the XP Machine and shipping to the clients. I still don't understand why some PC's worked and some didn't but now they all work. Since my machine caused the problem, (Win 7 64 SP1) I don't think I should bill my clients so I'm sure I can send the bill for 10 hours of trouble shooting and testing to Microsoft. Ya Think? Bill -------------------------------------------------- From: "Gustav Brock" Sent: Saturday, April 09, 2011 1:54 AM To: Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Sun Apr 10 12:39:16 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 10 Apr 2011 10:39:16 -0700 Subject: [AccessD] OT - Home networking question Message-ID: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug From accessd at shaw.ca Sun Apr 10 13:32:00 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 10 Apr 2011 11:32:00 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <188AEE9832FD4C49B6748669D96F689E@creativesystemdesigns.com> Hi Doug: Off the top, as you appears to be using a simple work-group type network, with no servers, the first things to check if a computer is not seeing the network, would be one of three items: 1. The workgroup name has to be the same on all your computers. 2. The IP range has to be the same i.e. 192.168.177.xxx where xxx is a different value for every computer on the network. (Note: the value 177 can be any number but it also must be consistent network wide) 3. The subnet mask usually defaults to 255.255.255.0...check for a key-in error. If these items are checked and are consistent then we have to look at the router configuration and whether you are using your ISP as your domain controller which will make it a whole different ball of wax. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 10:39 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Sun Apr 10 13:34:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sun, 10 Apr 2011 13:34:19 -0500 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: Download nbtscan http://www.softpedia.com/progDownload/nbtscan-Download-100891.html Rename the .exe downloaded to nbtscan.exe (get rid of the version numbers in the file name) Then, from a command prompt, run: Nbtscan 192.168.0.1-255 (where this would be if the IP of your machine is 192.168.0.x (otherwise change the first three numbers to that of your network) You'll then get a list of IP addresses on your network. However, if you actually have 3 routers plugged into the hub, you may have 3 separate routers, each with their own subnet. If the routers don't know what's on the other routers, then you may not be able to communicate between networks..... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 12:39 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Sun Apr 10 17:46:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 11 Apr 2011 08:46:38 +1000 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Mon Apr 11 11:17:08 2011 From: jedi at charm.net (Michael Bahr) Date: Mon, 11 Apr 2011 12:17:08 -0400 (EDT) Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> What Stuart suggest is a much better design. For the home, in most cases, you only need 1 router right after the modem. Then everybody else connects to the router either through wireless or switches to extend the ethernet. 1. Replace the hub with a router. 2. Replace the 3 routers (behind the hub) with switches--not hubs. Mike > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable > modem and > hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 11:27:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:27:10 -0400 Subject: [AccessD] New Language In-Reply-To: <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> Message-ID: <4DA32BDE.4020100@colbyconsulting.com> My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > From dw-murphy at cox.net Mon Apr 11 11:52:12 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 09:52:12 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <003c01cbf868$d4127de0$7c3779a0$@cox.net> Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 11:57:17 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:57:17 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> Message-ID: <4DA332ED.5040905@colbyconsulting.com> 3) Make sure your switches are gigabit! John W. Colby www.ColbyConsulting.com On 4/11/2011 12:17 PM, Michael Bahr wrote: > What Stuart suggest is a much better design. For the home, in most cases, > you only need 1 router right after the modem. Then everybody else > connects to the router either through wireless or switches to extend the > ethernet. > > 1. Replace the hub with a router. > 2. Replace the 3 routers (behind the hub) with switches--not hubs. > > Mike > >> Are you sure that your terminology if correct? >> >> It would make more sense if you has one router attached to your cable >> modem and >> hubs/switches connected to that router from the three locations. >> >> Can you give us the make/model numbers of these devices? >> >> -- >> Stuart >> >> >> On 10 Apr 2011 at 10:39, Doug Murphy wrote: >> >>> Folks, >>> >>> I know there are several members of this group who are knowledgeable >>> about computer networking. We have a network in our home/offices that >>> has evolved over time. The basic configuration is that out of our >>> cable modem there is an Ethernet hub. 3 cables come out of this hub >>> and go to routers, one in my office in one part of the house, one in >>> my wife's office, and one to our wifi. These have been added as >>> requirements came about so this probably isn't the best configuration. >>> At the present we don't use the network to access machines in other >>> parts of the system. I have several in my office that access each >>> other, but they are on the same router. I do want to stay with the >>> wired systems to the offices. We just added a home security system >>> that can be monitored over the network. It is connected to my router >>> as it is closest to the box. I can access the system by typing in it's >>> IP address. Now I am trying to access it from other points in the >>> network and the IP is not visible. As you can probably tell I am >>> network challenged. I think what I need to do is find the IP address >>> of the security system from outside my router. How can this be done? >>> >>> Thanks >>> >>> Doug >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From kismert at gmail.com Mon Apr 11 12:10:29 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 12:10:29 -0500 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] Message-ID: John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > From accessd at shaw.ca Mon Apr 11 12:32:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 10:32:07 -0700 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: Excellent summary and words (code) to live by. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Monday, April 11, 2011 10:10 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: Autonumber when?] John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 12:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 13:47:23 -0400 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: <4DA33EAB.70505@colbyconsulting.com> Ken, I understand the reasoning and all however... because the code is no longer contained within the object that needs it, you now open yourself up to the old "I need to modify this method... oops... that change breaks something else that uses the code". Class programming exists for a reason. Placing code in the object that needs the code exists for a reason. Black box programming exists for a reason. The reason in many cases is to prevent exactly this kind of interaction when we accidentally change a piece of code used in many places and break one of those places. Yes, there are instances where lots of different things need the exact same code, and yes, I have been known to call module functions from classes, but it truly is a questionable practice in most cases. John W. Colby www.ColbyConsulting.com On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > John, All: > > I'm going to expand a little on what I'm trying to get at. This post really > isn't advice on what you should do. And it certainly isn't criticism. > > I have been returning to the old Lisp idea of functional programming: > libraries of functions that act only on their inputs and only return a > result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > external variables are never referenced. If a function needs to return > complex information, it returns either a type or an object. Database > functions unavoidably have side-effects, but these are regarded as > 'external' to the code, and are explicitly documented. > > The thing that surprised me was how well libraries play with objects. > Libraries provide discrete, testable chunks of code that support any > instance. Libraries separate functions into common-sense groups. Classes > provide an instance wrapper over the libraries, stringing functions together > to support the application. > > Plus, it is pretty easy to convert classes to this scheme while maintaining > compatibility. > > The advantages became apparent when I refactored some of my early monolithic > classes. These large, 'kitchen sink' classes had dozens of methods which > mixed database, business, and application functionality. They were unwieldy, > hard-to-understand, and hard-to-extend. I simply copied the class into a > module, stripped out the instance stuff (properties and module-level > variables), and turned the methods into side-effect-free functions. I then > stripped out the code within the original class methods, turning them into > wrappers calling library functions with their instance variables. > > The result: classes become lightweight, making their functionality much more > obvious. Compatibility is maintained, but the new system is much easier to > refactor and extend. > > The class on-top-of function approach is also a good answer to those who > want to re-use your code, but can't because they need some method that is > marked private in a class. They typically demand that all methods be made > public, which is usually silly because the class designer has good reasons > for limiting the public visibility of certain methods or properties. > > But with a function library, you can have your cake and eat it, too. Classes > hold the instance information, and interact with libraries in an > instance-safe way, because the functions never modify their inputs. Others > with different needs can call the functions directly, or write their own > classes. Heck, I even find myself cramped by my own classes at times, and > having the option to call underlying functions directly has benefited me. > > Writing test code for functions is much easier than for complex class > systems. Test code provides reasonable proof of reliability. Reliable > complexity can only be built out of small, simple, understandable, and > testable pieces. > > -Ken > > >> ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Wed, 6 Apr 2011 15:13:46 -0500 >> Subject: Re: [AccessD] Autonumber when? >>> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> >> >> >> ---------- Forwarded message ---------- >> From: jwcolby >> To: Access Developers discussion and problem solving< >> accessd at databaseadvisors.com> >> Date: Wed, 06 Apr 2011 16:38:13 -0400 >> Subject: Re: [AccessD] Autonumber when? >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> From rusty.hammond at cpiqpc.com Mon Apr 11 13:00:35 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:00:35 -0500 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Mon Apr 11 13:05:06 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:05:06 -0500 Subject: [AccessD] New Language In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, that's my duh moment for the afternoon. I'll look at the msdn link below. Rusty -----Original Message----- From: Rusty Hammond Sent: Monday, April 11, 2011 1:01 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Mon Apr 11 13:45:52 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Mon, 11 Apr 2011 14:45:52 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <003c01cbf868$d4127de0$7c3779a0$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> Message-ID: <4CF42796B1DC41E2B84C92485E599533@LaptopII> Doug, No need to replace the three routers; use can use them as a hub. The trick is to disable the DNS in reach, set RIP to none, and then when you connect to the one router after the cable modem, plug the cable into the LAN port (not the WAN port as it is now). This also effectively turns a Wireless Router into a simple Wireless Access point. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 11, 2011 12:52 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 14:14:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:14:50 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3532A.9040606@colbyconsulting.com> And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From jwcolby at colbyconsulting.com Mon Apr 11 14:16:12 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:16:12 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3537C.7010509@colbyconsulting.com> Oh... some routers use 192.168.1.xx instead of 1.9.168.0.xx in which case you have to modify my previous advice to match what your router uses. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From accessd at shaw.ca Mon Apr 11 14:58:10 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 12:58:10 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> My daughters have all grown up with computers. From childhood, their rooms have been wired for computers...coax cable and all. My oldest daughter learned to type on the keyboard before she could talk. She would sit in my lap and enter the keys as I called them out. She could start up the Commodore 64 and load games from memory. My youngest daughter made her first web site when she was ten, a Sailor-moon site. ;-) At that time she used notepad to build her site and she knew more about web sites and HTML coding than I did. Today, both my daughters are married or in a long term relationship with programmers (both with a least one degree in computer science) and they all work in the business; one in computer graphic designer (and fashion design) and two in animation and one as an application developer but if pushed the girls are both pretty good programmers (At the age of 15 my oldest daughter was short-listed in a job competition and the company sent her their whole software line as a consolation...It was Blizzard software with Warcraft etc.) The one I feel sorry for is my wife Maria who totally non-computer literate and has to listen to rest of the family talk shop and coding etc. at ever family gathering. I really hope your wife likes computers. ;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 9:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 15:02:08 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 13:02:08 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA3532A.9040606@colbyconsulting.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> Message-ID: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Mon Apr 11 15:09:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 15:09:32 -0500 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: John, I understand the reasoning and all however... because the code is no longer > contained within the object that needs it, you now open yourself up to the > old "I need to modify this method... oops... that change breaks something > else that uses the code". > It is always possible to over-factor, and merge two similar pieces of code together that really should be separate. In that case, you factor the code back into multiple pieces, and correct the dependencies. > Class programming exists for a reason. Placing code in the object that > needs the code exists for a reason. Black box programming exists for a > reason. The reason in many cases is to prevent exactly this kind of > interaction when we accidentally change a piece of code used in many places > and break one of those places. > I would submit that calling side-effect free functions from a class does not pierce the black box. The important things, state and access, are protected by the class. But the function can be anywhere: built-in VBA functions, Access application methods, or DAO library calls. You undoubtedly call these functions from within your classes. > Yes, there are instances where lots of different things need the exact same > code, and yes, I have been known to call module functions from classes, but > it truly is a questionable practice in most cases. > Test cases replace questionability with a guarantee of proper function. The function shouldn't define what it does -- the test cases should. If changes to a function break a test, then you know immediately that there is a problem. Functional unit testing guards against changes that would break dependent code. I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. -Ken > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > >> John, All: >> >> I'm going to expand a little on what I'm trying to get at. This post >> really >> isn't advice on what you should do. And it certainly isn't criticism. >> >> I have been returning to the old Lisp idea of functional programming: >> libraries of functions that act only on their inputs and only return a >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> external variables are never referenced. If a function needs to return >> complex information, it returns either a type or an object. Database >> functions unavoidably have side-effects, but these are regarded as >> 'external' to the code, and are explicitly documented. >> >> The thing that surprised me was how well libraries play with objects. >> Libraries provide discrete, testable chunks of code that support any >> instance. Libraries separate functions into common-sense groups. Classes >> provide an instance wrapper over the libraries, stringing functions >> together >> to support the application. >> >> Plus, it is pretty easy to convert classes to this scheme while >> maintaining >> compatibility. >> >> The advantages became apparent when I refactored some of my early >> monolithic >> classes. These large, 'kitchen sink' classes had dozens of methods which >> mixed database, business, and application functionality. They were >> unwieldy, >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> module, stripped out the instance stuff (properties and module-level >> variables), and turned the methods into side-effect-free functions. I then >> stripped out the code within the original class methods, turning them into >> wrappers calling library functions with their instance variables. >> >> The result: classes become lightweight, making their functionality much >> more >> obvious. Compatibility is maintained, but the new system is much easier to >> refactor and extend. >> >> The class on-top-of function approach is also a good answer to those who >> want to re-use your code, but can't because they need some method that is >> marked private in a class. They typically demand that all methods be made >> public, which is usually silly because the class designer has good reasons >> for limiting the public visibility of certain methods or properties. >> >> But with a function library, you can have your cake and eat it, too. >> Classes >> hold the instance information, and interact with libraries in an >> instance-safe way, because the functions never modify their inputs. Others >> with different needs can call the functions directly, or write their own >> classes. Heck, I even find myself cramped by my own classes at times, and >> having the option to call underlying functions directly has benefited me. >> >> Writing test code for functions is much easier than for complex class >> systems. Test code provides reasonable proof of reliability. Reliable >> complexity can only be built out of small, simple, understandable, and >> testable pieces. >> >> -Ken >> >> From charlotte.foust at gmail.com Mon Apr 11 15:22:19 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 13:22:19 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: I have to say, that I would put those module level functions into a utility class and call the class method. I don't like calling module level stuff from a class. The built in things you call are already part of a library/dll so it isn't the same. Charlotte Foust On Mon, Apr 11, 2011 at 1:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. ?Placing code in the object that >> needs the code exists for a reason. ?Black box programming exists for a >> reason. ?The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. ?Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 15:25:26 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:25:26 -0400 Subject: [AccessD] New Language In-Reply-To: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> Message-ID: <4DA363B6.8000005@colbyconsulting.com> My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim From jwcolby at colbyconsulting.com Mon Apr 11 15:36:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:36:04 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA36634.3080604@colbyconsulting.com> > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object that >> needs the code exists for a reason. Black box programming exists for a >> reason. The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> From dw-murphy at cox.net Mon Apr 11 15:42:36 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 13:42:36 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <006c01cbf888$fded7730$f9c86590$@cox.net> Great info. Thanks guys. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Apr 11 16:59:04 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 01:59:04 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA36634.3080604@colbyconsulting.com> References: <4DA36634.3080604@colbyconsulting.com> Message-ID: <85CF23CEAE904982B6ED4556F847CB7B@nant> <<< I doubt seriously that anyone uses your paradigm in .net. >>> http://fsharp.net ? -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 12 ?????? 2011 ?. 0:36 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no > longer >> contained within the object that needs it, you now open yourself up >> to the old "I need to modify this method... oops... that change >> breaks something else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object >> that needs the code exists for a reason. Black box programming >> exists for a reason. The reason in many cases is to prevent exactly >> this kind of interaction when we accidentally change a piece of code >> used in many places and break one of those places. >> > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > >> Yes, there are instances where lots of different things need the >> exact same code, and yes, I have been known to call module functions >> from classes, but it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really isn't advice on what you should do. And it certainly isn't >>> criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return >>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>> modified, and external variables are never referenced. If a function >>> needs to return complex information, it returns either a type or an >>> object. Database functions unavoidably have side-effects, but these >>> are regarded as 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. >>> Classes provide an instance wrapper over the libraries, stringing >>> functions together to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic classes. These large, 'kitchen sink' classes had dozens >>> of methods which mixed database, business, and application >>> functionality. They were unwieldy, hard-to-understand, and >>> hard-to-extend. I simply copied the class into a module, stripped >>> out the instance stuff (properties and module-level variables), and >>> turned the methods into side-effect-free functions. I then stripped >>> out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality >>> much more obvious. Compatibility is maintained, but the new system >>> is much easier to refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those >>> who want to re-use your code, but can't because they need some >>> method that is marked private in a class. They typically demand that >>> all methods be made public, which is usually silly because the class >>> designer has good reasons for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. >>> Others with different needs can call the functions directly, or >>> write their own classes. Heck, I even find myself cramped by my own >>> classes at times, and having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex >>> class systems. Test code provides reasonable proof of reliability. >>> Reliable complexity can only be built out of small, simple, >>> understandable, and testable pieces. >>> >>> -Ken >>> >>> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 17:07:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 15:07:07 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA363B6.8000005@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> Message-ID: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> It sounds like your daughter has a very rare disease and her life will be very challenged. It does appear that she is growing up in the best environment and will be able to reach her full potential. It seems that she has achieved a great deal and has an almost gifted ability with computers. Your little scientist sounds like he is off to a great start and with you as his father his success is assured. Now I had better watch out for the Off Topic police...;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Mon Apr 11 18:35:02 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 12 Apr 2011 09:35:02 +1000 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <201104112335.p3BNZAnu007707@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Hi John, My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. good luck John, keep keeping us informed on your progress here. regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 12 April 2011 2:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From BradM at blackforestltd.com Mon Apr 11 20:04:51 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Mon, 11 Apr 2011 20:04:51 -0500 Subject: [AccessD] New Language References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Mon Apr 11 20:17:17 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 18:17:17 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no "module", > though there can be static classes / functions. ?I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Apr 11 21:39:31 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 19:39:31 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <000301cbf8ba$d9f66440$8de32cc0$@cox.net> Thanks all. A few of your suggested tweaks and all is good. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 00:58:20 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 09:58:20 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA36634.3080604@colbyconsulting.com><85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: Hi Charlotte -- No, wait - in fact VB.NET and C# do support first-order functional programming paradigms (LINQ and related stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html And here they say that MS Excel is a kind of functional programming environment http://en.wikipedia.org/wiki/Functional_programming So you should know and use them for quite some time already - foundations of functional programming paradigm... :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 12 ?????? 2011 ?. 5:17 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no > "module", though there can be static classes / functions. ?I haven't > done a poll, but I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you >> factor the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and >> access, are protected by the class. But the function can be anywhere: >> built-in VBA functions, Access application methods, or DAO library >> calls. You undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test >> cases should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This >>>> post really isn't advice on what you should do. And it certainly >>>> isn't criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only >>>> return a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a >>>> function needs to return complex information, it returns either a >>>> type or an object. Database functions unavoidably have >>>> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support >>>> any instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to >>>> those who want to re-use your code, but can't because they need >>>> some method that is marked private in a class. They typically >>>> demand that all methods be made public, which is usually silly >>>> because the class designer has good reasons for limiting the public >>>> visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying >>>> functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> From jwcolby at colbyconsulting.com Tue Apr 12 05:18:31 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:18:31 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: <4DA426F7.7000803@colbyconsulting.com> Well, now we are all happy! ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 5:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net.>>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? Everything is an object. There is no "module", > though there can be static classes / functions. I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. Placing code in the object >>> that needs the code exists for a reason. Black box programming >>> exists for a reason. The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 12 05:50:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:50:28 -0400 Subject: [AccessD] New Language In-Reply-To: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> Message-ID: <4DA42E74.6040007@colbyconsulting.com> > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim From jwcolby at colbyconsulting.com Tue Apr 12 08:03:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 09:03:11 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA44D8F.7060106@colbyconsulting.com> I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... From jimdettman at verizon.net Tue Apr 12 09:09:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 12 Apr 2011 10:09:29 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA44D8F.7060106@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rusty.hammond at cpiqpc.com Tue Apr 12 09:15:00 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 12 Apr 2011 09:15:00 -0500 Subject: [AccessD] New Language In-Reply-To: References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14E@CPIEMAIL-EVS1.CPIQPC.NET> Thanks Brad. That looks promising. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Monday, April 11, 2011 8:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Tue Apr 12 09:54:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 10:54:11 -0400 Subject: [AccessD] New Language In-Reply-To: <201104112335.p3BNZAnu007707@databaseadvisors.com> References: <201104112335.p3BNZAnu007707@databaseadvisors.com> Message-ID: <4DA46793.6090507@colbyconsulting.com> from http://en.wikipedia.org/wiki/BASIC The eight design principles of BASIC were: 1. Be easy for beginners to use. 2. Be a general-purpose programming language. 3. Allow advanced features to be added for experts (while keeping the language simple for beginners). 4. Be interactive. 5. Provide clear and friendly error messages. 6. Respond quickly for small programs. 7. Not to require an understanding of computer hardware. 8. Shield the user from the operating system. There are phases in learning to program. 0) Selecting a learning tool 1) learning programming concepts, keywords and constructs (loops / tests) 2) coming up with an idea of something to program 3) selecting a tool to implement the idea 4) Learning the tool 5) Implementing that idea 6) Go to 1 Whether or not basic will be around in the future it is a good language for starting to learn to program. IMHO, more than anything else, the programming environment and specifically the ease or difficulty of use of that environment determines the success of learning to program. Access and VBA is certainly not the easiest to use environment, but it is still very easy. Creating a database is easy. Creating a new module is easy. Creating a form and button and text box is easy. You can progress one step at a time. 1) Here is how to build a database container. 2) Here is how to create a module and save it 3) Here is how to open that module and add a function 4) Here is the debug window - how to execute that method and see a result. etc. The advantage of starting in Access is that while you are at it, you're teaching the concepts in a real life environment, which has enormous power to "go to the next step" particular in database applications. 5) here is how to create a table (and what a table is) 6) Fields 7) open and enter data (cool, the data is stored!) All tightly integrated. 8) Here is a form and a button. 9) here is the code that runs when the button is clicked. easy to move on to more stuff, interesting stuff, stuff that can earn Dad money... ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 7:35 PM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > Hi John, > > My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. > > good luck John, keep keeping us informed on your progress here. > > regards > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, 12 April 2011 2:27 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My 10 year old son is independently and without prompting asking dad to teach him how to program a > computer. :) > > It appears that he has decided that what dad does is pretty cool. > > Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. > IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute > code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things > like a simple "add two numbers" first project. > > Does anyone want to share "teaching the kids" stories? > > John W. Colby > www.ColbyConsulting.com > > On 3/25/2011 5:41 PM, Stuart McLachlan wrote: >> For all you people who are looking at moving away from Acces who want something easy to >> use and are wedded to the .Net world, MS have just the thing for you: >> >> http://msdn.microsoft.com/en-us/beginner/ff384126.aspx >> >> :-) >> >> >> From bheygood at abestsystems.com Tue Apr 12 10:34:43 2011 From: bheygood at abestsystems.com (b heygood) Date: Tue, 12 Apr 2011 08:34:43 -0700 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: <669B553C66A64AB6924FBE3758A17756@Seven> thanks for all your work. bob heygood -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Saturday, April 09, 2011 6:50 PM To: administrivia at databaseadvisors.com Subject: [AccessD] Administrivia - DBA Server Downtime Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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!" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Tue Apr 12 10:38:39 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 10:38:39 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: >Charlotte Foust: > I have to say, that I would put those module level functions into a > utility class and call the class method. I don't like calling module > level stuff from a class. The built in things you call are already > part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is > no "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses > your paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support first-order > functional programming paradigms (LINQ and related stuff...) > http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional > programming environment > http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > John, > > I understand the reasoning and all however... because the code is no longer > > contained within the object that needs it, you now open yourself up to > the > > old "I need to modify this method... oops... that change breaks something > > else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object that > > needs the code exists for a reason. Black box programming exists for a > > reason. The reason in many cases is to prevent exactly this kind of > > interaction when we accidentally change a piece of code used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class does > not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call > these > functions from within your classes. > > > > Yes, there are instances where lots of different things need the exact > same > > code, and yes, I have been known to call module functions from classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This post > >> really > >> isn't advice on what you should do. And it certainly isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only return a > >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > >> external variables are never referenced. If a function needs to return > >> complex information, it returns either a type or an object. Database > >> functions unavoidably have side-effects, but these are regarded as > >> 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support any > >> instance. Libraries separate functions into common-sense groups. Classes > >> provide an instance wrapper over the libraries, stringing functions > >> together > >> to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining > >> compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic > >> classes. These large, 'kitchen sink' classes had dozens of methods which > >> mixed database, business, and application functionality. They were > >> unwieldy, > >> hard-to-understand, and hard-to-extend. I simply copied the class into a > >> module, stripped out the instance stuff (properties and module-level > >> variables), and turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality much > >> more > >> obvious. Compatibility is maintained, but the new system is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to those who > >> want to re-use your code, but can't because they need some method that > is > >> marked private in a class. They typically demand that all methods be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write their own > >> classes. Heck, I even find myself cramped by my own classes at times, > and > >> having the option to call underlying functions directly has benefited > me. > >> > >> Writing test code for functions is much easier than for complex class > >> systems. Test code provides reasonable proof of reliability. Reliable > >> complexity can only be built out of small, simple, understandable, and > >> testable pieces. > >> > >> -Ken > From jwcolby at colbyconsulting.com Tue Apr 12 11:03:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 12:03:54 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA477EA.3010002@colbyconsulting.com> My question is, why do regression testing if we never regress? I write these functions and they are done. They work or they don't. We are currently testing them manually. Take the flag class, dead simple. It reads / writes to SQL server or it doesn't. We test the flag by actually using it and watching that the flag sets. It works, it is used forever. That is a simple example but the concept extends. It is not that we do not test, we do but once these functions work we are not modifying them. Actually in fact, we do paradigm changes (code functions custom written to read / write the flags in SQL Server to a flag class), but even here, the new flag class entirely replaces a couple of dozen functions, each of which wrote one flag. I would like to stress that it is not testing that I question, it is not unit testing that I question, it is when and where it might be applied, and when and where it is more trouble than it is worth. John W. Colby www.ColbyConsulting.com On 4/12/2011 10:09 AM, Jim Dettman wrote: > John, > > If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > For example, I develop a customer class, which handles CRUD operations for > customers. > > As result, I would develop four separate basic unit tests for that object: > > 1. Adding a record. > 2. Deleting a record. > 3. Reading a record. > 4. Updating a record. > > Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. A function > can be made to accept > args and return a value and never modify anything external to itself. It > would make programming > some functionality much more complicated however. Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. The > process builds that. No flag > is used, we just ask SQL server whether the objects exist and create them if > not. When we *fill* > that table, a piece of SQL code executed in a function. That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. *IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. The function itself does not modify the parameters passed > in. It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. I went to a > great deal of effort to get all of this stuff working this way. I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. I am not sitting at a desk collecting a paycheck regardless of what > I produce. I do not > have a test department, I am the test department. I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... From accessd at shaw.ca Tue Apr 12 12:39:27 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 10:39:27 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA42E74.6040007@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> <4DA42E74.6040007@colbyconsulting.com> Message-ID: Wasn't it Henry Fonda that said, and allow me to paraphrase, "The most successful people are either very smart or very nice." I wish you daughter well. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 3:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 12:54:27 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 21:54:27 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Hi Ken -- <<< VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. >>> Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) has limited capabilities - the issue is that VBA implementation (within MS Office) is "crappy"... I mean that when one tries to go to use advanced VBA features, which should work by definition, they get all kinds of "blues" - and MS answer is that VBA wasn't intended to be used like that... And when everything is done within VBA (syntax and semantics) why there should be any mentioning of any programmers'/developers' intentions which go beyond VBA capabilities? That "limited capability by implementation" was the main reason I did mainly quit VBA development ... <<< The Lisp idea of closures is fundamental to getting JavaScript to do lots of useful things. >>> I have read/learned LISP in theory quite some time ago - and I must note I'm ignorant in this area... Yes, JavaScript is a great programming language - I'm (trying) to get it mastered now (OO JavaScript) - and I really like it... And the paradox is that JavaScript isn't an Object Oriented language but how powerful and flexible it's to simulate all/most of OOP concepts... <<< If a block of code doesn't require state, why should it be in a class? >>> OOP IMO is more useful/natural way to design and to develop software solutions simulating real world "objects" behaviors... Yes, the more loosely coupled and the less stateful one gets their classes designed the more they look like just "standard" modules with functions... (This World is dual isn't it?)... <<< F# is one of the most interesting .NET languages for me. >>> Yes, it looks interesting here too but I doubt I will have an opportunity to learn and to use it in the near future... But who knows how it all will evolve... <<< You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. >>> I'm not sure how do you use VBA in TDD - could you please elaborate a bit more on this subject here? Do you have your custom VBA TDD framework? Or you just develop and use special test VBA modules/functions and call that stuff TDD? That's OK with me - I'm just wondering what practice is behind your VBA TDD terminology... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 12 ?????? 2011 ?. 19:39 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] >Charlotte Foust: > I have to say, that I would put those module level functions into a >utility class and call the class method. I don't like calling module >level stuff from a class. The built in things you call are already >part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is no > "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses your > paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support > first-order functional programming paradigms (LINQ and related > stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional programming > environment http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, > > I understand the reasoning and all however... because the code is no > longer > > contained within the object that needs it, you now open yourself up > > to > the > > old "I need to modify this method... oops... that change breaks > > something else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object > > that needs the code exists for a reason. Black box programming > > exists for a reason. The reason in many cases is to prevent exactly > > this kind of interaction when we accidentally change a piece of code > > used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > > > Yes, there are instances where lots of different things need the > > exact > same > > code, and yes, I have been known to call module functions from > > classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This > >> post really isn't advice on what you should do. And it certainly > >> isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only > >> return a result. The goal is 'side-effect-free' -- inputs are NEVER > >> modified, and external variables are never referenced. If a > >> function needs to return complex information, it returns either a > >> type or an object. Database functions unavoidably have > >> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support > >> any instance. Libraries separate functions into common-sense > >> groups. Classes provide an instance wrapper over the libraries, > >> stringing functions together to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic classes. These large, 'kitchen sink' classes had dozens > >> of methods which mixed database, business, and application > >> functionality. They were unwieldy, hard-to-understand, and > >> hard-to-extend. I simply copied the class into a module, stripped > >> out the instance stuff (properties and module-level variables), and > >> turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning > >> them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality > >> much more obvious. Compatibility is maintained, but the new system > >> is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to > >> those who want to re-use your code, but can't because they need > >> some method that > is > >> marked private in a class. They typically demand that all methods > >> be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write > >> their own classes. Heck, I even find myself cramped by my own > >> classes at times, > and > >> having the option to call underlying functions directly has > >> benefited > me. > >> > >> Writing test code for functions is much easier than for complex > >> class systems. Test code provides reasonable proof of reliability. > >> Reliable complexity can only be built out of small, simple, > >> understandable, and testable pieces. > >> > >> -Ken > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 13:02:26 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 22:02:26 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: Hi Jim -- <<< As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. >>> That would be called "integration tests" wouldn't they? That above is a bit "provocative" question I must admit to "fire" new here (?) Unit testing vs. Integration testing vs. Regression testing vs. ... testing Great Debate :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: 12 ?????? 2011 ?. 18:09 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up >> to the >> old "I need to modify this method... oops... that change breaks >> something else that uses the code". ... From kismert at gmail.com Tue Apr 12 15:11:57 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:11:57 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken From charlotte.foust at gmail.com Tue Apr 12 15:22:00 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 12 Apr 2011 13:22:00 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: NUnit testing is a learning experience in itself. Many of the basic tests can be scripted, which my previous employer finally did. However, the business rules tests needed to be hand written, and they largely dispensed with them, which didn't make a lot of sense to me. Every time a new rule was created, all the test would be run again just to be sure nothing got knocked sideways in the process. It is an incredible tool in .Net. Wish it were/had been available in Access. Charlotte Foust On Tue, Apr 12, 2011 at 7:09 AM, Jim Dettman wrote: > John, > > ?If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > ?As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > ?For example, I develop a customer class, which handles CRUD operations for > customers. > > ?As result, I would develop four separate basic unit tests for that object: > > ?1. Adding a record. > ?2. Deleting a record. > ?3. Reading a record. > ?4. Updating a record. > > ?Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > ?So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". ?OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. ?If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. ?To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. ?A function > can be made to accept > args and return a value and never modify anything external to itself. ?It > would make programming > some functionality much more complicated however. ?Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). ?Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". ?The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". ?It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. ?So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. ?Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. ?The > process builds that. ?No flag > is used, we just ask SQL server whether the objects exist and create them if > not. ?When we *fill* > that table, a piece of SQL code executed in a function. ?That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. ?*IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. ?The function itself does not modify the parameters passed > in. ?It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. ?There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? ?Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. ?I went to a > great deal of effort to get all of this stuff working this way. ?I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. ?They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". ?I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... ?This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ?;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. ?I am not sitting at a desk collecting a paycheck regardless of what > I produce. ?I do not > have a test department, I am the test department. ?I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kismert at gmail.com Tue Apr 12 15:48:47 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:48:47 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Let me give some examples of how I use function libraries, which might help illustrate what I'm talking about. Example 1: Factoring a Monolithic Business Class ======================================= I had a class, that I will call CPart, that had dozens and dozens of functions for dealing with parts. I had methods like CPart.Read and CPart.Save, with a CPart.Part property that I set before reading or saving a part. All was good until I got into situations where I just wanted to read an arbitrary part, without upsetting all of the delicate state that had built up for the 'Current' part. Yes, I could have created another instance of CPart, but it was monolithic, and represented the current (complex) state of the application, which seemed like a lot of effort just to read a part. So, for my first (bad) fix, I made optional parameters, like CPart.Read(Optional vPart As Variant), with internal code: If IsMissing(vPart) Then ' use member variable mvPart Else ' use given vPart End If ' specific code to read part ... Yes, my class inevitably got peppered with these optional parameters and If constructs, which started getting in the way of what the class was really trying to do, added extra complexity, and made it harder to debug and understand. During refactoring, I realized how I could simplify things: I built a module called MPart, with a function PartRead that took a required vPart parameter and returned a part structure or an error. The CPart methods lost their optional parameters and all the If statement nonsense, and the Part method's internal code reduced down to: tPart = MPart.PartRead(mvPart). External code could just call MPart.PartRead directly, without having to bother with creating and initializing a temporary CPart instance. Simplicity, readability, and testability improved all around. CPart shrank dramatically, making it easier to factor in the future. Example 2: Topical Function Libraries ============================= Over time, I have built up quite a few specialized modules for dealing with standard things in standard ways. For instance, MArray deals with arrays. MCollection holds very useful functions for Collections, similarly MString for strings and MVariant for variants. There are also more specialized libraries, like MMD5 for md5 hashes, and MMJD for Modified Julian Dates. There are lots of application-specific function libraries like MPart as well. These module functions have replaced sometimes a dozen half-assed and inconsistently written variations on a theme with one well-tested and thought-through piece of code that is portable among all of my applications. Moving standard code to a new application often reveals unknown weaknesses, which when fixed, strengthen the code for all applications. I find this to be a profitable way to bring consistency, flexibility and stability to my coding efforts. -Ken From accessd at shaw.ca Tue Apr 12 16:16:33 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:16:33 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <528397A8E9B14C68B8F6ACE8E43D0F39@creativesystemdesigns.com> The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking togther applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes closed...in another 5 years...maybe. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Apr 12 16:22:32 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:22:32 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <1E56BD82BB8A46A5A1A19FAB77E0B0C4@creativesystemdesigns.com> Sorry about the previous post but I was typing too fast and hit the mouse pad with the heel of my palm and the post was on it way. The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking together applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes (nearly) closed...in another 5 years...maybe. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 12 21:12:35 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 22:12:35 -0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <4DA50693.1040907@colbyconsulting.com> Ken, This stuff is all C# / SQL Server (and a Virtual Machine running a third party app) and is not the same as my framework in Access. This thing is really a custom written application specific to the needs of a single client. I wrote it and have re-factored it a couple of times as my knowledge increased in C#. It is slowly turning into an impressive system. I really wrote it because I was doing everything manually and it was a PITA, error prone (because it was all manual) and just plain not fun! The more I automated the process, the more the client was impressed. To this day the client really has no idea what what the system looks like or how it really works. He is in New York and I am in NC, and he basically has no knowledge of what is involved to do this stuff. He has his business, and I have mine - which is to make his business hum. What impresses him is that he knows (because I billed him for the hours) that doing an order used to take two days for the simplest order. Now it takes well under a day and for simple orders it can be done in a few hours. He used to send me count requests and it used to take an hour and it was a big enough pain that I might not get the results back to him until the next day. Now I get the count order and I can get the results back to him in 5-10 minutes if I can give it my immediate attention. I now have a program where I select a CSV file containing zips and the program does the counts, I press a button and the counts are pasted into an email and emailed off to him (and CC myself). So while he can't see the system (or understand it if he could) he can *feel* the system. I didn't do this to impress the customer I did this to keep the customer and to save my sanity. I now have nine lists which total about 350 million names, and I really need to process every list every month. I can only process 2 million names at a time through the third party software and each chunk takes about 50 minutes average. That's 175 chunks * 50 minutes of processing monthly - 146 hours of computer time every month. To do this stuff "manually" took me 2-3 times that long I am finally getting to the point where the system can do all of that unattended. And... I can process orders on-the-fly and they will break into the queue and jump to the head of the processing line. I'm here to tell you I could not do that manually, and if I were able to the customer would not be willing to pay me the hours required to do that. It really is an impressive system and it has been written (evolved really) starting somewhere around December 2009, so about 16 months, and I was learning C# as I went, which explains much of the refactoring. Now I finally get to relax a little bit and enjoy the fruits of my labor. John W. Colby www.ColbyConsulting.com On 4/12/2011 4:11 PM, Kenneth Ismert wrote: > All, > >> jwcolby: >> ... >> But in general the class functions are only used in the class. A function >> can be made to accept args and return a value and never modify anything >> external to itself. It would make programming some functionality much more >> complicated however. Let's take an example. ... >> > > You have a very impressive system with a lot of capability. But frameworks > have their own inertia: for all that they do, they unquestionably limit your > choices and reduce your options for their sheer bulk. I have wrestled with > this in building my own frameworks, and have entirely dismissed third party > frameworks (Symphony comes to mind) for the thunderous overhead they impose. From shamil at smsconsulting.spb.ru Wed Apr 13 08:24:42 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 17:24:42 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <7732C63F31AF47ADA03F1D17DE33837F@nant> Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 13 08:59:27 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 13 Apr 2011 09:59:27 -0400 Subject: [AccessD] mscomctl In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA5AC3F.4060602@colbyconsulting.com> I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com From phpons at gmail.com Wed Apr 13 09:27:35 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 16:27:35 +0200 Subject: [AccessD] How to hide info within a db? Message-ID: Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS From edzedz at comcast.net Wed Apr 13 09:38:47 2011 From: edzedz at comcast.net (Edward Zuris) Date: Wed, 13 Apr 2011 08:38:47 -0600 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <000001cbf9e8$802246d0$5bdea8c0@edz1> Thanks for the information. I was thinking of getting that book. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 7:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Wed Apr 13 10:11:51 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Wed, 13 Apr 2011 10:11:51 -0500 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> There is no encryption available at the table level. However, there are a few things that can be done to hide information... although if a person is a good VBA / Access programmer they could get around them. Creating an encrypted version does nothing to hide the data if one chooses to link or import tables. 1. Hiding the table is the first step... I might consider pending the table with "USys" to signify the table is a user system table. That hides the table unless the user unhides it in the parameters. 2. Roll your own encryption to the field. I call it encryption, but actually all you can do is store the data in Unicode using the StrConv function. When a user attempts to view the data in the table view, all they see is the first character of the field. If you change the field's input mask to password then the length of the field is seen but the number of characters represents the number of bytes in Unicode. For example: Social Security Numbers are nine digits in length, but in Unicode its stored as 18. Just make sure the field's length is long enough to store the extra digits. If they click into the field only one asterisk is seen. They can't copy or paste the data either. Of course this requires that you "encrypt" and "decrypt" each time you need to use the data. One more caveat... a person who sees the asterisk or the one character in length to be able decrypt the field they need to first realize HOW it was modified. 3. In Access 2007, create a ACCDE file. This locks everything down and enables the code to run faster. After the file is created... change the extension to ACCDR. This tells Access it's a runtime version. If someone tries to link or import tables from a runtime version, the file does not show BUT they could paste the name of the file into the dialog box and then it can be linked or imported. I do all three, although my table is not a system table. To the inexperienced or the casual user, these are adequate to keep the information safe. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 9:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Wed Apr 13 10:17:56 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 13 Apr 2011 11:17:56 -0400 Subject: [AccessD] mscomctl In-Reply-To: <4DA5AC3F.4060602@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> <4DA5AC3F.4060602@colbyconsulting.com> Message-ID: <6D90731D044D4616A0CBB207291B4C5C@Gateway> Usually, just regsvr32 "fullpath_in_quotes" Can be done in bat, but may need permissions. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 13, 2011 9:59 AM To: Access Developers discussion and problem solving Subject: [AccessD] mscomctl I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 13 11:01:11 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 09:01:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Keep in mind that I come from a .Net world where everything is an object, so I learned to deal with that orientation. Once you get accustomed to that, it makes sense to do it that way. It's all black boxes. Charlotte Foust On Tue, Apr 12, 2011 at 8:38 AM, Kenneth Ismert wrote: >>Charlotte Foust: >> I have to say, that I would put those module level functions into a >> utility class and call the class method. ?I don't like calling module >> level stuff from a class. ?The built in things you call are already >> part of a library/dll so it isn't the same. > > But if they are just utility functions, why go through the effort of > instantiating a class, when you can just call it directly in a module? If a > block of code doesn't require state, why should it be in a class? > > As long as you write side-effect-free functions, you can write libraries > that work just as well as the built-in stuff. > >> jwcolby: >> Do you program in .Net? ?Everything is an object. ?There is >> no "module", though there can be static classes / functions. >> I haven't done a poll, but I doubt seriously that anyone uses >> your paradigm in .net. > > Static classes would work just fine for function libraries -- they meet the > criteria of being globally available, and not requiring instantiation. You > can use Namespaces to group and name function libraries, as well. > >> Shamil Salakhetdinov >> http://fsharp.net ? > > F# is one of the most interesting .NET languages for me. I dabbled with > Nemerle years ago, which had all kinds of Lispy features, but it doesn't > seem to be very actively developed now. > >> No, wait - in fact VB.NET and C# do support first-order >> functional programming paradigms (LINQ and related stuff...) >> http://www.info.ucl.ac.be/~pvr/paradigms.html >> And here they say that MS Excel is a kind of functional >> programming environment >> http://en.wikipedia.org/wiki/Functional_programming >> So you should know and use them for quite some time already - >> foundations of functional programming paradigm... ?:) > > Having functions as first-class data types (like strings, doubles, etc) > turns out to be very handy. > The Lisp idea of closures is fundamental to getting Javascript to do lots of > useful things. > Test-driven programming comes from loosely-typed languages like Lisp and > Python. It is a way to define and enforce function, just contracts in > Eiffel. > > VBA is not a very capable language, but you can directly use most of these > ideas, and approximate and simulate others in a more-or-less satisfactory > way. > > You can treat VBA as a loosely-typed, partly functional, test-driven > programming language, and get tangible benefits. > > -Ken > > > ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Mon, 11 Apr 2011 15:09:32 -0500 >> Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 >> John, >> >> I understand the reasoning and all however... because the code is no longer >> > contained within the object that needs it, you now open yourself up to >> the >> > old "I need to modify this method... oops... that change breaks something >> > else that uses the code". >> > >> >> It is always possible to over-factor, and merge two similar pieces of code >> together that really should be separate. In that case, you factor the code >> back into multiple pieces, and correct the dependencies. >> >> >> > Class programming exists for a reason. ?Placing code in the object that >> > needs the code exists for a reason. ?Black box programming exists for a >> > reason. ?The reason in many cases is to prevent exactly this kind of >> > interaction when we accidentally change a piece of code used in many >> places >> > and break one of those places. >> > >> >> I would submit that calling side-effect free functions from a class does >> not >> pierce the black box. The important things, state and access, are protected >> by the class. But the function can be anywhere: built-in VBA functions, >> Access application methods, or DAO library calls. You undoubtedly call >> these >> functions from within your classes. >> >> >> > Yes, there are instances where lots of different things need the exact >> same >> > code, and yes, I have been known to call module functions from classes, >> but >> > it truly is a questionable practice in most cases. >> > >> >> Test cases replace questionability with a guarantee of proper function. The >> function shouldn't define what it does -- the test cases should. If changes >> to a function break a test, then you know immediately that there is a >> problem. Functional unit testing guards against changes that would break >> dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted and >> tested module-level functions. >> >> -Ken >> >> >> > >> > John W. Colby >> > www.ColbyConsulting.com >> > >> > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> > >> >> John, All: >> >> >> >> I'm going to expand a little on what I'm trying to get at. This post >> >> really >> >> isn't advice on what you should do. And it certainly isn't criticism. >> >> >> >> I have been returning to the old Lisp idea of functional programming: >> >> libraries of functions that act only on their inputs and only return a >> >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> >> external variables are never referenced. If a function needs to return >> >> complex information, it returns either a type or an object. Database >> >> functions unavoidably have side-effects, but these are regarded as >> >> 'external' to the code, and are explicitly documented. >> >> >> >> The thing that surprised me was how well libraries play with objects. >> >> Libraries provide discrete, testable chunks of code that support any >> >> instance. Libraries separate functions into common-sense groups. Classes >> >> provide an instance wrapper over the libraries, stringing functions >> >> together >> >> to support the application. >> >> >> >> Plus, it is pretty easy to convert classes to this scheme while >> >> maintaining >> >> compatibility. >> >> >> >> The advantages became apparent when I refactored some of my early >> >> monolithic >> >> classes. These large, 'kitchen sink' classes had dozens of methods which >> >> mixed database, business, and application functionality. They were >> >> unwieldy, >> >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> >> module, stripped out the instance stuff (properties and module-level >> >> variables), and turned the methods into side-effect-free functions. I >> then >> >> stripped out the code within the original class methods, turning them >> into >> >> wrappers calling library functions with their instance variables. >> >> >> >> The result: classes become lightweight, making their functionality much >> >> more >> >> obvious. Compatibility is maintained, but the new system is much easier >> to >> >> refactor and extend. >> >> >> >> The class on-top-of function approach is also a good answer to those who >> >> want to re-use your code, but can't because they need some method that >> is >> >> marked private in a class. They typically demand that all methods be >> made >> >> public, which is usually silly because the class designer has good >> reasons >> >> for limiting the public visibility of certain methods or properties. >> >> >> >> But with a function library, you can have your cake and eat it, too. >> >> Classes >> >> hold the instance information, and interact with libraries in an >> >> instance-safe way, because the functions never modify their inputs. >> Others >> >> with different needs can call the functions directly, or write their own >> >> classes. Heck, I even find myself cramped by my own classes at times, >> and >> >> having the option to call underlying functions directly has benefited >> me. >> >> >> >> Writing test code for functions is much easier than for complex class >> >> systems. Test code provides reasonable proof of reliability. ?Reliable >> >> complexity can only be built out of small, simple, understandable, and >> >> testable pieces. >> >> >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Wed Apr 13 13:19:12 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 20:19:12 +0200 Subject: [AccessD] How to hide info within a db? In-Reply-To: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> References: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> Message-ID: Thank's a lot, Jim, I will try to use you advice. Philippe 2011/4/13 jm.hwsn > There is no encryption available at the table level. > However, there are a few things that can be done to hide information... > although if a person is a good VBA / Access programmer they could get > around > them. Creating an encrypted version does nothing to hide the data if one > chooses to link or import tables. > > 1. Hiding the table is the first step... I might consider pending the > table > with "USys" to signify the table is a user system table. That hides the > table unless the user unhides it in the parameters. > > 2. Roll your own encryption to the field. I call it encryption, but > actually all you can do is store the data in Unicode using the StrConv > function. When a user attempts to view the data in the table view, all > they > see is the first character of the field. If you change the field's input > mask to password then the length of the field is seen but the number of > characters represents the number of bytes in Unicode. For example: Social > Security Numbers are nine digits in length, but in Unicode its stored as > 18. > Just make sure the field's length is long enough to store the extra digits. > If they click into the field only one asterisk is seen. They can't copy or > paste the data either. Of course this requires that you "encrypt" and > "decrypt" each time you need to use the data. One more caveat... a person > who sees the asterisk or the one character in length to be able decrypt the > field they need to first realize HOW it was modified. > > 3. In Access 2007, create a ACCDE file. This locks everything down and > enables the code to run faster. After the file is created... change the > extension to ACCDR. This tells Access it's a runtime version. If someone > tries to link or import tables from a runtime version, the file does not > show BUT they could paste the name of the file into the dialog box and then > it can be linked or imported. > > I do all three, although my table is not a system table. To the > inexperienced or the casual user, these are adequate to keep the > information > safe. > > HTH > Jim > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Wednesday, April 13, 2011 9:28 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] How to hide info within a db? > > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Wed Apr 13 13:37:11 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Wed, 13 Apr 2011 11:37:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <004701cbfa09$cd8869b0$68993d10$@cox.net> Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code > which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 14:02:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 05:02:02 +1000 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4DA5F32A.1919.28625544@stuart.lexacorp.com.pg> Jim has aleady given you some ideas, but there other options depending on exactly what it is you want to hide. How much information? What type of information? Under what cirucmstances? i.e when does it need to hidden and when does it need to be visible? There are a number of simple and resaonable secure encrytion routines you can use when you save/retreive data which just rely on a password which you can have the user enter when they open the application. -- Stuart On 13 Apr 2011 at 16:27, philippe pons wrote: > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 14:22:52 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 14:22:52 -0500 Subject: [AccessD] Dir command trouble Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> I am running the following code to get a list of file folders. All it returns is an empty string. What might I be missing? Sub FileFolderLIst() Dim FileFolder As Variant strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, vbDirectory) End Sub Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From shamil at smsconsulting.spb.ru Wed Apr 13 14:35:07 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 23:35:07 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <004701cbfa09$cd8869b0$68993d10$@cox.net> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> <004701cbfa09$cd8869b0$68993d10$@cox.net> Message-ID: Hi Doug, Not at all - in fact that was Ken who posted that link here: <<< Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: 13 ?????? 2011 ?. 22:37 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, <<< skip>>> Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. <<< skip >>> -Ken -- From kismert at gmail.com Wed Apr 13 14:45:56 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 13 Apr 2011 14:45:56 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: > Charlotte Foust: > Keep in mind that I come from a .Net world where everything is an > object, so I learned to deal with that orientation. Once you get > accustomed to that, it makes sense to do it that way. It's all black > boxes. > One of my points is that you don't have to think about programming constructs in the terms that their designers intended. If, in C#, you have a static class with all public methods, no properties, and no member variables, then it is a 'function library', for all intents and purposes. Write your methods so that they are side-effect free, and you are an instant functional programmer. VBA has no static classes. But, VBA modules allow properties and member variables, so all you have to do is hack in some initialization code, and voila, a VBA 'static class'. If you aren't proud about the 'purity' of the solution, (and trust me, I am not proud), you can approximate a lot of programming concepts the language wasn't intended to support. -Ken From stuart at lexacorp.com.pg Wed Apr 13 15:15:58 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:15:58 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> Message-ID: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:24:23 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:24:23 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> I found my mistake just as you responded. A one character error in the path name. Thanks for the assistance. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:29:42 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:29:42 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> Message-ID: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:34:35 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:34:35 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Problem found! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:43:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:43:18 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Message-ID: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> PEBCAK :-) On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > Problem found! > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > "Pablic" ? :-) > > -- > Stuart > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > I found my mistake just as you responded. A one character error in > > the path name. Thanks for the assistance. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > It works for me on "C:\" > > > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > Dim strPathname As String > > strPathname = "C:\" > > FileFolder = Dir(strPathname) > > FileFolder = Dir(strPathname, vbDirectory) > > Debug.Print FileFolder > > End Sub > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > *only* list the directories rather all files as well. > > > > Sub Test() > > Dim MyPath As String > > Dim MyName As String > > MyPath = "c:\" ' Set the path. > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > While MyName <> "" ' Start the loop. > > ' Ignore the current directory and the encompassing directory. > > If MyName <> "." And MyName <> ".." Then > > ' Use bitwise comparison to make sure MyName is a directory. > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > Then > > Debug.Print MyName ' Display entry only if it > > End If ' it represents a directory. > > End If > > MyName = Dir ' Get next entry. > > Loop > > End Sub > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > I am running the following code to get a list of file folders. All > > > it returns is an empty string. What might I be missing? > > > > > > Sub FileFolderLIst() > > > > > > Dim FileFolder As Variant > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > vbDirectory) > > > > > > End Sub > > > > > > > > > Chester Kaup > > > Engineering Technician > > > Kinder Morgan CO2 Company, LLP > > > Office (432) 688-3797 > > > FAX (432) 688-3799 > > > > > > ? > > > No trees were killed in the sending of this message. However a > > > large number of electrons were terribly inconvenienced. > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Wed Apr 13 15:46:23 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 13 Apr 2011 13:46:23 -0700 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> Message-ID: I hate it when that happens! :) On Wed, Apr 13, 2011 at 1:43 PM, Stuart McLachlan wrote: > PEBCAK :-) > > On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > > > Problem found! > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > "Pablic" ? :-) > > > > -- > > Stuart > > > > > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > > > I found my mistake just as you responded. A one character error in > > > the path name. Thanks for the assistance. > > > > > > -----Original Message----- > > > From: accessd-bounces at databaseadvisors.com > > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > > command trouble > > > > > > It works for me on "C:\" > > > > > > Sub FileFolderLIst() > > > Dim FileFolder As Variant > > > Dim strPathname As String > > > strPathname = "C:\" > > > FileFolder = Dir(strPathname) > > > FileFolder = Dir(strPathname, vbDirectory) > > > Debug.Print FileFolder > > > End Sub > > > > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > > *only* list the directories rather all files as well. > > > > > > Sub Test() > > > Dim MyPath As String > > > Dim MyName As String > > > MyPath = "c:\" ' Set the path. > > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > > While MyName <> "" ' Start the loop. > > > ' Ignore the current directory and the encompassing directory. > > > If MyName <> "." And MyName <> ".." Then > > > ' Use bitwise comparison to make sure MyName is a directory. > > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > > Then > > > Debug.Print MyName ' Display entry only if it > > > End If ' it represents a directory. > > > End If > > > MyName = Dir ' Get next entry. > > > Loop > > > End Sub > > > > > > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > > > I am running the following code to get a list of file folders. All > > > > it returns is an empty string. What might I be missing? > > > > > > > > Sub FileFolderLIst() > > > > > > > > Dim FileFolder As Variant > > > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > > vbDirectory) > > > > > > > > End Sub > > > > > > > > > > > > Chester Kaup > > > > Engineering Technician > > > > Kinder Morgan CO2 Company, LLP > > > > Office (432) 688-3797 > > > > FAX (432) 688-3799 > > > > > > > > > > > > No trees were killed in the sending of this message. However a > > > > large number of electrons were terribly inconvenienced. > > > > > > > > > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Wed Apr 13 17:22:27 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 17:22:27 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Wed Apr 13 18:05:57 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 16:05:57 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheid at sc.rr.com Wed Apr 13 19:04:56 2011 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 13 Apr 2011 20:04:56 -0400 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <000301cbfa37$97917a30$c6b46e90$@rr.com> Philippe, If this is data, and it is important that it not be read, I would encrypt it. Not sure how you would do it in Access (probably some API), but in .Net Framework, there are library functions to do this. Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 10:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Wed Apr 13 19:58:30 2011 From: df.waters at comcast.net (Dan Waters) Date: Wed, 13 Apr 2011 19:58:30 -0500 Subject: [AccessD] FE's Disconnecting from BE Message-ID: <004301cbfa3f$12cd7710$38686530$@comcast.net> At just one of my customers, we've recently had the experience where the FE files have all, at the same time, had one or more table links disconnect from the BE file, and then all the table links reconnected no more than 15 minutes later. As far as we know, there was no human intervention. A Disk or Network Error was recorded by the FE in the GlobalErrors table with is in the BE file, so this table link did not disconnect. The network setup is a little complex - they use a Storage Area Network (SAN) with multiple disks, virtual server (VMWare), and Citrix. The system is 3 - 6 times slower with data intensive activity compared to my other customers using a LAN and a physical server. Anyone have any ideas on a cause, what I can monitor, or what I could do? Thanks! Dan From accessd at shaw.ca Wed Apr 13 21:05:58 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 13 Apr 2011 19:05:58 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Apr 13 22:45:55 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:45:55 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Wed Apr 13 22:49:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:49:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Does it affect anything other than Reflection? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 13, 2011 6:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Wed Apr 13 23:55:38 2011 From: rockysmolin at bchacc.com (rockysmolin at bchacc.com) Date: Wed, 13 Apr 2011 21:55:38 -0700 Subject: [AccessD] New Language Message-ID: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Thu Apr 14 00:36:21 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 22:36:21 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). ?Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. ?So here is what I stumbled on. ?I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ?The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Thu Apr 14 00:44:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 00:44:08 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Ok, thanks. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 12:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or >> thinking about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', >> to retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I >> could find, to do this, was to put in extra code into a class module >> to create a 'Properties' Property. ?In fact, I had written an Add-on >> in VB6 that did this for me (created a properties property). ?Put a >> LOT of extra code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the >> Reflection Library. ?So here is what I stumbled on. ?I was all >> excited to use the Reflection library on a particalur class where I >> needed to dynamically list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ? >> The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting >> at all of my properties...until I figured out that some were >> properties some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From accessd at shaw.ca Thu Apr 14 02:02:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 00:02:38 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: <7DEDE1F783024A28A3C5D53E63803261@creativesystemdesigns.com> Hi Drew: OK... Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 8:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 14 04:39:03 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:39:03 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C0B7.9070509@colbyconsulting.com> Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. From jwcolby at colbyconsulting.com Thu Apr 14 04:42:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:42:48 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C198.7060305@colbyconsulting.com> > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From Gustav at cactus.dk Thu Apr 14 05:27:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 14 Apr 2011 12:27:05 +0200 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. From jwcolby at colbyconsulting.com Thu Apr 14 07:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 08:47:23 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6ECDB.2020702@colbyconsulting.com> LOL. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. Whatever. Why doesn't he do that to start with? Class public fields exist for a reason. http://www.codinghorror.com/blog/2006/08/properties-vs-public-variables.html Read down through the comments. Like everything else programming, there are very opinionated people on both sides of the isle. But notice that *referencing* code breakage is very real. Kind of like natural vs surrogate keys, you can get away with either... until you can't! And when you can't you have created problems for yourself that you never would have had had you just "done it right" to start with. John W. Colby www.ColbyConsulting.com On 4/14/2011 6:27 AM, Gustav Brock wrote: > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39>>> > > I understand that you are a lazy programmer .. > > From kismert at gmail.com Thu Apr 14 10:17:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Thu, 14 Apr 2011 10:17:32 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: Speaking of Unit-testing, I bumped into this: http://cobra-language.com/ Cobra is a .NET/Mono language, with language constructs that directly support: * Contracts * Unit-testing * Lambdas and closures * Doc strings * Mixins and extensions Familiar .NET features like Generics are there, and it plays nice with C# and VB.NET, too. It offers the clean syntax and convenience of Ruby or Python, but provides strong compile-time checking, and compiled performance. -Ken From accessd at shaw.ca Thu Apr 14 11:38:24 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 09:38:24 -0700 Subject: [AccessD] New Language In-Reply-To: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Message-ID: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 12:16:41 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 10:16:41 -0700 Subject: [AccessD] New Language In-Reply-To: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Message-ID: Noah recommends starting with Java. Says LUA data types are confusing and Java is more structured and object oriented. Debugging is harder in LUA as well. I'll see if I can post a video of the competition they did at the regionals. I have it - just have to figure out how and where to post. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 9:38 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] New Language Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 14 13:01:00 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:01:00 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C0B7.9070509@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: Wow... a little snarky today, are we? Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, both were considered properties... and that isn't me 'protesting till the cows come home', it's how it is. If it's not, if you can show me some documentation that refers to 'Public SomeVariable As String' as being a FIELD in VB 6, I will gladly apologize and bow to your superior knowledge. ;) As for the lazy programmer comment..... who's the one that uses the 'canned' bound format? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:03:01 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:03:01 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C198.7060305@colbyconsulting.com> References: <4DA6C198.7060305@colbyconsulting.com> Message-ID: Man, did I piss in your wheaties or something? Programming style, safety of my code? Wow, you like kicking dirt.... be careful there buddy.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:43 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:04:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:04:19 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: No, I hand code the properties... I encapsulate my data tables in classes that handle the data the way I want it handled. Directly linking tables to user 'visible' controls is the lazy and dangerous way to do things.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, April 14, 2011 5:27 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Thu Apr 14 13:16:22 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Thu, 14 Apr 2011 11:16:22 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Thu Apr 14 13:20:38 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Thu, 14 Apr 2011 13:20:38 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From DWUTKA at Marlow.com Thu Apr 14 13:55:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:55:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Nah, this is like two geeks arguing over who is faster, Superman or the Flash. Just break out the popcorn. ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:57:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:57:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> References: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: And we can send them to camp JWC, to be trained by the Fuhrer himself! 'You call that code?' 'It's sloppy, lazy!' 'Wrap that simple class field in 100 lines of code!' 'Drop and give me 300 lines of error handling! On the double!' ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rusty Hammond Sent: Thursday, April 14, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 14 14:26:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 15:26:37 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: <4DA74A6D.7000706@colbyconsulting.com> LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. From DWUTKA at Marlow.com Thu Apr 14 14:43:23 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 14:43:23 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA74A6D.7000706@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: Well VBA is a subset of VB 6. Can you show me any documentation where it defines a Public statement as setting a 'field' to a class, versus Property statement setting a property, in VBA? When in the IDE, if you have Public MyValue or Property Get MyOther value, both will show up with the same 'property' icon in the IDE. No declaration that 'MyValue' (in this case) is a 'field' in the Object browser. In .Net, it DOES have a different icon in the IDE. Fields and Properties are given completely different icons in autosensing drop downs. It makes a clear distinction. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 2:27 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 15:04:47 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 13:04:47 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky From DWUTKA at Marlow.com Thu Apr 14 15:20:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 15:20:08 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 16:20:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:20:26 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <03E535F8605A444BA1A55E3B9B4D1058@HAL9005> Client found these links: http://en.kioskea.net/forum/affich-26059-rename-file-with-datetime-appended- to-filenam http://www.computing.net/answers/dos/can-a-batch-file-get-a-files-datetime-s tamp/318.html Reminds me of how much stuff we used to do with batch files. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 14, 2011 1:20 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 16:35:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:35:49 -0700 Subject: [AccessD] 2010 Version Message-ID: Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From garykjos at gmail.com Thu Apr 14 16:43:15 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 16:43:15 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From BradM at blackforestltd.com Thu Apr 14 16:43:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Thu, 14 Apr 2011 16:43:22 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From accessd at shaw.ca Thu Apr 14 16:44:28 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 14:44:28 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Thu Apr 14 16:54:25 2011 From: df.waters at comcast.net (Dan Waters) Date: Thu, 14 Apr 2011 16:54:25 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <003f01cbfaee$85bd3080$91379180$@comcast.net> Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Apr 14 16:55:14 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 14 Apr 2011 14:55:14 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Thu Apr 14 17:47:34 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:47:34 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:19 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:45 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:45 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> Message-ID: <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 2:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:50:18 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:50:18 -0700 Subject: [AccessD] 2010 Version In-Reply-To: <003f01cbfaee$85bd3080$91379180$@comcast.net> References: <003f01cbfaee$85bd3080$91379180$@comcast.net> Message-ID: <0A5CEF40B05C4D5D9E0F77A5CAAAAB5E@HAL9005> Good thinkin'. Covers me for the rest of my life. Or the product 's life. Of course, that's assuming that DoCmd.ShowToolbar "Ribbon", acToolbarNo works so well and is so bulletproof that MS will feel compelled to replace it with something else we'll have to learn. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Thursday, April 14, 2011 2:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:51:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:51:26 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <20E088CEE08447F1BEB51DD59AB3EAE9@HAL9005> Dunno. If it happened more than three weeks ago, it's gone from my cache. But, law of averages says, I got it from this list. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 14, 2011 2:55 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Thu Apr 14 17:59:01 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 17:59:01 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From Darryl.Collins at iag.com.au Thu Apr 14 19:26:56 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:26:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150027.p3F0R3lU012257@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hahaha, reminds me of the logic when you are using code to write from Access to Excel. Used to be 5.0 (has been for years - ie Excel 5.0;HDR=YES;IMEX=2;DATABASE=etc...). Now XL2007+ is being used you have use Excel 8.0 or it fails. Now neither of those numbers align with the XL versions being used. And what happened to 6 & 7? Logically you would think, "ok change it to 6". I am not really asking, I am sure if I Google it hard enough I could find out for myself. It is just one of those things that trip you up when you least expected it and the obvious answer is the wrong one. :) fun stuff. Just having a cheap and quiet little rant over here... cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, 15 April 2011 8:48 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Darryl.Collins at iag.com.au Thu Apr 14 19:27:55 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:27:55 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150028.p3F0S1RN012807@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ and yet it was still cursed... Guess you cannot escape ya fate ;) -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, 15 April 2011 8:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Thu Apr 14 22:40:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 15 Apr 2011 13:40:24 +1000 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DA7BE28.31054.5F4DF65@stuart.lexacorp.com.pg> Not file renaming :-( -- Stuart On 14 Apr 2011 at 15:20, Drew Wutka wrote: > Not sure about xcopy, but robocopy has that kind of ability. Robocopy > used to be only available the extra resources CD you had to buy > separately, but it's included in Windows 7 now. > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers > discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp > to xcopy target > > Dear List: > > Client wants to do regular backup to his EHD using Windows Scheduler. > He's almost there but has a question: > > The following in a batch file seems to work for backing up > DocketWorks: > > > > xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" > > > > Do you know if there is some way to append a date time stamp to it so > it does not always overwrite the previous backup? > > Anyone know? > > > > TIA > > > > Rocky > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for > the person or entity to which it is addressed and may contain II-VI > Proprietary and/or II-VI Business Sensitive material. If you are not > the intended recipient, please contact the sender immediately and > destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended > recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Fri Apr 15 03:33:33 2011 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 15 Apr 2011 10:33:33 +0200 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim From jwcolby at colbyconsulting.com Fri Apr 15 07:43:58 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 08:43:58 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: <4DA83D8E.5020106@colbyconsulting.com> Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if you > have Public MyValue or Property Get MyOther value, both will show up > with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew From shamil at smsconsulting.spb.ru Fri Apr 15 09:26:41 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 18:26:41 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 10:05:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:05:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: LOL.... what a long winded way of saying 'No, it's not documented, it's my personal definition'. Your view here is based on a granular perspective of VB6 (remember, we are talking about VBA and VB6 here, there is a CLEAR defined difference between a Field and a Property in .Net). You are looking at the definition of a property from INSIDE the class. If you take a more bird's eye view of class a property is a value. A class is an object. Regardless of what each individual line of code within a class module says, a class is an object defined and structured to represent something. A Function is set of instructions that you start with a call. A Class is an object, that you create, mold, store, manipulate, etc. With this type of view, it is irrelevant as to whether a property is defined with a Public statement or a property statement, it is still a 'property' of a class. If you were to build a 'Rubber Ball' class, and gave it a Color property, from the outside world (to the class), the property is a value that can be set or retrieved (or one or the other). The outside world, to the class, doesn't care how it is defined. .Net makes a distinction, in documentation and intellisense. But Property is a keyword and Field is not. But back to VBA and VB6, let's go even more granular then your view here. What is the machine code difference between: Public MyValue as string And Property Get MyValue() as String MyValue=strValue End Property Property Let MyValue(strEnter as String) strValue=strEnter End Property ??? Do you think that thep code, when this is compiled, is doing anything different? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 7:44 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Fri Apr 15 10:08:21 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:08:21 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com><4DA83D8E.5020106@colbyconsulting.com> Message-ID: Bingo, you said it better though... thanks! Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, April 15, 2011 9:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jedi at charm.net Fri Apr 15 11:10:26 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 15 Apr 2011 12:10:26 -0400 (EDT) Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> You forgot Preparation H. Mike > They took off a year? (Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Fri Apr 15 14:26:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 15:26:20 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA89BDC.4020409@colbyconsulting.com> So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com On 4/15/2011 10:26 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Public class modules variables are implemented in VB6 and VBA the same way > as properties IOW they have the same programmatic interface from VB6/VBA > (and COM) internals point of view. - this is what Drew has been telling > about here... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 15 ?????? 2011 ?. 16:44 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a property > is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns a > value. It has a keyword in the VB language. It can run any amount of code > inside of the "function", and do anything that is legal for a function to do > including dimensioning, reading and writing other variables, running loops, > doing if then / select case etc., reading and writing to the disk, > downloading files from the internet, formatting your hard disk... you name > it. > > A property is a function. It happens to be targeted to wrapping variables > and exposing them to the outside world but that is not all it can do. A > property does not *define* the variable, that is done in the dimension > statement. A property does not "own" the variable that it wraps, it is > simply > *returning* the variable. A property does not have any data storage area on > the heap unless it happens to dimension its own variables inside of the > property, and even then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved area > of memory on the heap sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a property is and what a variable is. How can you > possibly expect them to be or work the same. They are different things > entirely. The fact that the IDE displays the same icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the language, I > just look at what things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > > On 4/14/2011 3:43 PM, Drew Wutka wrote: >> Well VBA is a subset of VB 6. Can you show me any documentation where >> it defines a Public statement as setting a 'field' to a class, versus >> Property statement setting a property, in VBA? When in the IDE, if >> you have Public MyValue or Property Get MyOther value, both will show >> up with the same 'property' icon in the IDE. No declaration that > 'MyValue' >> (in this case) is a 'field' in the Object browser. >> >> In .Net, it DOES have a different icon in the IDE. Fields and >> Properties are given completely different icons in autosensing drop >> downs. It makes a clear distinction. >> >> Drew > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From shamil at smsconsulting.spb.ru Fri Apr 15 14:54:31 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 23:54:31 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <3870F1BDA6774925B9CD59D1B66F5C3F@nant> Hi John -- <<< Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not >>> But they are the same from *technical* (VBA/VB6/COM) point of view - that is what Drew is telling... IOW: they are looking the same for outer world. Drew doesn't care about their internal implementation or high level concepts... Nobody argues here when one or another coding style/approach should be used or that one is better than another one because of ... OA: They are the same from *technical* point of view/perspective of VBA/VB6/COM. Try the following VBA/VB6 code: ------------- cut here ----- ' class MyClass Public MyTestVar As String Private m_myTestVar2 As String Property Get MyTestVar2() As String MyTestVar2 = m_myTestVar2 End Property Property Let MyTestVar2(ByVal v As String) m_myTestVar2 = v End Property ------------- cut here ----- ' standard module - MyTestModule Public Sub MyTest() Dim c As MyClass Set c = New MyClass Dim result As String CallByName c, "MyTestVar", VbLet, "MyTestValue" result = CallByName(c, "MyTestVar", VbGet) Debug.Print "Result from public variable = " + result CallByName c, "MyTestVar2", VbLet, "MyTestValue2" result = CallByName(c, "MyTestVar2", VbGet) Debug.Print "Result from public variable2 = " + result End Sub ------------- cut here ----- Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 23:26 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Apr 15 15:11:48 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 15:11:48 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: Boy John, you don't read anything I wrote. The entire point was about a difference between .Net and VB6/VBA. No point in explaining further, your soapbox is above the level I care to engage at. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 2:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Apr 15 15:18:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 16:18:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8A816.9000705@colbyconsulting.com> Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com On 4/15/2011 11:05 AM, Drew Wutka wrote: > LOL.... what a long winded way of saying 'No, it's not documented, it's > my personal definition'. > > Your view here is based on a granular perspective of VB6 (remember, we > are talking about VBA and VB6 here, there is a CLEAR defined difference > between a Field and a Property in .Net). You are looking at the > definition of a property from INSIDE the class. If you take a more > bird's eye view of class a property is a value. A class is an object. > Regardless of what each individual line of code within a class module > says, a class is an object defined and structured to represent > something. A Function is set of instructions that you start with a > call. A Class is an object, that you create, mold, store, manipulate, > etc. > > With this type of view, it is irrelevant as to whether a property is > defined with a Public statement or a property statement, it is still a > 'property' of a class. If you were to build a 'Rubber Ball' class, and > gave it a Color property, from the outside world (to the class), the > property is a value that can be set or retrieved (or one or the other). > The outside world, to the class, doesn't care how it is defined. > > .Net makes a distinction, in documentation and intellisense. But > Property is a keyword and Field is not. > > But back to VBA and VB6, let's go even more granular then your view > here. > > What is the machine code difference between: > > Public MyValue as string > > And > > Property Get MyValue() as String > MyValue=strValue > End Property > Property Let MyValue(strEnter as String) > strValue=strEnter > End Property > > ??? Do you think that thep code, when this is compiled, is doing > anything different? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 7:44 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a > property is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns > a value. It has a keyword > in the VB language. It can run any amount of code inside of the > "function", and do anything that is > legal for a function to do including dimensioning, reading and writing > other variables, running > loops, doing if then / select case etc., reading and writing to the > disk, downloading files from the > internet, formatting your hard disk... you name it. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the > outside world but that is not all it can do. A property does not > *define* the variable, that is > done in the dimension statement. A property does not "own" the variable > that it wraps, it is simply > *returning* the variable. A property does not have any data storage > area on the heap unless it > happens to dimension its own variables inside of the property, and even > then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap > sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a > property is and what a variable is. How can you possibly expect them to > be or work the same. They > are different things entirely. The fact that the IDE displays the same > icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the > language, I just look at what > things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From rockysmolin at bchacc.com Fri Apr 15 15:30:27 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 15 Apr 2011 13:30:27 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target + New Language In-Reply-To: References: Message-ID: <9DC7EA07277745B39387C0607ACA09F4@HAL9005> John: I gave the task to Noah - he knows batch files. Told him $25. He's learned a bit more about batch files a lot more about testing, communicating with the user, and reworking based on finding out 'what they really want'. Between that, the $15 he got for recycling bottles, and his allowance, he's having a really good day. :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 15, 2011 1:34 AM To: accessd at databaseadvisors.com; accessd at shaw.ca Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 16:09:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 16:09:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: Actually John, now that you've come down a bit on your soapbox, I will try to clarify for you. As a VB/VBA programmer, nothing I ever read about VB referred to 'Public SomeValue as string' as a FIELD. In fact, it was always referred to it as a PROPERTY of a class object. I have ASKED if you have any supporting documentation, like some Microsoft white paper, or something I should have read when becoming proficient in VB(6/VBA), where I would have learned that the correct term for 'Public SomeValue As SomeType' in a VB/VBA class module was FIELD. I can show you PLENTY of documentation where the reverse is the case. http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual Basic Concepts / Customizing Form Classes' Straight out of the MSDN, when talking about Class modules in VB6. It refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public Comment As String' as 'click on it to play back its Comment PROPERTY'. Or how about: http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual Basic Concepts / Class Module Step by Step'. You won't find the WORD 'field' on that page, and it refers to 'Public Name As String' AS A PROPERTY. Straight from the designers of VB 6's mouth, JWC. Now admittedly, I'm only bringing MSDN articles into the fray. I'm not taking your approach, that you've been programming since you built THE FIRST Antikythera mechanism, so what you say is how it is. To begin with, you are absolutely, 100% incorrect in stating that there is ANY difference in performance OR FUNCTIONALITY between: Public MyValue as String And Dim strMyValue as string Property Get MyValue() As String MyValue=strMyValue End Property Property Let MyValue(strEnter As String) strMyValue=strEnter End Property The only difference above is that one uses 1 line of code, the other uses 7 lines of code, in the source code. That is it. When you express what else you can do with Get/Let statements, you are going OUTSIDE the scope of declaring what a BASIC property is. Yes, you can put error handling into the statements above, but that changes the strictest definition of a 'SIMPLE' property. You can add extra arguments, logic, processes, etc. All going OUTSIDE of the definition of a 'simple property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 liner property, and converting it until actual Get and Let statements (or Set) for more functionality down the road. In .Net, there IS a problem, because if you are using Reflection, the Field is now a Property (in .Net terms), so it will be in a different collection in Reflection. Back to my original point, to this thread, I have been using .Net for about a year now, since I was out of the development world for a while. I have only recently had a reason to use Reflection, which I stumbled on, because as a VB 6 Programmer, there WAS no distinction between property declaration types like there is in .Net. I am not complaining that there is a difference, in fact, it is quite handy to have two separate Reflection collections to use. I was simply stating that it was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or are just crossing the bridge into the .Net world. Like saying that there is no more Variant variable type. Would you like to give us a tirade about how Variant types never truly existed, and how I personally will never understand that concept? Seriously John, you need to read more than a few lines of my posts. A lot of what you have said makes you sound like an a$$, not as a skilled professional. My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 3:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Fri Apr 15 17:33:59 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:33:59 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Sorry, I can't agree with you there. A METHOD is a function. A PROPERTY is the external name given to a variable which is encapsulated in the class. i.e. for all intents and purposes outside of the object, it IS the variable. "PROPERTY SET" and "PROPERTY GET" are methods. The fact that you can also perform other actions when you SET a variable is irrelevant. You should be doing what it is saying and setting the value of the variable. When you GET it, you should be retrieving the value of the variable. Wiile it is possible to create SET/GET functions for a property so that GET doesn't return what is SET, it is a gross abuse of the whole Object concept. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the outside world but that is not all > it can do. A property does not *define* the variable, that is done in > the dimension statement. A property does not "own" the variable that > it wraps, it is simply *returning* the variable. A property does not > have any data storage area on the heap unless it happens to dimension > its own variables inside of the property, and even then (except for > strings and statics) most variables inside of functions are stored on > the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap sized to accept a specific data type. > From jwcolby at colbyconsulting.com Fri Apr 15 17:37:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 18:37:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8C8AA.6000102@colbyconsulting.com> >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From stuart at lexacorp.com.pg Fri Apr 15 17:38:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:38:02 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: , , <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > From stuart at lexacorp.com.pg Fri Apr 15 17:48:25 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:48:25 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> The problem as I see it is that "Public fields" are an abomination. Because Java has then, .Net has to as well :-( You should not be able to accept any "properties" of an object other than through GET/SET processes. -- Stuart On 15 Apr 2011 at 16:18, jwcolby wrote: > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" which absolutely one of many English > language (and programming) definitions of property. > > You have already told us (as have I) that a public field and a > property (keyword / function) behave differently. > > The problem is yours not mine. I understand and use your definition > in the same way you do. I do not expect a public field to behave in > the same way that a property (keyword / function) does because they > are fundamentally different things. Personally I do not call a public > field a property, I call it a public field (in programmer speak), > though of course it is a property in English language speak. > > You no longer expect them to behave the same because you have > discovered that they are fundamentally different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and moan that they behave differently. To > which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > From jwcolby at colbyconsulting.com Fri Apr 15 18:28:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:28:47 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> References: , , <4DA83D8E.5020106@colbyconsulting.com> <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Message-ID: <4DA8D4AF.8050107@colbyconsulting.com> >> A PROPERTY is the external name given to a variable which is encapsulated in the class. LOL, absolutely and unequivocally not true. It is the name of some data value associated with or encapsulated by the class but it is simply *not* always and necessarily a variable. Nor is it an invalid use of a property if it is not a wrapped variable! There are properties that do not even reference a variable at all and they are perfectly valid uses of property. I can take three booleans and return a true of all are true (and I do exactly that in one of my properties). It is a property (English definition) that the class is stopped when three child classes are all stopped. The child objects use threads and write to a status control on a form. I cannot (don't want to) close the form until they are all stopped - their threads are no longer running. The form asks the manager if it is stopped when I try to close the form. It does so by checking the boolean stopped property of the manager. The boolean stopped property (get) asks the child objects if they are stopped and returns a true if all three are true else returns a false. It is not wrapping a variable, you can't set the stop variable, there isn't one. It is a valid property however. I can take 16 booleans and "translate them" into an integer value from 0 to 16 if that is what I need to do. A property (English) is a data value, but it is not necessarily a stored value and in fact it is quite often a calculated value. The fact that you personally say that is bad practice doesn't impress me. If I use the property to calculate a state (data item) of the class that is a property (English) of the class the same as your stored value is. I understand perfectly well that a property is not a function (or method) but it has more properties (English) of a function than a variable - public or otherwise. I used "function with quotes at the start of the thread to clearly denote that a property was not a function. However a property (keyword) is a call. It pushes the current address pointer on the stack. A property set (or let) pushes the value on the stack. Inside of the property other lines of code can and do run. A property does not inherently have any storage. They can do anything that is logical for a property to do. When it returns it's value (if a get) is placed on the stack and it unwinds the stack. Sounds much more "function" than a dimensioned variable. Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > Sorry, I can't agree with you there. > > A METHOD is a function. > > A PROPERTY is the external name given to a variable which is encapsulated in the class. > i.e. for all intents and purposes outside of the object, it IS the variable. > > "PROPERTY SET" and "PROPERTY GET" are methods. > > The fact that you can also perform other actions when you SET a variable is irrelevant. You > should be doing what it is saying and setting the value of the variable. When you GET it, you > should be retrieving the value of the variable. > > Wiile it is possible to create SET/GET functions for a property so that GET doesn't return > what is SET, it is a gross abuse of the whole Object concept. From jwcolby at colbyconsulting.com Fri Apr 15 18:29:09 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:09 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: <4DA8D4C5.8000902@colbyconsulting.com> Nonsense. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:38 PM, Stuart McLachlan wrote: > That is a gross abuse of the whole Object paradigm. > > On 15 Apr 2011 at 15:26, jwcolby wrote: > >> I have had properties which did not wrap a variable at all. >> > > From jwcolby at colbyconsulting.com Fri Apr 15 18:29:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:50 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> References: , , <4DA8A816.9000705@colbyconsulting.com> <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> Message-ID: <4DA8D4EE.80503@colbyconsulting.com> Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > From davidmcafee at gmail.com Fri Apr 15 18:35:38 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 15 Apr 2011 16:35:38 -0700 Subject: [AccessD] is this date affected? Message-ID: I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From vbacreations at gmail.com Fri Apr 15 19:15:04 2011 From: vbacreations at gmail.com (William Benson) Date: Fri, 15 Apr 2011 20:15:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> Message-ID: Dumb question maybe... but have you tested that code in anything earlier than 2007?? I would think that the intrinsic constant is not recognized.... maybe compatibility mode handles...? On Apr 15, 2011 11:11 AM, "Michael Bahr" wrote: > You forgot Preparation H. > > Mike > >> They took off a year? (Whatever happened to Preparations A through G?) >> >> R >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos >> Sent: Thursday, April 14, 2011 2:43 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] 2010 Version >> >> 14 is the magic number >> >> http://en.wikipedia.org/wiki/Microsoft_Access >> >> GK >> >> On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin >> wrote: >>> Dear List: >>> >>> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >>> using: >>> >>> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >>> acToolbarNo >>> >>> If I want to check for 2010, what version number should I use? >>> >>> MTIA >>> >>> >>> Rocky Smolin >>> >>> Beach Access Software >>> >>> 858-259-4334 >>> >>> Skype: rocky.smolin >>> >>> www.e-z-mrp.com >>> >>> www.bchacc.com >>> >>> >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> Gary Kjos >> garykjos at gmail.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 15 19:15:20 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:15:20 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. There, that's fixed it :-) -- Stuart On 15 Apr 2011 at 19:28, jwcolby wrote: > >> A PROPERTY is the external name given to a variable which is > encapsulated in the class. > > > LOL, absolutely and unequivocally not true. It is the name of some > data value associated with or encapsulated by the class but it is > simply *not* always and necessarily a variable. Nor is it an invalid > use of a property if it is not a wrapped variable! > > There are properties that do not even reference a variable at all and > they are perfectly valid uses of property. I can take three booleans > and return a true of all are true (and I do exactly that in one of my > properties). It is a property (English definition) that the class is > stopped when three child classes are all stopped. The child objects > use threads and write to a status control on a form. I cannot (don't > want to) close the form until they are all stopped - their threads are > no longer running. > > The form asks the manager if it is stopped when I try to close the > form. It does so by checking the boolean stopped property of the > manager. The boolean stopped property (get) asks the child objects if > they are stopped and returns a true if all three are true else returns > a false. > > It is not wrapping a variable, you can't set the stop variable, there > isn't one. It is a valid property however. > > I can take 16 booleans and "translate them" into an integer value from > 0 to 16 if that is what I need to do. A property (English) is a data > value, but it is not necessarily a stored value and in fact it is > quite often a calculated value. The fact that you personally say that > is bad practice doesn't impress me. If I use the property to > calculate a state (data item) of the class that is a property > (English) of the class the same as your stored value is. > > I understand perfectly well that a property is not a function (or > method) but it has more properties (English) of a function than a > variable - public or otherwise. I used "function with quotes at the > start of the thread to clearly denote that a property was not a > function. > > However a property (keyword) is a call. It pushes the current address > pointer on the stack. A property set (or let) pushes the value on the > stack. Inside of the property other lines of code can and do run. A > property does not inherently have any storage. They can do anything > that is logical for a property to do. > > When it returns it's value (if a get) is placed on the stack and it > unwinds the stack. > > Sounds much more "function" than a dimensioned variable. > > Drew mentioned my "soap box". I do not have a soap box, I am simply > insisting that we acknowledge the facts. I have no idea what goes on > in VB6 because I do not use it. However I have used a class or two > (or three maybe?) in Access so I do understand VBA. Obviously Drew is > a better (and wittier) programmer than I but let's attempt to > understand (and discuss so others can understand) what these things > are, what they do and when we are using an English definition and when > we are using a keyword, and when we are just using a vague kinda sorta > definition. > > And when we are using an object. A property is also often an object > in OO environments. > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > > Sorry, I can't agree with you there. > > > > A METHOD is a function. > > > > A PROPERTY is the external name given to a variable which is > > encapsulated in the class. i.e. for all intents and purposes outside > > of the object, it IS the variable. > > > > "PROPERTY SET" and "PROPERTY GET" are methods. > > > > The fact that you can also perform other actions when you SET a > > variable is irrelevant. You should be doing what it is saying and > > setting the value of the variable. When you GET it, you should be > > retrieving the value of the variable. > > > > Wiile it is possible to create SET/GET functions for a property so > > that GET doesn't return what is SET, it is a gross abuse of the > > whole Object concept. > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 15 19:50:56 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:50:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net>, Message-ID: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Application.Version has been around for a long time. That code certainly works in A2K3. It does nothing. because Application.Version = 11. I use it for frequently for mdbs that are runnning in a mixed environment (A2K3 and A2007). On 15 Apr 2011 at 20:15, William Benson wrote: > Dumb question maybe... but have you tested that code in anything > earlier than 2007?? I would think that the intrinsic constant is not > recognized.... maybe compatibility mode handles...? ... > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo From jwcolby at colbyconsulting.com Fri Apr 15 21:47:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 22:47:06 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> Message-ID: <4DA9032A.1060304@colbyconsulting.com> > OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. Why do you insist on tying it to at least one variable? It isn't. I have a flag class (in C#). When that class instantiates, the constructor is fed a table, field and PK of a specific record and promptly loads the contents of that field into a variable. The variable may be a date (when an event occurred) or an integer (one means that process occurred, a zero means that process has not occurred). That class has a boolean which can be read or set. If it is set true, the property sets the variable "behind the scene" to either now() or 1 depending on the kind of flag it is. Additionally the property set causes a function to execute which dynamically constructs a sql statement and writes the date or integer into SQL Server. When you read the variable it returns the value associated with that flag, which is really a field in SQL server. So the property is boolean, but the actual variable read / written can be either a date or an integer. The property causes a fair bit of code to run which "interprets" something and returns a true / false. In fact if I so desired I could make the "variable" the actual data in the field in the specific record in SQL Server. This property exposes the boolean through a property (keyword) and that property is exposed to internal code of the parent object so that the parent object can read / write flags from SQL Server in a logical and consistent manner. I could, if I so desired, cause the property to read a serial port and return a value on a strain gauge, or the temperature of a sensor in a machine, or a frequency of a phase lock loop, or a value of an Analog to digital converter or the value of 2/3 rounded to 4 decimal places... In the end all you can really say about a property (get) is that it returns a unit of data. You may or may not be able to set the value. To call a register in a DToA a variable is a bit of a stretch, but if you insist that's fine. But the value of 2/3? No variables involved there. A property get returns a value, a property let accepts a value and does something with it. Storing it? Not necessarily. It may just feed it off to a machine somewhere which does something with the value. It could fire a stepper motor, or set a voltage in a Digital to Analog converter, or it could pull in a relay and spray water all over your computer. By the way that is a write only property which I lovingly call HoseTheTwitsdown. ;) It is a property of the Colbyizer class which has many different properties to allow me to do everything from HoseTheTwitsDown to BoottheTwitsOutTheDoorAt20000Feet. Don't make me use the more extreme properties. :) John W. Colby www.ColbyConsulting.com On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > OK. A property is the the external name given to the state of one or more variables ( scalar > or object) encapsulated within the class.. > > There, that's fixed it :-) > From stuart at lexacorp.com.pg Fri Apr 15 23:20:36 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 14:20:36 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA9032A.1060304@colbyconsulting.com> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> Message-ID: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Sorry, I can't accept that; A write-only property is the local equivalent of this: http://www.supersimplestorageservice.com/ If you can't get a meaningful value from it, then it is not a property - it is a method ( and I don't mean a return value indicating success or failure of the SET) HoseTheTwits Down is a Method. -- Stuart On 15 Apr 2011 at 22:47, jwcolby wrote: > A property get returns a value, a property let accepts a value and > does something with it. Storing it? Not necessarily. It may just > feed it off to a machine somewhere which does something with the > value. It could fire a stepper motor, or set a voltage in a Digital > to Analog converter, or it could pull in a relay and spray water all > over your computer. By the way that is a write only property which I > lovingly call HoseTheTwitsdown. > > ;) > > It is a property of the Colbyizer class which has many different > properties to allow me to do everything from HoseTheTwitsDown to > BoottheTwitsOutTheDoorAt20000Feet. > > Don't make me use the more extreme properties. > > :) > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > > OK. A property is the the external name given to the state of one > > or more variables ( scalar or object) encapsulated within the > > class.. > > > > There, that's fixed it :-) > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From vbacreations at gmail.com Fri Apr 15 23:59:04 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 00:59:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Message-ID: This is quite a surprise. This implies that the code compiles even though vba for access 2003 ought to have no idea what that constant is. Thus compiler is ignoring the code on the "Then" part of the statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" wrote: > Application.Version has been around for a long time. That code certainly works in A2K3. It > does nothing. because Application.Version = 11. I use it for frequently for mdbs that are > runnning in a mixed environment (A2K3 and A2007). > > > On 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question maybe... but have you tested that code in anything >> earlier than 2007?? I would think that the intrinsic constant is not >> recognized.... maybe compatibility mode handles...? > > ... >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 16 01:59:33 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 16:59:33 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg>, Message-ID: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is a toolbar called "Ribbon". That constant is only evaluated at runtime if the Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. -- Stuart On 16 Apr 2011 at 0:59, William Benson wrote: > This is quite a surprise. This implies that the code compiles even > though vba for access 2003 ought to have no idea what that constant > is. Thus compiler is ignoring the code on the "Then" part of the > statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" > wrote: > Application.Version has been around > for a long time. That code certainly works in A2K3. It > does nothing. > because Application.Version = 11. I use it for frequently for mdbs > that are > runnning in a mixed environment (A2K3 and A2007). > > > On > 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question > maybe... but have you tested that code in anything >> earlier than > 2007?? I would think that the intrinsic constant is not >> > recognized.... maybe compatibility mode handles...? > > ... >> If > Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From vbacreations at gmail.com Sat Apr 16 05:51:23 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 06:51:23 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> References: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Message-ID: Great, thanks! On Apr 16, 2011 3:02 AM, "Stuart McLachlan" wrote: > Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is > a toolbar called "Ribbon". That constant is only evaluated at runtime if the > Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. > > -- > Stuart > > > On 16 Apr 2011 at 0:59, William Benson wrote: > >> This is quite a surprise. This implies that the code compiles even >> though vba for access 2003 ought to have no idea what that constant >> is. Thus compiler is ignoring the code on the "Then" part of the >> statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" >> wrote: > Application.Version has been around >> for a long time. That code certainly works in A2K3. It > does nothing. >> because Application.Version = 11. I use it for frequently for mdbs >> that are > runnning in a mixed environment (A2K3 and A2007). > > > On >> 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question >> maybe... but have you tested that code in anything >> earlier than >> 2007?? I would think that the intrinsic constant is not >> >> recognized.... maybe compatibility mode handles...? > > ... >> If >> Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 16 10:59:22 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 16 Apr 2011 17:59:22 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From rockysmolin at bchacc.com Sat Apr 16 12:14:10 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 16 Apr 2011 10:14:10 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: <130733C3468C4FEB89AC6671E8846036@HAL9005> There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 16 12:51:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 16 Apr 2011 13:51:16 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Message-ID: <4DA9D714.8060503@colbyconsulting.com> Stuart, C# of course. http://msdn.microsoft.com/en-us/library/w86s7x04%28v=vs.80%29.aspx Unlike fields, properties are not classified as variables. Therefore, it is not possible to pass a property as a ref (C# Reference) or out (C# Reference) parameter. Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields. >>> from Stack Overflow: >>> One use for a write-only property is to support setter dependency injection. Let's say I had a class: public class WhizbangService { public WhizbangProvider Provider { set; private get; } } The WhizbangProvider is not intended to be accessed by the outside world. I'd never want to interact with service.Provider, it's too complex. I need a class like WhizbangService to act as a facade. Yet with the setter, I can do something like this: service.Provider = new FireworksShow(); service.Start(); And the service starts a fireworks display. Or maybe you'd rather see a water and light show: service.Stop(); service.Provider = new FountainDisplay(new StringOfLights(), 20, UnitOfTime.Seconds); service.Start(); Expand your mind. Sit in the sun, close your eyes, contemplate your belly button. And yes, HoseTheTwitsDown actually is a method - which I was fantasizing about using... ;) John W. Colby www.ColbyConsulting.com On 4/16/2011 12:20 AM, Stuart McLachlan wrote: > Sorry, I can't accept that; A write-only property is the local equivalent of this: > http://www.supersimplestorageservice.com/ > > If you can't get a meaningful value from it, then it is not a property - it is a method ( and I > don't mean a return value indicating success or failure of the SET) > > HoseTheTwits Down is a Method. > From DWUTKA at Marlow.com Sat Apr 16 16:36:37 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:36:37 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8AA.6000102@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> <4DA8C8AA.6000102@colbyconsulting.com> Message-ID: Finally, we agree on something. Glad you finally came to your wits... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:39:03 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:39:03 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: Actually, I have to disagree with you Stuart, a property doesn't necessarily have to wrap a variable. It could wrap a constant. It could wrap a value that is not directly related to a variable, say it could represent some 'condition'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:41:44 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:41:44 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com><4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: Yes, and if you were referring to a property as a field, in VBA, you were using incorrect terminology in that environment. ;) Drew Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:42:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:42:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4EE.80503@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com><4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> <4DA8D4EE.80503@colbyconsulting.com> Message-ID: That's like saying that it would be a good thing if there was no way to make a form 'bound' in some way to data automatically.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 6:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From adtp at airtelmail.in Sat Apr 16 22:57:47 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Sun, 17 Apr 2011 09:27:47 +0530 Subject: [AccessD] is this date affected? References: <130733C3468C4FEB89AC6671E8846036@HAL9005> Message-ID: <00475C102A0F4440809644E445155921@personal4a8ede> David, Another alternative could be considered. You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: IsAffected = ((Dt2 - Dt1) Mod 14 = 0) If the condition is to be checked in an If / End If block, the syntax could be as follows: If (Dt2 - Dt1) Mod 14 = 0 Then Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Rocky Smolin To: 'Access Developers discussion and problem solving' Sent: Saturday, April 16, 2011 22:44 Subject: Re: [AccessD] is this date affected? There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From davidmcafee at gmail.com Mon Apr 18 12:52:44 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 10:52:44 -0700 Subject: [AccessD] is this date affected? In-Reply-To: <00475C102A0F4440809644E445155921@personal4a8ede> References: <130733C3468C4FEB89AC6671E8846036@HAL9005> <00475C102A0F4440809644E445155921@personal4a8ede> Message-ID: Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal > ------------ > > ----- Original Message ----- > From: Rocky Smolin > To: 'Access Developers discussion and problem solving' > Sent: Saturday, April 16, 2011 22:44 > Subject: Re: [AccessD] is this date affected? > > > There's a Weekday function in VBA that you pass a date to and it returns a > number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, April 16, 2011 8:59 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] is this date affected? > > Hi David > > You can build a collection of the dates using a loop and DateAdd. > Then look up your date in this collection. > > /gustav > > > >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> > I was wondering if anyone already has some code or Jet SQL to determine if > a > date is affected? > > Such as Every other Saturday for the next x Saturdays starting 4/16/2011 > (2011.04.16 ;) ) > > Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) > > I was going to write a function, but I was wondering I am re-inventing the > wheel, or if there is some built in too to do so. > > Thanks, > David > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Mon Apr 18 13:11:51 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 18 Apr 2011 20:11:51 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". /gustav >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal From davidmcafee at gmail.com Mon Apr 18 15:01:32 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 13:01:32 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the > next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had > to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate > > Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the > > following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax > > could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Tue Apr 19 04:57:50 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Apr 2011 11:57:50 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Not exactly. That will loosen the condition to satisfy the question: "such as Every other Saturday before x weeks after 4/16/2011". For example, 2011-03-19 will be accepted, and these values will be as well: StartingSat = #2011/04/17# NumOfSats = 5 SiQ = #2011/05/15# Of course, you may have validated SiQ to be larger than StartingSat as well as StartingSat to be a Saturday prior to calling your easy expression, but how can we know? Also, the DateAdd formula could be reduced to: DateAdd("ww", NumOfSats, StartingSat) /gustav >>> davidmcafee at gmail.com 18-04-2011 22:01 >>> Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal From jwcolby at colbyconsulting.com Tue Apr 19 13:26:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 19 Apr 2011 14:26:18 -0400 Subject: [AccessD] Exact reports are such a pita Message-ID: <4DADD3CA.7010106@colbyconsulting.com> I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Tue Apr 19 13:32:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 13:32:06 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <004301cbfec0$16c2eb40$4448c1c0$@comcast.net> I think I would just build a string, using the values if I have them, underscores if I don't. If you're using Access 2002+, you can use the OpenArgs parameter when you open the report, if that would work out. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Tue Apr 19 13:33:54 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 19 Apr 2011 13:33:54 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Tue Apr 19 13:45:32 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 11:45:32 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Tue Apr 19 14:32:45 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Wed, 20 Apr 2011 07:32:45 +1200 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> References: <4DADD3CA.7010106@colbyconsulting.com> <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Message-ID: <9728D49895B043959AFD82816DBD3DBF@stevelaptop> I agree. I don't think the idea of a temp table is over the top. That's how I would do it. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Wednesday, April 20, 2011 6:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Exact reports are such a pita Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? From john at winhaven.net Tue Apr 19 15:30:34 2011 From: john at winhaven.net (John Bartow) Date: Tue, 19 Apr 2011 15:30:34 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <00bf01cbfed0$a2f48e60$e8ddab20$@winhaven.net> That's how I handle "previously done on a form" reports with my apps. Makes the form look perfect and it relieves you of having to fudge around with data. I've honestly had to do this and then duplicate the report and remove the image background, and include a choice for the user to either insert preprinted forms or print the entire form (there was no discernable difference). Supposedly this was because the client didn't want to waste all of those preprinted forms they had. I did a follow up about a year later and the client had actually ordered more preprinted forms! Yes, you guessed it. It was a government job. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, April 19, 2011 1:34 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Exact reports are such a pita Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 19 15:37:24 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 13:37:24 -0700 Subject: [AccessD] Hide Form Title Bar Message-ID: Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From df.waters at comcast.net Tue Apr 19 16:39:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 16:39:06 -0500 Subject: [AccessD] OT: Windows Kinect SDK Beta Message-ID: <002401cbfeda$35f42730$a1dc7590$@comcast.net> If you combine this with XKCD, there's going to be a lot of trouble. I'm not saying anything more. Dan From ab-mi at post3.tele.dk Tue Apr 19 16:45:26 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Tue, 19 Apr 2011 23:45:26 +0200 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: Don't think you can eliminate the title bar on a sizable form. But you can eliminate the contents of the bar using these settings: Caption: ControlBox: No MinMaxButtons: None CloseButton: No Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Rocky Smolin Sendt: 19. april 2011 22:37 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Tue Apr 19 17:23:20 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Tue, 19 Apr 2011 17:23:20 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # References: <07230D1FF5AD4611A350B33814B094C6@HAL9005><74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad From charlotte.foust at gmail.com Tue Apr 19 20:15:41 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:15:41 -0700 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: I'm not sure this is an Access issue. I seem to recall that the # sign has a specific meaning in passing data into and out of delimited text file. Maybe someone else can recall the specifics. You might be able to work around it by either using a double # in the export spec for the field name, or else export and then rename the field in the csv file using text IO code. Charlotte Foust On Tue, Apr 19, 2011 at 3:23 PM, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our testing) > and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't understand. > > Is there a way to force Access to not replace the "#" with a "." ?? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 19 20:23:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:23:15 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: If you want to use a continuous subform, you could count the records you have and then add dummy records to fill out the count. You would want to either use a temp table or create a new recordset and add the dummy records to that, then dispose the recordset when done. Charlotte Foust On Tue, Apr 19, 2011 at 11:26 AM, jwcolby wrote: > I need to build a report that looks as close as possible to a state form. > ?This includes a couple of subforms which look like: > > 1) From:_____________ To:___________ > 2) From:_____________ To:___________ > 3) From:_____________ To:___________ > > And if I don't have a line 2 or line 3 I still need to fake it, put in the > number and underline. > > IOW it should be indistinguishable from a copy of their form casually > compared side by side. > > Can you say PITA. > > The only thing I can think of is to build a temp table, place the 1) 2) and > 3) in three records (programmatically) and then fill in each record as > needed. > > That seems rather over the top. ?Any suggestions for easy ways to fake this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Darryl.Collins at iag.com.au Tue Apr 19 20:26:03 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Wed, 20 Apr 2011 11:26:03 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: Message-ID: <201104200126.p3K1QAR6009307@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Perhaps a cheap and easy solution that may work nicely is to use a valid placeholder during the export and creation of the CSV file instead of the "#". Maybe something like "Employee$" and then once the CSV is exported use code to perform a global search and replace on the .txt file where the "#" char is not going to be an issue. .replace ""Employee$", ""Employee#" or similar. hth a bit Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Wednesday, 20 April 2011 8:23 AM To: Access Developers discussion and problem solving Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Tue Apr 19 22:40:09 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 13:40:09 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DAE5599.938.1FB46483@stuart.lexacorp.com.pg> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Apr 20 02:59:26 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 20 Apr 2011 09:59:26 +0200 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # Message-ID: Hi Brad Listen to Stuart. Once you have this set up you are in total control and will never look back. The same goes for importing text files. /gustav >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad From stuart at lexacorp.com.pg Wed Apr 20 04:53:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 19:53:45 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: Message-ID: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 20 09:46:23 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 20 Apr 2011 10:46:23 -0400 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 10:28:40 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 08:28:40 -0700 Subject: [AccessD] Search as you type Message-ID: I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug From charlotte.foust at gmail.com Wed Apr 20 11:01:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 09:01:06 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Try using a disconnected ADO recordset and apply a filter to return the limited recordset. That should make the search fast because the recordset is no longer connected to the back end. What are you planning to do if there are multiple results for the find? The user could actually edit the record if you require that and then you would have to reconnect the recordset and update the source. I have an old demo on roger's access site that was built in 2000 (AFAIR) that uses disconnected recordsets to load and update data. You might have a look at it and see if it gives you any ideas. Watch out for a wrap. http://www.rogersaccesslibrary.com/forum/foust-charlotte_forum14&SID=f27a794a-684c-f2495918-e4c25924-463bez2z.html Charlotte Foust On Wed, Apr 20, 2011 at 8:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 11:03:00 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 12:03:00 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: <4DAF03B4.3060501@colbyconsulting.com> In the onchanged event of the text box you can set a form timer to fire X ticks later. Every time the onchanged fires the timer is "reset" to be x ticks out. When the timer fires, reset the timer to not fire ( a value of 0 ticks I think) and then go do the search. Each tick is a millisecond so set it for 1000 to get a 1 second delay. Something like that. John W. Colby www.ColbyConsulting.com On 4/20/2011 11:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug From shamil at smsconsulting.spb.ru Wed Apr 20 11:14:14 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 20 Apr 2011 20:14:14 +0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Hi Doug -- I suppose you can try to use KeyDown event and run search only when {Enter} or any other special char(s) combination is pressed. Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then MsgBox (txtSearch.Text) ' suppress if needed => KeyCode = 0 End If End Sub Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: 20 ?????? 2011 ?. 19:29 To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed Apr 20 11:21:46 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 20 Apr 2011 09:21:46 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 20 12:17:48 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 20 Apr 2011 13:17:48 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Doug, How many records will they be searching against roughly? You can do a reasonable incremental search character by character with DAO by using a seek on an index (which is the fastest method for finding a match), but that tops out at about 50,000 records depending on the speed of the network and PC. Might also want to consider searching on a snapshot. Using a snapshot, the data will be cached locally in a temp file. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 11:29 AM To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 13:28:18 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 11:28:18 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Thanks for the responses. I'll do some experimenting and report back. Jim, the recordset is fairly small (500 or so records) but is based on about 15 large tables. The form isn't editable, so I guess a snapshot should work. Doug On Wed, Apr 20, 2011 at 10:17 AM, Jim Dettman wrote: > Doug, > > ?How many records will they be searching against roughly? > > ?You can do a reasonable incremental search character by character with DAO > by using a seek on an index (which is the fastest method for finding a > match), but that tops out at about 50,000 records depending on the speed of > the network and PC. > > ?Might also want to consider searching on a snapshot. ?Using a snapshot, > the data will be cached locally in a temp file. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, April 20, 2011 11:29 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Search as you type > > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 15:39:02 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 16:39:02 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working Message-ID: <4DAF4466.7010506@colbyconsulting.com> I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the move but it isn't working. Has anyone ever seen this and a fix? -- John W. Colby www.ColbyConsulting.com From BradM at blackforestltd.com Wed Apr 20 15:49:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 15:49:22 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # References: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Message-ID: All, Thanks for the advice and insights. I am planning to experiment with the ideas posted. I like the sounds of the "roll your own" export (I am a product of the 1960s :-) I have never used Access to tweak a flat file, so that also is something that sounds interesting, at least to have in the bag-of-tricks. (If someone has a simple example that they are willing to share, I would appreciate it). Thanks again, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 15:58:31 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 13:58:31 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: ADO or DAO recordset? Charlotte Foust On Wed, Apr 20, 2011 at 1:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. ?The bookmark is the > accepted way of doing the move but it isn't working. > > Has anyone ever seen this and a fix? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 16:02:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 17:02:36 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: <4DAF49EC.7070606@colbyconsulting.com> Never mind. PBKAC! John W. Colby www.ColbyConsulting.com On 4/20/2011 4:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the > move but it isn't working. > > Has anyone ever seen this and a fix? > From dbdoug at gmail.com Wed Apr 20 16:05:34 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 14:05:34 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF49EC.7070606@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Wed Apr 20 16:07:42 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 16:07:42 -0500 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working References: <4DAF4466.7010506@colbyconsulting.com><4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem Between Keyboard and Chair ? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 4:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Me.Bookmark = rst.Bookmark not working OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 16:08:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 14:08:06 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem (exists) Between Keyboard And Chair Charlotte Foust On Wed, Apr 20, 2011 at 2:05 PM, Doug Steele wrote: > OK, I'll bite - what is PBKAC? > Doug > > On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: >> Never mind. PBKAC! >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/20/2011 4:39 PM, jwcolby wrote: >>> >>> I am trying to lookup and move to a record in a form. The bookmark is the >>> accepted way of doing the >>> move but it isn't working. >>> >>> Has anyone ever seen this and a fix? >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Wed Apr 20 16:37:35 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 21 Apr 2011 07:37:35 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # In-Reply-To: References: , Message-ID: <4DAF521F.5986.238ED302@stuart.lexacorp.com.pg> One useful "flat file tweak" is when you are supplied with a Unix file that has LF as line terminators instead of CRLF. You need to convert such files before you can read them in with Line Input. Here's a simple function to read the whole file into memory and change LFs to CRLFs. It works fine as long as the export file doesn't exceed about 2 billion characters, which is the limit of a single string length. :-) There are lots of other things you can do in a similar vein. You could for instance parse the file into an array of lines instead using strMyArray() = Split(strTemp,Chr$(10)) Function UnixToDosFile(filename) As Long Dim fileroot As String Dim fileext As String Dim newfile As String Dim ff As Long Dim flen As Long Dim strTemp As String 'Create a name for the output file fileext = Right$(filename, Len(filename) - InStrRev(filename, ".")) fileroot = Left$(filename, InStrRev(filename, ".") - 1) newfile = fileroot & "-DOS." & fileext 'Get a file handle ff = FreeFile 'Load complete Unix file into memory Open filename For Binary As #ff flen = LOF(ff) ' how big is the file strTemp = Space$(flen) 'make our buffer the same size. Get #ff, , strTemp 'get the file into memory Close #ff 'Replace LF with CRLF strTemp = Replace(strTemp, Chr$(10), Chr$(13) & Chr$(10)) 'Save new file Open newfile For Binary As #ff Put #ff, , strTemp Close #ff End Function -- Stuart On 20 Apr 2011 at 15:49, Brad Marks wrote: > All, > > Thanks for the advice and insights. > > I am planning to experiment with the ideas posted. > > I like the sounds of the "roll your own" export (I am a product of the > 1960s :-) > > I have never used Access to tweak a flat file, so that also is > something that sounds interesting, at least to have in the > bag-of-tricks. (If someone has a simple example that they are willing > to share, I would appreciate it). > > Thanks again, > Brad > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] > Problem Exporting to a CSV file with a Column Namethat has a # > > Hi Brad, > > Listen to Gustav ;-) > > Especially for import. You willl find all sorts of CSV file formats. > The biggest problem is the inconsistent use of "quotes". Sometime all > dates and strings are quoted, sometimes they are only quoted if they > contain a comma, sometimes you will get numbers quoted because they > are formatted to include commas and others which are not because they > don't include commas, sometimes you will get embedded real quotes > represented as double quotes. You can get all of these variations in > a single file. The built in Import function can't handle many of > them. > > What I do is import the line, strip the quotes and convert it into Tab > delimited strings without extraneous quotes. > > Function ConvertLine(strIn As String) As String > 'Converts CSV(either quoted or non-quoted text) to TAB delimited > Dim inquotes As Boolean Dim strC As String Dim x As Long > > 'Change real delimiter commas to Tabs > 'ie those that aren't inside quotes > For x = 1 To Len(strIn) > strC = Mid$(strIn, x, 1) > If strC = "," And Not inquotes Then > Mid$(strIn, x, 1) = Chr$(9) > End If > If strC = """" Then > inquotes = Not inquotes > End If > Next > > ' there may be real quotes escaped as "paired" quotes > ' so change them temporarily to a non print character > strln = Replace(strln,"""""",chr$(1)) > > 'get rid of all the remaining quotes > strln = Replace(strIn, """", "") > > 're-instate the escaped quotes > ConvertLine = Replace(strln,Chr$(1),"""") > End Function > > Then I split the record using > ... > Line Input #ff strInputLine > strData() = Split(Convertline(strInputLine),Chr$(9)) > ... > > Once you have done that, you can convert the strings to other data > types as required. > > -- > Stuart > > On 20 Apr 2011 at 9:59, Gustav Brock wrote: > > > Hi Brad > > > > Listen to Stuart. > > Once you have this set up you are in total control and will never > > look back. The same goes for importing text files. > > > > /gustav > > > > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > > The best solution is not to use the built in Access export routine. > > Roll your own and you can put anything you want in the file. > > > > Aircode: > > > > Function Export() as Long > > Dim rs as DAO.Recordset > > Dim ff as long > > ff = Freefile > > set rs = CurrentDB.Openrecordset("qryMyExport") > > ff = Freefile > > Open "myExportFile.csv" for Output as #ff > > Print #1,"First fieldname,Employee #,Third fieldname" > > While not rs.Eof > > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > > rs.movenext > > Wend > > Close #ff > > End Function > > > > -- > > Stuart > > > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > > > All, > > > > > > We are just starting to use an Access 2007 application to feed > > > data to another outside system via a CSV file. > > > > > > This outside system is very rigid and we need to use exact field > > > names on the CSV file that we are creating. > > > > > > The catch is that one of the fields is call "Employee #". > > > > > > We set up an Export Specification (called Export-Query1 for our > > > testing) and we are using the following command to do the export > > > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > > > When we run the application, everything works nicely, except the > > > field named "Employee #" is somehow being renamed "Employee ." in > > > the generated CSV file. > > > > > > We have run a number of tests and it looks like we have stumbled > > > upon either a "bug" a "feature", or something that we just don't > > > understand. > > > > > > Is there a way to force Access to not replace the "#" with a "." > > > ? > > > > > > Thanks for your help, > > > > > > Brad > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Thu Apr 21 10:33:09 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 21 Apr 2011 08:33:09 -0700 Subject: [AccessD] Search as you type (note to JC) Message-ID: John, the timer logic you suggested for the search box worked like a charm. It makes the search much smoother to use. I'm still going experiment with ADO for this when I have a bit of time. Doug From DWUTKA at Marlow.com Thu Apr 21 10:33:51 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 10:33:51 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:22:40 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:22:40 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 21 11:28:37 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:28:37 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <2F55242637C64867956F4EF369D6E259@HAL9005> Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:30:28 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:30:28 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:39:20 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:39:20 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <64BB5603B8E945EC97F03BBD8B503D18@HAL9005> Yep. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:50:38 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:50:38 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <2F55242637C64867956F4EF369D6E259@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> <2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 21 12:26:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 21 Apr 2011 13:26:38 -0400 Subject: [AccessD] Search as you type (note to JC) In-Reply-To: References: Message-ID: <4DB068CE.9040408@colbyconsulting.com> > John, the timer logic you suggested for the search box worked like a charm. Its nice to occasionally get one right. :) Long ago I built a system to take a list and populate it with the matches to the characters being typed into a text box. I sized the list to just a single line and positioned it butted up to the bottom of the text box. As the user typed the first character into the text box, the logic "opened" the list by causing the size to change to some value (a few inches). Then I populated the list with "like CharactersTypedIn*". When the user tabbed out (onExit of the text box) the top value in the list was pulled into the text box and the list pulled back up to a single line. It worked just like a combo box basically. John W. Colby www.ColbyConsulting.com On 4/21/2011 11:33 AM, Doug Steele wrote: > John, the timer logic you suggested for the search box worked like a > charm. It makes the search much smoother to use. > > I'm still going experiment with ADO for this when I have a bit of time. > > Doug From accessd at shaw.ca Thu Apr 21 13:17:13 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 21 Apr 2011 11:17:13 -0700 Subject: [AccessD] Slightly off topic In-Reply-To: <4DB068CE.9040408@colbyconsulting.com> References: <4DB068CE.9040408@colbyconsulting.com> Message-ID: Hi All: Does anyone know of a little routine that will open a DVD drive and then re-close it. I have some remote processes that have this requirement. MTIA Jim From jwcolby at colbyconsulting.com Fri Apr 22 07:44:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 08:44:50 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: <4DB17842.4020604@colbyconsulting.com> I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Apr 22 08:06:23 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 09:06:23 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB17842.4020604@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Hi John, I've just finished a similar project for downloading all pdf and xls from a site and the iron is still hot. I know its volunteer - just send the relevant access info to my address and I'll get your pics for you. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 8:45 AM To: Access Developers discussion and problem solving Subject: [AccessD] How do I Grab the picture from the web page I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Fri Apr 22 08:31:15 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 08:31:15 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad From jwcolby at colbyconsulting.com Fri Apr 22 08:34:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 09:34:49 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4DB183F9.90006@colbyconsulting.com> Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading > all pdf and xls from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info > to my address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From rockysmolin at bchacc.com Fri Apr 22 08:44:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 06:44:36 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Fri Apr 22 08:48:18 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 22 Apr 2011 08:48:18 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4db18725.06c7640a.18cc.75b7@mx.google.com> Brad, I'm with you. Although after ten years working with Access, I still get confused between ADO and DAO. As a matter of preference, maybe because I don't understand the issues, I routinely use DAO anytime I need to create a TableDef or anything else that needs to connect to a database, etc. Maybe someone on this list can give us definitions of the two and give examples where one is better than the other. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 8:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 09:09:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 10:09:05 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <4db18725.06c7640a.18cc.75b7@mx.google.com> References: <4DB17842.4020604@colbyconsulting.com> <4db18725.06c7640a.18cc.75b7@mx.google.com> Message-ID: <4DB18C01.3000202@colbyconsulting.com> DAO is the object model for the the Access database object. DAO knows about things like *Microsoft ACCESS* databases, tables, fields, properties, queries, forms, reports and so forth. IOW *anything* that is an object in Access is manipulated using DAO. You can modify the tabledef object with DAO I believe. DAO knows nothing about *anything* other than objects inside of an Access database container. ADO is an object model for manipulating very specific objects related to *data* and will work with any data store which has an ADO provider - which includes SQL Server, Access, MySQL, etc. It knows about the command object, datasets, tables, columns, relationships and the like. It is possible to change a table with SQL. There are keywords for adding and dropping columns, the data type for the column, adding indexes and the like. You can execute SQL using the ADO command object. That is different from doing so directly with ADO. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:48 AM, jm.hwsn wrote: > Brad, > I'm with you. Although after ten years working with Access, I still get > confused between ADO and DAO. > As a matter of preference, maybe because I don't understand the issues, I > routinely use DAO anytime I need to create a TableDef or anything else that > needs to connect to a database, etc. > > Maybe someone on this list can give us definitions of the two and give > examples where one is better than the other. > > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 8:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > From michael at mattysconsulting.com Fri Apr 22 09:40:42 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 10:40:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> John, OK, I think the best way to approach this is for you to visit http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp It took me an hour or two to get the right elements for my project and then lots more to loop through the relevant tables, rows, childnodes, and cells to get the right info. Basically, you want the href of the image and then it's a simple binary save object to file, thus http://www.devx.com/vb2themax/Tip/18441 Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 9:35 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa ge=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading all pdf and xls > from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info to my > address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 09:42:48 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 09:42:48 -0500 Subject: [AccessD] Trouble using Split command Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> I am trying to use the split command on the following string " 0.000 243.729 - 61.495 -" I have a dim statements as follows Dim LineText As String Dim Test() As String The split statement is as follows Test = Split(LineText)(0) No matter how I dim Test() I get an error message of Run Time Error 13 Type Mismatch This seems like it should be real simple but I am obviously missing something. Thanks. Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From phpons at gmail.com Fri Apr 22 09:57:35 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 16:57:35 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Fri Apr 22 10:04:58 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 17:04:58 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:06:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:06:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C9C@houex1.kindermorgan.com> Still generates the same error of Type Mismatch -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 9:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Fri Apr 22 10:12:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:12:20 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:18:05 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:18:05 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From charlotte.foust at gmail.com Fri Apr 22 10:35:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:35:20 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Yes, it is possible to change a table (not a tabledef, please note) with ADO, but you have to use the ADOX library, and the process is different. ADOX is the library that lets you create and edit tables using ADO. The 2010 help files aren't very helpful when it comes to ADOX, I've noticed. However, the MSDN files are better. Take a look at http://support.microsoft.com/kb/291264/fr to see about manipulating tables and links in ADOX. Charlotte Foust On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks wrote: > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jackandpat.d at gmail.com Fri Apr 22 10:44:52 2011 From: jackandpat.d at gmail.com (jack drawbridge) Date: Fri, 22 Apr 2011 11:44:52 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Here's a link to some ADO examples and tips by Allen Browne. http://allenbrowne.com/func-adox.html Specific to Modify table is http://allenbrowne.com/func-adox.html#ModifyTableAdox On Fri, Apr 22, 2011 at 11:35 AM, Charlotte Foust wrote: > Yes, it is possible to change a table (not a tabledef, please note) > with ADO, but you have to use the ADOX library, and the process is > different. ADOX is the library that lets you create and edit tables > using ADO. The 2010 help files aren't very helpful when it comes to > ADOX, I've noticed. However, the MSDN files are better. Take a look > at http://support.microsoft.com/kb/291264/fr to see about manipulating > tables and links in ADOX. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks > wrote: > > All, > > > > We have an existing Access 2007 application that uses ADO. > > > > We now want to enhance this application to be able to change a TableDef > > with VBA code so that we can change the path to an Excel file on the > > fly. > > > > Is it possible to change TableDefs with ADO? > > > > I have seen many examples of how to change TableDefs with DAO, but I > > have not yet discovered an example of how to do this with ADO. > > > > I am fairly new to the world of Access and I am still trying to wrap my > > little brain around the "ADO vs DAO" debate. > > > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > > > Thanks, > > Brad > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:48:15 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:48:15 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. Correct me if I am wrong. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 10:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:50:18 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:50:18 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB7@houex1.kindermorgan.com> The (0) is to put the first element of the array into the variable Test -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:12 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:51:38 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:51:38 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB8@houex1.kindermorgan.com> The - is part of the string that is being read from a text file using a lineinput statement. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:18 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 10:53:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 11:53:08 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1A464.3090708@colbyconsulting.com> OK, thanks for that! John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:55:46 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:55:46 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Fri Apr 22 11:01:18 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 09:01:18 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: This is how I use it: 'Opening ARgs = "ReturnForm|ReturnField" Dim arrX As Variant If Nz(Me.OpenArgs, "") <> "" Then arrX = Split(Me.OpenArgs, "|") strReturnForm = arrX(0) strReturnField = arrX(1) End If On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the > first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a large > >> number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 11:08:53 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 11:08:53 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> I tried changing the dim statement to Dim Test as Variant I then did Test = Split(LineText) Test2=Test(0) Both variables test and test2 are empty I ran a LEN test on the variable LineText and got 98 I am puzzled. Thanks for everyone's help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:56 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From phpons at gmail.com Fri Apr 22 11:32:32 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 18:32:32 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Fri Apr 22 11:50:14 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 11:50:14 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From jedi at charm.net Fri Apr 22 12:25:08 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:25:08 -0400 (EDT) Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <2419.24.35.19.37.1303493108.squirrel@mail.expedient.net> John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or > obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page > to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn > how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first > string, but it would be good (for another project) to know how I insert > data into the controls and > click the search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table > collection etc. The web control is found by clicking the ellipsis in the > toolbox bar in form design > and going down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I > have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they > apparently did not program the web site in a "nice" manner, tables just > have one big long string > etc. the following is the code that I use to poke through the dozens of > tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading >> all pdf and xls from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info >> to my address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Fri Apr 22 12:33:43 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:33:43 -0400 (EDT) Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <2432.24.35.19.37.1303493623.squirrel@mail.expedient.net> Chester, if you are still having trouble consider using the debugger. Stop on the line Test = Split(LineText) and view the contents of LineText to make sure there is something there. If there is a valid string then view the properties of Split(LineText), there should be a bunch. You may need to place them in the Inspection window. Goodluck, Mike... > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: >> My understanding is that the result of the split statement is a one >> dimensional array. Thus the Dim test() as Variant >> The Test = Split(LineText)(0) statement is meant to put the contents of >> the first array element into the variable Test. >> Correct me if I am wrong. >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons >> Sent: Friday, April 22, 2011 10:05 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Trouble using Split command >> >> Better! >> >> Public Sub test() >> ? ?'I have a dim statements as follows >> ? ?Dim LineText As String >> ? ?Dim test As Variant ' no parenthesis for the name of the variable >> ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 >> 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" >> ? ?'The split statement should be as follows >> ? ?test = Split(LineText, "0") ' the split separator must be within the >> () >> of the split function >> End Sub >> Philippe >> 2011/4/22 philippe pons >> >>> Dim Test() As Variant >>> >>> Philippe >>> >>> 2011/4/22 Kaup, Chester >>> >>> I am trying to use the split command on the following string >>>> >>>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? >>>> - >>>> ? ? 61.495 ? ? ? ? ? ? ?-" >>>> >>>> I have a dim statements as follows >>>> Dim LineText As String >>>> Dim Test() As String >>>> >>>> The split statement is as follows >>>> Test = Split(LineText)(0) >>>> >>>> No matter how I dim Test() I get an error message of >>>> Run Time Error 13 >>>> Type Mismatch >>>> >>>> This seems like it should be real simple but I am obviously missing >>>> something. >>>> >>>> Thanks. >>>> >>>> >>>> >>>> >>>> Chester Kaup >>>> Engineering Technician >>>> Kinder Morgan CO2 Company, LLP >>>> Office (432) 688-3797 >>>> FAX (432) 688-3799 >>>> >>>> >>>> No trees were killed in the sending of this message. However a large >>>> number of electrons were terribly inconvenienced. >>>> >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >>> >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 12:43:28 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 13:43:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: Whoa. Well, you may be right ... however, I think one can actuate the link like this: Dim ITM as HTMLLINKELEMENT Set ITM = Doc.Links(ThatLink) ITM.Click The picture will then be visible. That may not be enough, though. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Bahr Sent: Friday, April 22, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchre > sults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter > data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they apparently did not program the web site in > a "nice" manner, tables just have one big long string etc. the > following is the code that I use to poke through the dozens of tables > they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 13:05:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 13:05:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Thanks for everyone's help and suggestions. I wanted to get out just the 5 data elements. Obviously I need a different plan. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 11:33 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 13:13:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 14:13:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1C556.70804@colbyconsulting.com> Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 13:55:36 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 14:55:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: John, Please elaborate on what is meant by early binding, since the control can be placed on a form and it shows all properties and methods in the Object Browser? Or did you mean late binding? Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 2:14 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project and > then lots more to loop through the relevant tables, rows, childnodes, > and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults& > listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I need to learn how it is done so I can > do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is > the code that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 14:00:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 12:00:19 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <8147EC9653BF4537B0067252FF8940A7@HAL9005> IIRC if you define all the DOA and ADO objects explicitly they'll play well together. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 9:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Apr 22 15:05:08 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 13:05:08 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > From rockysmolin at bchacc.com Fri Apr 22 16:40:00 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:40:00 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 16:41:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:41:22 -0700 Subject: [AccessD] Hide Form Title Bar References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <6864E3DD26DE4AB1A32DA74295F92233@HAL9005> Actually, I just noticed that there's a tiny sliver of bar at the top that lets you drag the form. Why do they DO THAT??!!! Rocky -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Friday, April 22, 2011 2:40 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , Message-ID: <4DB1FB8D.3278.2DF4AAA1@stuart.lexacorp.com.pg> No, even worse. I repeat - Variants are an abomination A comparison of your two examples shows why this is so. -- Stuart On 22 Apr 2011 at 17:04, philippe pons wrote: > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within > the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 > >> - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a > >> large number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, Message-ID: <4DB1FB8D.7908.2DF4AA15@stuart.lexacorp.com.pg> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" The Split() function returns a String array. So Dim Test() as Stinrg is correct. -- Stuart On 22 Apr 2011 at 16:57, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > > I am trying to use the split command on the following string > > > > " 0.000 243.729 > > - > > 61.495 -" > > > > I have a dim statements as follows > > Dim LineText As String > > Dim Test() As String > > > > The split statement is as follows > > Test = Split(LineText)(0) > > > > No matter how I dim Test() I get an error message of > > Run Time Error 13 > > Type Mismatch > > > > This seems like it should be real simple but I am obviously missing > > something. > > > > Thanks. > > > > > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:14:32 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:14:32 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <4DB1FDC8.23134.2DFD5E85@stuart.lexacorp.com.pg> Why didn't you say so :-) Dim LineText as string Dim Elements() as string DIm x as long LineText = " 0.000 243.729 - 61.495 - " 'Reduce multiple spaces to singles While instr(Linetext," ") > 0 LineText = Replace(LineText," "," ") Wend 'Get the data Elements() = Split(LineText," ") 'Do something with the data For x = 1 to UBound(Elements()) debug.print Elements(x) Next On 22 Apr 2011 at 13:05, Kaup, Chester wrote: > Thanks for everyone's help and suggestions. I wanted to get out just > the 5 data elements. Obviously I need a different plan. > From jwcolby at colbyconsulting.com Fri Apr 22 17:40:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 18:40:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB203E4.6000305@colbyconsulting.com> In order to pass the object to a class or method of a module any way other than "as object" you need to know what it is. IOW As textbox, as combobox etc. If you pass it "as object" then intellisense no longer works inside of the method or class. "As object" is late binding. In order te sink events in a class you have to ue early binding. Dim WithEvents XYZ as SomeObjType. John W. Colby www.ColbyConsulting.com On 4/22/2011 2:55 PM, Michael Mattys wrote: > John, > > Please elaborate on what is meant by early binding, > since the control can be placed on a form and it shows > all properties and methods in the Object Browser? > Or did you mean late binding? > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From charlotte.foust at gmail.com Fri Apr 22 17:48:27 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 15:48:27 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <8147EC9653BF4537B0067252FF8940A7@HAL9005> References: <4DB17842.4020604@colbyconsulting.com> <8147EC9653BF4537B0067252FF8940A7@HAL9005> Message-ID: You can use both, if you declare them specifically, but don't try to mix them because ADO calls don't work on a DAO object! Charlotte Foust On Fri, Apr 22, 2011 at 12:00 PM, Rocky Smolin wrote: > IIRC if you define all the DOA and ADO objects explicitly they'll play well > together. > > Rocky > > > -----Original Message----- > From: accOessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 9:50 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All - Thanks for the help/advice/insights ... Brad > > ~~~~~~~~~~~ > > Rocky, > > In the situation that I am dealing with, the Excel file is a "Linked Table". > > This works fine. > > Now we want to be able to change the Path to this Linked Table with VBA > code. > > I have this working using DAO, but I have some concern about using both DAO > and ADO in the same application. > > It appears that using both DAO and ADO is Okay, but I am not 100% sure. > > Thanks, > Brad > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin > Sent: Friday, April 22, 2011 8:45 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > What kind of change do you want to make? ?Wouldn't the path to the Excel > file be stored as data in a text field in the table? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 6:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef with > VBA code so that we can change the path to an Excel file on the fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I have > not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Fri Apr 22 19:42:41 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 22 Apr 2011 19:42:41 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Fri Apr 22 20:03:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 18:03:02 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <171D63778466419685EA3C5EE9C24CB0@HAL9005> On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 23 06:37:51 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 23 Apr 2011 13:37:51 +0200 Subject: [AccessD] Trouble using Split command Message-ID: Hi Stuart Let me guess: Stuart loves programming VBScript! /gustav >>> stuart at lexacorp.com.pg 23-04-2011 00:05:01 >>> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" From dhb at flsi.com Sat Apr 23 07:20:00 2011 From: dhb at flsi.com (Darrell Burns) Date: Sat, 23 Apr 2011 05:20:00 -0700 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases Message-ID: <032a01cc01b0$c4a1c630$4de55290$@com> Howdy. First-time on AccessD. I've tried all the other forums and can't get an answer to this one. I have a FE A2007 app linked to a BE A2007 database. There's a master form with 6 tabs. Each tab contains a subform that's bound to a query. Plus I open recordsets on the the BE tables to fetch stuff for the form. You can drill down from any subform to a detailed form by double-clicking a data field. I started getting the above error message after opening 2 or 3 of these forms, so I created a form handler method that shuts down the calling form and closes all the DB connections before opening the target form. I'm still getting that error. I've gone thru my code and diligently set all DBs to nothing at the end of each sub, but I can't seem to lick the problem. Suggestions from other forums have been to unbind the tables from the subforms. I buy that, but the question I can't get an answer to is how can I monitor how many connections I have open at one time so I can diagnose the problem? I feel like I'm debugging in the dark. Please turn on the light for me. Thanx, Darrell From jwcolby at colbyconsulting.com Sat Apr 23 08:13:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:13:11 -0400 Subject: [AccessD] Trouble using Split command In-Reply-To: References: Message-ID: <4DB2D067.20705@colbyconsulting.com> LOL. The reality is that variants are a specialized tool used for specific situations. There are things that you cannot accomplish without them but if you know what the data type you need is, you should use that type rather than a variant. John W. Colby www.ColbyConsulting.com On 4/23/2011 7:37 AM, Gustav Brock wrote: > Hi Stuart > > Let me guess: Stuart loves programming VBScript! > > /gustav > > >>>> stuart at lexacorp.com.pg 23-04-2011 00:05:01>>> > NO! > > Repeat after me, seven times... > > "Variants are an abomination. They are rarely required and must be used with caution" > > > From DWUTKA at Marlow.com Sat Apr 23 08:16:32 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 08:16:32 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <171D63778466419685EA3C5EE9C24CB0@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> <171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sat Apr 23 08:51:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:51:18 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB2D956.50309@colbyconsulting.com> Darrell, This is one of those misleading error messages. Every single open query or or table uses a "database". This means every combo box (uses a query to display the data), bound form, bound report, open recordset and so forth. The usual villain is a bound form with bound subforms with dozens of combo boxes open. I investigated this extensively a few years ago and what I discovered is that Access has some magic number which is the maximum number of recordsets available to the application. It seems that the number was somewhere around 1800. Every time you opened a query (combo, report, sub-report etc) the number available dropped. When you got low enough (and "low enough was not zero) you started getting this error. There is no fix, this is a "by design" limitation. You work around it by using JIT subforms and the like to minimize the number of objects using queries. BTW, you can discover for yourself what this number is fairly easily but there is no place (that I could discover) that you could go to see how many were left. The following code is not pretty but it does the job. In my case I am getting only 408 recordsets. I could swear the number was much higher. this is against linked SQL Server databases so maybe that has something to do with it. If we could get a bunch of people to run the code and report back their numbers that would help us to see better. Function rstOpen(db As DAO.Database, intTheLimit As Integer) As DAO.Recordset Dim rst As DAO.Recordset On Error Resume Next Set rst = db.OpenRecordset("SELECT * from tblLocation", dbOpenSnapshot, dbSeeChanges) If Err Then MsgBox intTheLimit & " is the max number of recordsets you can open" Else Set rstOpen = rst End If End Function Function TestTheLimit() Dim db As DAO.Database Dim col As Collection Dim intTheLimit As Integer Set db = CurrentDb Set col = New Collection On Error Resume Next While True intTheLimit = intTheLimit + 1 col.Add rstOpen(db, intTheLimit) Debug.Print intTheLimit DoEvents Wend End Function John W. Colby www.ColbyConsulting.com On 4/23/2011 8:20 AM, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master form > with 6 tabs. Each tab contains a subform that's bound to a query. Plus I > open recordsets on the the BE tables to fetch stuff for the form. You can > drill down from any subform to a detailed form by double-clicking a data > field. I started getting the above error message after opening 2 or 3 of > these forms, so I created a form handler method that shuts down the calling > form and closes all the DB connections before opening the target form. I'm > still getting that error. I've gone thru my code and diligently set all DBs > to nothing at the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how can I > monitor how many connections I have open at one time so I can diagnose the > problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > From accessd at shaw.ca Sat Apr 23 09:18:30 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 23 Apr 2011 07:18:30 -0700 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: Hi John: It is done via a process call screen-scraping and it can only be done using webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 11:14 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 09:25:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 07:25:26 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 23 10:10:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 11:10:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB2EBE4.7060009@colbyconsulting.com> > ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Uh... this kind of thing needs to be done many different places. It is rarely about "pick your tool to do this", rather "this app uses X tool, how do I do it there". This app uses Access / VBA. How do I do it there? Telling me to go off and rewrite my app in some other tool so that I can use that tool to do one tiny piece is... draconian. It turns out that there is an IE object which knows how to do most of this kind of thing, and can be automated from VBA. It is really a matter of studying that long enough to figure it out. John W. Colby www.ColbyConsulting.com On 4/23/2011 10:18 AM, Jim Lawrence wrote: > Hi John: > > It is done via a process call screen-scraping and it can only be done using > webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... > > ...and that is a whole different subject/environment/topic. ASP.Net would be > your best all around solution. > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 11:14 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Has anyone here ever figured out how to early bind the WebBrowser activeX > object? > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 10:40 AM, Michael Mattys wrote: >> John, >> >> OK, I think the best way to approach this is for you to visit >> http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp >> >> It took me an hour or two to get the right elements for my project >> and then lots more to loop through the relevant tables, rows, >> childnodes, and cells to get the right info. >> >> Basically, you want the href of the image and then it's a simple >> binary save object to file, thus >> >> http://www.devx.com/vb2themax/Tip/18441 >> >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, April 22, 2011 9:35 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] How do I Grab the picture from the web page >> >> Michael, >> >> Thanks. The web page I navigate to is as follows: >> >> > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 >> > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa >> ge=1 >> >> I literally replace the offenderID with the ID (called an OPUS number) of >> the inmate I am viewing or obtaining the record for. >> >> What you are viewing if you go to this link is an actual record of some >> inmate. Open this web page to view the html behind. >> >> Notice that the picture is obscured, with a "click to show photo" which I >> assume is actually a button? >> >> It is not that I need to get one or even several photos. I need the > *code* >> to do it from VBA, and I need to learn how it is done so I can do it again >> by myself. >> >> I would prefer to actually retrieve the photo to a file stored on disk, >> however I also want to learn how to click buttons (and enter data). >> >> The following is the actual search website. >> >> http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view >> >> I don't need it for this project because I can do a simple replace of the >> OPUS ID in that first string, but it would be good (for another project) > to >> know how I insert data into the controls and click the search button, how > to >> click the Clear Selection button etc. >> >> I currently use an ActiveX control inserted into a subform to retrieve >> pages, get the table collection etc. The web control is found by clicking >> the ellipsis in the toolbox bar in form design and going down until you >> find the Microsoft Web Browser control. >> >> I have found code in Google to do this other ways but this is the way I > have >> managed to get working. >> I wrote a class "wrapper" with methods that I call to parse out the > data. >> It is ugly but they apparently did not program the web site in a "nice" >> manner, tables just have one big long string etc. the following is the > code >> that I use to poke through the dozens of tables they use. >> >> Again, there might be an easier way but this is how I got it working. >> >> Function mSearchTable(wbbWebsite As Object) >> >> Dim varTables As Variant >> Dim varTable As Variant >> >> Dim strOffenderInfo As String >> Dim strMostRecent As String >> >> >> Set varTables = wbbWebsite.Document.All().tags("table") >> Set varTables = wbbWebsite.Document.All.tags("TABLE") >> For Each varTable In varTables >> >> Dim strInnerText As String >> strInnerText = varTable.innerText >> 'Use the innerText to see if this is the table we want. >> 'Debug.Print varTable.innerText >> >> If (InStr(strInnerText, "Offender Information")) And (Not >> mblnOffenderInfoFound) Then >> strOffenderInfo = strInnerText >> mParseInfoOffender strInnerText >> Else >> If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not >> mblnMostRecentInfoFound) Then >> strMostRecent = strInnerText >> mParseMostRecent strMostRecent >> End If >> >> End If >> Next varTable >> >> End Function >> >> So what I need is not a fish, but to learn *how* to fish. >> >> Any assistance gratefully accepted. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/22/2011 9:06 AM, Michael Mattys wrote: >>> Hi John, >>> >>> I've just finished a similar project for downloading all pdf and xls >>> from a site and the iron is still hot. >>> >>> I know its volunteer - just send the relevant access info to my >>> address and I'll get your pics for you. >>> >>> Michael R Mattys >>> Business Process Developers >>> www.mattysconsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From rockysmolin at bchacc.com Sat Apr 23 10:26:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 08:26:16 -0700 Subject: [AccessD] Autocorrect Dialog Box Message-ID: Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky From jwcolby at colbyconsulting.com Sat Apr 23 11:06:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 12:06:45 -0400 Subject: [AccessD] SQL Server times link as str Message-ID: <4DB2F915.1070407@colbyconsulting.com> I am linking to tables with date / time fields in SQL Server. The field in Access says it is a date. This appears to be causing all kinds of issues. I cannot see any way to intercept the link and tell the wizard that a specific field is a specific data type. Is there any way to fix this? -- John W. Colby www.ColbyConsulting.com From rockysmolin at bchacc.com Sat Apr 23 11:12:08 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:12:08 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: Message-ID: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 11:16:44 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:16:44 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> Message-ID: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Sat Apr 23 12:33:23 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 23 Apr 2011 10:33:23 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 12:57:11 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 10:57:11 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005><23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Bill: Not trying to set the autocorrect options but just trigger the dialog box so that the user can fiddle with it. Apparently, from what I've been able to find on the internets, it works in Excel - there's a constant for it in the Application.Dialogs object. But I can't find the equivalent for Access. Although, IME, anything you can do through the menus you can do through code. Since I can get that dialog box by clicking Tools-->AutoCorrectOptions in 2003 (there's a different sequence of course, in 2007) I'm thinking this has to be doable in code as well. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Patten Sent: Saturday, April 23, 2011 10:33 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 16:28:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:28:18 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB2F915.1070407@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com> Message-ID: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> What sort of issues? Is the SQL Server field a datetime or a smalldatetime? Using ODBC? What Client? AFAIK, Access doesn't have a "Date" field type, only a Date/Time -- Stuart On 23 Apr 2011 at 12:06, jwcolby wrote: > I am linking to tables with date / time fields in SQL Server. The > field in Access says it is a date. This appears to be causing all > kinds of issues. I cannot see any way to intercept the link and tell > the wizard that a specific field is a specific data type. Is there > any way to fix this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sat Apr 23 16:55:17 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:55:17 +1000 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <>, <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> >From everything that I have read, Access maintains TableIDs internally and the number currently used is not exposed in any way, so sadly it appears that the answer to your question is - You can't. -- Stuart On 23 Apr 2011 at 5:20, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master > form with 6 tabs. Each tab contains a subform that's bound to a query. > Plus I open recordsets on the the BE tables to fetch stuff for the > form. You can drill down from any subform to a detailed form by > double-clicking a data field. I started getting the above error > message after opening 2 or 3 of these forms, so I created a form > handler method that shuts down the calling form and closes all the DB > connections before opening the target form. I'm still getting that > error. I've gone thru my code and diligently set all DBs to nothing at > the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how > can I monitor how many connections I have open at one time so I can > diagnose the problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 17:16:51 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 18:16:51 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com> <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> Message-ID: <4DB34FD3.4050800@colbyconsulting.com> The SQL Server fields are time(0) and DateTime. It is picked up by Access as a string, IOW the field in design view of the linked table is a string. That probably happens because Access does not understand the miliseconds in the time, and AFAIK Access doesn't have a time field, only datetime. The issues are many but small, including weird displays of the values, necessity to convert to a date - cdate() - to do compares with other times (it converts to date just fine) and finally, I was trying to use the conditional display to color a date where it was <= date() + 180 (for example) and it just doesn't work, the colors do happen but there is no rhyme or reason to the colors. Things like that. So Access thinks it is a string, SQL Server thinks it is a date or time(0) and I am constantly fiddling with it to make it right. John W. Colby www.ColbyConsulting.com On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > What sort of issues? > > Is the SQL Server field a datetime or a smalldatetime? > Using ODBC? What Client? > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > From jimdettman at verizon.net Sat Apr 23 17:53:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 23 Apr 2011 18:53:33 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: 2048 is the table ID limit. While that sounds like a lot, every field reference carries a table I'd reference. Jim Sent from my iPhone On Apr 23, 2011, at 5:55 PM, "Stuart McLachlan" wrote: > From everything that I have read, Access maintains TableIDs internally and the number > currently used is not exposed in any way, so sadly it appears that the answer to your question > is - You can't. > > -- > Stuart > > On 23 Apr 2011 at 5:20, Darrell Burns wrote: > >> Howdy. First-time on AccessD. >> >> I've tried all the other forums and can't get an answer to this one. >> >> I have a FE A2007 app linked to a BE A2007 database. There's a master >> form with 6 tabs. Each tab contains a subform that's bound to a query. >> Plus I open recordsets on the the BE tables to fetch stuff for the >> form. You can drill down from any subform to a detailed form by >> double-clicking a data field. I started getting the above error >> message after opening 2 or 3 of these forms, so I created a form >> handler method that shuts down the calling form and closes all the DB >> connections before opening the target form. I'm still getting that >> error. I've gone thru my code and diligently set all DBs to nothing at >> the end of each sub, but I can't seem to lick the problem. >> >> >> >> Suggestions from other forums have been to unbind the tables from the >> subforms. I buy that, but the question I can't get an answer to is how >> can I monitor how many connections I have open at one time so I can >> diagnose the problem? I feel like I'm debugging in the dark. >> >> >> >> Please turn on the light for me. >> >> >> >> Thanx, >> >> Darrell >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 18:05:22 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 09:05:22 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34FD3.4050800@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> Message-ID: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not DateTime2 (also new in 2008)? Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to "down-level clients" as strings, rather than as the numerics which are used to store them, so you will have to parse then back to compatible Access datatypes yourself. See http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom patibilityforDownlevelClients "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data types added in SQL Server 2008. The following table shows the type mapping between an up-level instance of SQL Server 2008 and down-level clients." -- Stuart On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. That probably happens because Access does not understand > the miliseconds in the time, and AFAIK Access doesn't have a time > field, only datetime. > > The issues are many but small, including weird displays of the values, > necessity to convert to a date - cdate() - to do compares with other > times (it converts to date just fine) and finally, I was trying to use > the conditional display to color a date where it was <= date() + 180 > (for example) and it just doesn't work, the colors do happen but there > is no rhyme or reason to the colors. > > Things like that. > > So Access thinks it is a string, SQL Server thinks it is a date or > time(0) and I am constantly fiddling with it to make it right. > > John W. Colby > www.ColbyConsulting.com > > On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > > What sort of issues? > > > > Is the SQL Server field a datetime or a smalldatetime? > > Using ODBC? What Client? > > > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 18:11:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 19:11:42 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Message-ID: <4DB35CAE.20209@colbyconsulting.com> Thanks Stuart. I kinda figured I was screwed! ;) John W. Colby www.ColbyConsulting.com On 4/23/2011 7:05 PM, Stuart McLachlan wrote: > Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not > DateTime2 (also new in 2008)? > > Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to > "down-level clients" as strings, rather than as the numerics which are used to store them, so > you will have to parse then back to compatible Access datatypes yourself. > > See > http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom > patibilityforDownlevelClients > > "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data > types added in SQL Server 2008. The following table shows the type mapping between an > up-level instance of SQL Server 2008 and down-level clients." > From DWUTKA at Marlow.com Sat Apr 23 21:18:15 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 21:18:15 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Interesting. Not sure why 2007 would do anything different, but then again, it is 2007... LOL Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From gustav at cactus.dk Sun Apr 24 08:00:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2011 15:00:44 +0200 Subject: [AccessD] SQL Server times link as str Message-ID: Hi John What to do in such cases is to create a straight select query - an interface query - for this table only. Select all fields that come through all right; the remaining offending fields you convert or manipulate as needed. Your date field you could probably convert with CDate (or CVDate if zero length strings appear). Now use this query as source whenever your application have to pull data from the linked table. Of course, if you need to write to the linked table you will need another query to interface in the other direction. /gustav On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. .. From Chester_Kaup at kindermorgan.com Mon Apr 25 07:09:42 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 25 Apr 2011 07:09:42 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693D8D@houex1.kindermorgan.com> Thanks for the piece of code. I am going to keep it. The data is delimitated by a variable number of spaces. What I ended up doing was reading through the line and replacing double spaces with single spaces until there were no more double spaces. The split commend then worked. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Friday, April 22, 2011 3:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dhb at flsi.com Mon Apr 25 12:18:11 2011 From: dhb at flsi.com (Darrell Burns) Date: Mon, 25 Apr 2011 10:18:11 -0700 Subject: [AccessD] Tab control click event In-Reply-To: References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: <038701cc036c$c1856d40$449047c0$@com> Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB From rockysmolin at bchacc.com Mon Apr 25 12:58:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 10:58:36 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <><032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <40DAFC36A8754DC0B84338A405880D3A@HAL9005> Are you doing refresh or requery? If the refresh is because of a change on the previous page, can you refresh the data in the after update event of the control on the previous page that causes a change in the other pages? Then when the tab is clicked the data will already be refreshed. Or would that cause too much delay? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 13:00:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 11:00:49 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box Message-ID: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From andy at minstersystems.co.uk Mon Apr 25 14:06:32 2011 From: andy at minstersystems.co.uk (Andy Lacey) Date: Mon, 25 Apr 2011 20:06:32 +0100 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> Message-ID: <49C5A426F1974C2EAFCE2421DC6CF9B1@MINSTER> Hi Darrell Wouldn't just an Echo False and an Echo True around the Requery do it for you? Andy -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: 25 April 2011 18:18 To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Mon Apr 25 15:53:30 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 25 Apr 2011 13:53:30 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <000c01cc038a$e12db120$a3891360$@cox.net> Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 16:42:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 14:42:22 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <000c01cc038a$e12db120$a3891360$@cox.net> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> <000c01cc038a$e12db120$a3891360$@cox.net> Message-ID: <88183A49169647A0A40576475839C469@HAL9005> Come to think of it Doug, I did something like that on a tab form where I disappeared the tab and replaced it with a label, which looks nicer, you can format it, and has a Click event where you can do whatever and then set the focus to that page: Me.TabCtl140.Pages(1).SetFocus HTH Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 25, 2011 1:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Tab control click event Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Tue Apr 26 01:49:49 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 26 Apr 2011 16:49:49 +1000 Subject: [AccessD] Karen's Powertools Message-ID: <201104260653.p3Q6rCr3016190@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am sure a few of you have heard of or even user Karen's solutions. Got this today and maybe of interest for some of you. Very Sad '======== copied email follows =================== Dear Friends, I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. I know that Karen touched many of you with her kindness, wit, creativity and encouragement. She was a loving daughter, sister, aunt and friend. And she was a pretty darned good programmer, too. We are deeply grieving her loss. For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. We are also working to fill all CD orders that have been submitted or mailed. It is difficult to make business decisions while grieving. So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. Many of you have already written many kinds words of condolence and comfort. Please know that we greatly appreciate you. If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. You can learn more about them at www.DohnavurFellowship.org. All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. May God richly bless you, as He has all those who knew Karen. Bill Kenworthy Karen?s brother '============ end of copy ========= Regards Darryl _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From jwcolby at colbyconsulting.com Tue Apr 26 07:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 08:46:37 -0400 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: <4DB6BEAD.1000507@colbyconsulting.com> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Apr 26 08:08:45 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 26 Apr 2011 17:08:45 +0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Hi John -- Just importing everything into a new DB - wouldn't that be a solution to workaround the "bugger"? Is it MDE? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 26 ?????? 2011 ?. 16:47 To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Tue Apr 26 08:09:19 2011 From: garykjos at gmail.com (Gary Kjos) Date: Tue, 26 Apr 2011 08:09:19 -0500 Subject: [AccessD] Karen's Powertools In-Reply-To: <201104260653.p3Q6rCr3016190@databaseadvisors.com> References: <201104260653.p3Q6rCr3016190@databaseadvisors.com> Message-ID: Thanks for passing this sad news along Darryl. I have used some of Karen's tools over the years. GK On Tue, Apr 26, 2011 at 1:49 AM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > I am sure a few of you have heard of or even user Karen's solutions. ?Got this today and maybe of interest for some of you. ?Very Sad > > '======== copied email follows =================== > > Dear Friends, > > I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. ?It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. > > I know that Karen touched many of you with her kindness, wit, creativity and encouragement. ?She was a loving daughter, sister, aunt and friend. ?And she was a pretty darned good programmer, too. ?We are deeply grieving her loss. > > For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. ?We are also working to fill all CD orders that have been submitted or mailed. ?It is difficult to make business decisions while grieving. ?So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. > > Many of you have already written many kinds words of condolence and comfort. ?Please know that we greatly appreciate you. ?If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. ?You can learn more about them at www.DohnavurFellowship.org. > > All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. > > May God richly bless you, as He has all those who knew Karen. > > Bill Kenworthy > Karen?s brother > > '============ end of copy ========= > > Regards > Darryl > _______________________________________________________________________________________ > > The information transmitted in this message and its attachments (if any) is intended > only for the person or entity to which it is addressed. > The message may contain confidential and/or privileged material. Any review, > retransmission, dissemination or other use of, or taking of any action in reliance > upon this information, by persons or entities other than the intended recipient is > prohibited. > > If you have received this in error, please contact the sender and delete this e-mail > and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, disclose or distribute > the information contained in this e-mail and any attached files, with the permission > of the sender. > > This message has been scanned for viruses. > _______________________________________________________________________________________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From rockysmolin at bchacc.com Tue Apr 26 08:24:53 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 06:24:53 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <1D0DAC4651364E11BC5253FF51FB991E@HAL9005> Data in temp tables? Otherwise although a PITA, binary search. Import half the objects, see what the size is after C/R. Import half the remaining, etc. Eventually, you'll find the culprit. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 5:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Tue Apr 26 08:28:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 26 Apr 2011 09:28:33 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Create a new DB and import everything in. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 08:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 26 08:49:32 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 26 Apr 2011 08:49:32 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? From jwcolby at colbyconsulting.com Tue Apr 26 09:05:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:05:07 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <4DB6D113.3020906@colbyconsulting.com> Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution to > workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Tue Apr 26 09:14:49 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 26 Apr 2011 09:14:49 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6D113.3020906@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> What about a decompile then compact/repair? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution > to workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From dbdoug at gmail.com Tue Apr 26 09:17:25 2011 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 26 Apr 2011 07:17:25 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Any embedded graphics? Doug On Tue, Apr 26, 2011 at 7:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 26 09:29:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:29:47 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4DB6D6DB.4090509@colbyconsulting.com> I tried all of that, no help. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From Gustav at cactus.dk Tue Apr 26 09:38:55 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 26 Apr 2011 16:38:55 +0200 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: Hi John Then I guess you are left with the save-as-text and load-from-text method on all objects. /gustav >>> jwcolby at colbyconsulting.com 26-04-2011 16:29 >>> I tried all of that, no help. From john at winhaven.net Tue Apr 26 09:41:55 2011 From: john at winhaven.net (John Bartow) Date: Tue, 26 Apr 2011 09:41:55 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Even jpegs seem to increase the size far too much if one would accidently or otherwise paste a exe, dll, wmv or something into a form I'd imagine it would get huge. Check the forms and reports over and remove any ole objects or embedded images. Then decompile, compact, compile, compact. If that accomplishes nothing then I'd import it into a new db. Best of luck, John B BTW have you tried running Eatbloat on it? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 7:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 11:07:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 12:07:39 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> Message-ID: <4DB6EDCB.1090202@colbyconsulting.com> >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in one > of the forms or report. Even jpegs seem to increase the size far too much if > one would accidently or otherwise paste a exe, dll, wmv or something into a > form I'd imagine it would get huge. Check the forms and reports over and > remove any ole objects or embedded images. Then decompile, compact, compile, > compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Tue Apr 26 11:47:20 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 12:47:20 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Tue Apr 26 12:53:46 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 26 Apr 2011 12:53:46 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6EDCB.1090202@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> Message-ID: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> John, I made and have been testing an essentially one-click access utility which will do export to text and import from text of all the objects except tables. Do you want to try it? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 11:08 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. Even jpegs seem to increase the size far > too much if one would accidently or otherwise paste a exe, dll, wmv or > something into a form I'd imagine it would get huge. Check the forms > and reports over and remove any ole objects or embedded images. Then > decompile, compact, compile, compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 13:01:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 11:01:16 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Tue Apr 26 13:05:06 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 14:05:06 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 15:41:30 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 13:41:30 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: beautiful -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 11:05 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 21:59:24 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 22:59:24 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> Message-ID: <4DB7868C.4080705@colbyconsulting.com> sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility which > will do export to text and import from text of all the objects except > tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever in >> one of the forms or report. Even jpegs seem to increase the size far >> too much if one would accidently or otherwise paste a exe, dll, wmv or >> something into a form I'd imagine it would get huge. Check the forms >> and reports over and remove any ole objects or embedded images. Then >> decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jengross at gte.net Wed Apr 27 17:40:29 2011 From: jengross at gte.net (Jennifer Gross) Date: Wed, 27 Apr 2011 15:40:29 -0700 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <007b01cc052c$1d002370$1201a8c0@Schroeder> Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title? .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Apr 28 00:38:39 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 28 Apr 2011 09:38:39 +0400 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: Hi Chester -- Your code works here well - MS Access/Office 2003. What code line does report Error 430 on your system? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: 26 ?????? 2011 ?. 17:50 To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 07:20:41 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 07:20:41 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <007b01cc052c$1d002370$1201a8c0@Schroeder> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <007b01cc052c$1d002370$1201a8c0@Schroeder> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20412@houex1.kindermorgan.com> Thanks for the code example. I am going to keep it. Turns out the problem was I had to reregister DAO 3.6 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jennifer Gross Sent: Wednesday, April 27, 2011 5:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Copy recordset to excel spreadsheet Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title" .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 28 10:18:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 28 Apr 2011 08:18:01 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: having a "ODBC - Call failed" message from A97 when running the code below. RTE is a long var. code generates no errors up to the last line. I can link to tables using the log on info and password successfully. any ideas?? 'populate the object variables Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, CONNECT_STR) conTest.QueryTimeout = 0 'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE From davidmcafee at gmail.com Thu Apr 28 11:04:07 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 28 Apr 2011 09:04:07 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) > DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jm.hwsn at gmail.com Thu Apr 28 12:00:04 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 12:00:04 -0500 Subject: [AccessD] Field Level AES Encryption Message-ID: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim From Lambert.Heenan at chartisinsurance.com Thu Apr 28 12:35:53 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 13:35:53 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Thu Apr 28 13:19:11 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 13:19:11 -0500 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Thu Apr 28 13:55:59 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 14:55:59 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Message-ID: Well that's different then. :-) Access 2007 huh? Still plodding along with A2003 here. No security at all really. :-) Thanks again for the information. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 2:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Field Level AES Encryption Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 14:38:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 14:38:26 -0500 Subject: [AccessD] Acrobat question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20572@houex1.kindermorgan.com> Will this code work with Acrobat reader or is a full version necessary? Dim AcroXApp As Object Dim AcroXAVDoc As Object Dim AcroXPDDoc As Object Set AcroXApp = CreateObject("AcroExch.App") AcroXApp.Hide Set AcroXAVDoc = CreateObject("AcroExch.AVDoc") AcroXAVDoc.Open PDF_PATH & filename, "Acrobat" AcroXAVDoc.BringToFront Set AcroXPDDoc = AcroXAVDoc.GetPDDoc Dim jsObj As Object Set jsObj = AcroXPDDoc.GetJSObject jsObj.SaveAs OUTPUT_PATH & OutputFile, "com.adobe.acrobat.plain-text" AcroXAVDoc.Close False AcroXApp.Hide AcroXApp.Exit Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From newsgrps at dalyn.co.nz Thu Apr 28 15:09:14 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 29 Apr 2011 08:09:14 +1200 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) >DoEvents >conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 28 15:10:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Apr 2011 16:10:20 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4DB9C9AC.9060400@colbyconsulting.com> Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > From ab-mi at post3.tele.dk Thu Apr 28 16:21:16 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Thu, 28 Apr 2011 23:21:16 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DB9C9AC.9060400@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: How do you create the hash - any generator to recommend? Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 28. april 2011 22:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:00:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:00:07 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBAD277.8080507@colbyconsulting.com> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 ' Can be used freely even for commercial applications ' ' MS Access 97 version by ' Gustav Brock, Cactus Data ApS ' gustav at cactus.dk ' ' 2002-03-09. V1.0 ' Initial port from Visual Basic. ' 2002-06-23. V1.1 ' Code clean up and constants added. ' Redundant code removed. ' Modified to fully comply with VB datatypes. ' Modified to not crash for certain passwords. ' Modified for high speed conversion of long strings ( > 32K). ' 2002-06-24. V1.2 ' Functions added for en/decrypting to/from binary strings. ' Usage: ' SetPassword(password) sets password prior to en/decryption. ' GetPassword() retrieves current password. ' StrEncrypt(DecryptedString) returns encrypted ascii string. ' StrDecrypt(EncryptedString_ascii) returns decrypted string. ' StrEncryptBin(DecryptedString) returns encrypted binary string. ' StrDecryptBin(EncryptedString_binary) returns decrypted string. ' ' Encrypted ascii string is twice the length of the decrypted string. ' Encrypted ascii string contains low ascii chars from a to p only. ' Encrypted binary string is same length as the decrypted string. ' Encrypted binary string may contain any char including Chr(0). ' Password may contain any ascii char including Chr(0). ' Password is maintained in global variable strPC1Password16. Private Const clngHexMax As Long = &H10 Private Const clngBytMax As Long = &H100 ' Maximum value of unsigned Integer. Private Const clngIntMax As Long = &H10000 ' clngAscMin defines beginning of a 16 letter range from a to p. Private Const clngAscMin As Long = &H61 Private strPC1Password16 As String * clngHexMax Private x1a0(9) As Long Private cle(17) As Long Private x1a2 As Long Private lngInt As Long Private lngRes As Long Private lngTmp As Long Private ax As Long Private bx As Long Private cx As Long Private dx As Long Private si As Long Private i As Long Private c As Long Private d As Long Private e As Long Private strEncrypted As String Private strDecrypted As String Public Function SetPassword(ByRef strPassword As String) As Integer Dim intPasswordLength As Integer ' Remove leading and trailing spaces from password. strPassword = Trim(strPassword) ' Set global variable and limit password to fixed length of 16 characters. strPC1Password16 = strPassword ' Find and return net length of password. intPasswordLength = Len(strPassword) SetPassword = intPasswordLength End Function Public Function GetPassword() As String ' Get global variable strPC1Password16. GetPassword = RTrim(strPC1Password16) End Function Public Function StrEncrypt(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(False) StrEncrypt = strEncrypted End Function Public Function StrDecrypt(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(False) StrDecrypt = strDecrypted End Function Public Function StrEncryptBin(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(True) StrEncryptBin = strEncrypted End Function Public Function StrDecryptBin(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(True) StrDecryptBin = strDecrypted End Function Private Sub Encrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strDecrypted lngX = Len(strX) strEncrypted = Space(lngX * (2 - Abs(booBinary))) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX c = Asc(mID(strX, lngN, 1)) ' Calculate lngInt. Call Assemble lngC = lngInt \ clngBytMax lngD = lngInt Mod clngBytMax For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM c = c Xor (lngC Xor lngD) If booBinary = False Then ' Build ascii string. d = (c \ clngHexMax) Mod clngHexMax e = c Mod clngHexMax ' clngAscMin + d gives one letter range from a to p for the 4 high bits of c. ' clngAscMin + e gives one letter range from a to p for the 4 low bits of c. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, (lngN * 2) - 1, 1) = Chr(clngAscMin + d) Mid(strEncrypted, (lngN * 2) - 0, 1) = Chr(clngAscMin + e) Else ' Build binary string. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, lngN, 1) = Chr(c) End If Next lngN End Sub Private Sub Decrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strEncrypted lngX = Len(strX) \ (2 - Abs(booBinary)) strDecrypted = Space(lngX) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX If booBinary = False Then d = Asc(mID(strX, (lngN * 2) - 1, 1)) If d >= clngAscMin Then ' Transform the letter to the 4 high bits of c. d = d - clngAscMin If d < clngHexMax Then d = d * clngHexMax End If End If e = Asc(mID(strX, (lngN * 2) - 0, 1)) If e >= clngAscMin Then ' Transform the letter to the 4 low bits of c. e = e - clngAscMin If e < clngHexMax Then c = d + e End If End If Else c = Asc(mID(strX, lngN, 1)) End If ' Calculate lngInt. Call Assemble lngC = (lngInt \ clngBytMax) Mod clngBytMax lngD = lngInt Mod clngBytMax c = c Xor (lngC Xor lngD) For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM ' Perform high speed insertion of decrypted character. Mid(strDecrypted, lngN, 1) = Chr(c) Next lngN End Sub Private Sub Assemble() Dim lngM As Long Dim lngN As Long x1a0(0) = ((cle(1) * clngBytMax) + cle(2)) Mod clngIntMax Call Code lngInt = lngRes For lngM = 1 To (clngHexMax / 2) - 1 lngN = lngM * 2 x1a0(lngM) = x1a0(lngM - 1) Xor ((cle(lngN + 1) * clngBytMax) + cle(lngN + 2)) Call Code lngInt = lngInt Xor lngRes Next lngM i = 0 End Sub Private Sub Code() Const clngKeyB As Long = &H4E35 Const clngKeyC As Long = &H15A dx = (x1a2 + i) Mod clngIntMax ax = x1a0(i) cx = clngKeyC bx = clngKeyB lngTmp = ax ax = si si = lngTmp lngTmp = ax ax = dx dx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax End If lngTmp = ax ax = cx cx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (si Mod clngIntMax)) Mod clngIntMax cx = (ax + cx) Mod clngIntMax End If lngTmp = ax ax = si si = lngTmp ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax dx = (cx + dx) Mod clngIntMax ax = ax + 1 x1a2 = dx x1a0(i) = ax lngRes = ax Xor dx i = i + 1 End Sub John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger From Gustav at cactus.dk Fri Apr 29 10:07:53 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:07:53 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 From jm.hwsn at gmail.com Fri Apr 29 10:14:26 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 10:14:26 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Which is the similar to using the strConv function in Access to store the data in Unicode. It's unreadable but not really secure. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2011 10:08 AM To: accessd at databaseadvisors.com Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:30:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:30:05 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> References: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Message-ID: <4DBAD97D.3030905@colbyconsulting.com> Well... I am thinking it is waaaaay more secure than that. John W. Colby www.ColbyConsulting.com On 4/29/2011 11:14 AM, jm.hwsn wrote: > Which is the similar to using the strConv function in Access to store the > data in Unicode. > It's unreadable but not really secure. > Thanks, > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2011 10:08 AM > To: accessd at databaseadvisors.com > Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit > ordering on the key (and remove the parity bits) before starting the first > round of the non-invertible s-boxes. These are also left-rotated between > each round (by 1 or 2 bits, in a non-regular pattern) to form what is > commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a > code Alexander Pukall designed himself - and which is widely regarded as > insecure. Pukall shouldn't really have chosen the same name as the DES key > schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text > non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From jwcolby at colbyconsulting.com Fri Apr 29 10:36:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:36:16 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBADAF0.7060304@colbyconsulting.com> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From Gustav at cactus.dk Fri Apr 29 10:46:08 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:46:08 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi John Yes, here: http://www.frez.co.uk/vb6.aspx /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:36 >>> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 From jwcolby at colbyconsulting.com Fri Apr 29 11:41:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 12:41:59 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBAEA57.60602@colbyconsulting.com> Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From jm.hwsn at gmail.com Fri Apr 29 11:48:27 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 11:48:27 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4DBAEA57.60602@colbyconsulting.com> References: <4DBAEA57.60602@colbyconsulting.com> Message-ID: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 29 11:53:28 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 18:53:28 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi Jim Sorry, missed that, I have followed this thread with half an eye only. Anyway, the circle is closed! /gustav >>> jm.hwsn at gmail.com 29-04-2011 18:48 >>> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From df.waters at comcast.net Fri Apr 29 11:57:50 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 29 Apr 2011 11:57:50 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB7868C.4080705@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> Message-ID: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> John - how did it go? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility > which will do export to text and import from text of all the objects > except tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or > whatever in one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever >> in one of the forms or report. Even jpegs seem to increase the size >> far too much if one would accidently or otherwise paste a exe, dll, >> wmv or something into a form I'd imagine it would get huge. Check the >> forms and reports over and remove any ole objects or embedded images. >> Then decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >> 1 report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 12:16:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:16:47 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> References: <4DBAEA57.60602@colbyconsulting.com> <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> Message-ID: <4DBAF27F.9030303@colbyconsulting.com> LOL, I wasn't following this thread closely. In fact I only spoke up to recommend the hash method. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:48 PM, jm.hwsn wrote: > That's the site I emailed earlier. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 29, 2011 11:42 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Wow is that awesome! > > Thanks! > > John W. Colby > www.ColbyConsulting.com > > On 4/29/2011 11:46 AM, Gustav Brock wrote: >> Hi John >> >> Yes, here: >> >> http://www.frez.co.uk/vb6.aspx >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> >> Thanks for the heads up on that. Have you by any chance found an > opensource for this that is considered secure? >> >> John W. Colby >> www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 29 12:17:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:17:53 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> Message-ID: <4DBAF2C1.5020007@colbyconsulting.com> Well... I haven't managed to address this yet. The last few days were pure overload. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:57 PM, Dan Waters wrote: > John - how did it go? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > sure. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 1:53 PM, Dan Waters wrote: >> John, >> >> I made and have been testing an essentially one-click access utility >> which will do export to text and import from text of all the objects >> except tables. Do you want to try it? >> >> Dan >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 11:08 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Access 2003 - 50 meg FE >> >> >>> First thing that comes to mind is an ole object - image or >> whatever in one of the forms or report. >> >> Hmm... I do have an activeX control for the IE object. >> >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/26/2011 10:41 AM, John Bartow wrote: >>> First thing that comes to mind is an ole object - image or whatever >>> in one of the forms or report. Even jpegs seem to increase the size >>> far too much if one would accidently or otherwise paste a exe, dll, >>> wmv or something into a form I'd imagine it would get huge. Check the >>> forms and reports over and remove any ole objects or embedded images. >>> Then decompile, compact, compile, compact. >>> >>> If that accomplishes nothing then I'd import it into a new db. >>> >>> Best of luck, >>> John B >>> >>> BTW have you tried running Eatbloat on it? >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Tuesday, April 26, 2011 7:47 AM >>> To: Access Developers discussion and problem solving >>> Subject: [AccessD] Access 2003 - 50 meg FE >>> >>> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >>> 1 report, a handful of classes and modules. >>> >>> The bugger is 50 megs and won't shrink down when I compact / repair. >>> It should probably be a couple of megs. >>> >>> Has anyone run across anything I should be looking at? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Apr 30 09:40:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 30 Apr 2011 10:40:18 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBC1F52.3070807@colbyconsulting.com> I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com From ab-mi at post3.tele.dk Sat Apr 30 12:37:44 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Sat, 30 Apr 2011 19:37:44 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DBC1F52.3070807@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> <4DBC1F52.3070807@colbyconsulting.com> Message-ID: <670A825F36374733BC58BE25C5DFA4F3@abpc> Thanks for the explanation, John. Could you perhaps send me your hash generator offline - I would appreciate much. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 30. april 2011 16:40 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:03:53 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:03:53 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <9FE47E35DFB047C28D1FD535A4A2FE1B@Seven> thx for responding. I could not get that code to work. been a long time since A97 anyone else? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 28, 2011 9:04 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A97 SQL Server It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, > True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:04:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:04:39 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <356F885A526D46519BE17F64C1E07317@Seven> thanks, but no, that did not help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 28, 2011 1:09 PM To: Access Developers discussion and problem solving; 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A97 SQL Server Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, >True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute >"EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 00:00:18 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 31 Mar 2011 22:00:18 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <201103312301.p2VN0u1M028069@databaseadvisors.com> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> Message-ID: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Our clock numbering system was invented by the ancient Symmerians, 3000+ years ago, so why should we change now? It is simple as everything is calculated on 12s and 60s... |-P Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter I remember when New Zealand went metric with its currency back in the '70s. A friend was going overseas and was told by another friend that we were changing over to metric time next and was asked if could he bring back a metric watch. -- Stuart On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > Metric dates...hmm... 10 days per week, then? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > > ______________________________________________________________________ > ______ ___________ > > Note: This e-mail is subject to the disclaimer contained at the bottom > of this message. > ______________________________________________________________________ > ______ ___________ > > > > Hi Rocky, > > To avoid these sort of issues I use dateserial on each and every date > I process in SQL / VBA to make sure they line up correctly. Also from > memory the VBE treats all dates passed in VBA as American format as > default, regardless of the PC's regional setting. Coming from the land > of "dd-mm-yyyy" as standard it is an issue I need to deal with a lot. > > Now, if only you pesky Americans got with the program, used a proper > date format and just swallowed your pride and admit the French were > right and adopt the (far superior) metric system it would make life > for the rest of the planet much easier. ;) > > cheers > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > discussion and problem solving' Subject: Re: [AccessD] Un-American > Date Filter > > Doug: > > When I change the code to > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > And > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > the sql statement still comes out: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate > >= #31/03/2011# AND DueDate <= #07/04/2011# > > And still no date filtering. > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > Hi Rocky: > > I've dealt with this in the past by forcing the date format to > mm/dd/yy in the SQL, something like: > > WHERE DueDate >= Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > Doug > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > wrote: > Dear List: > > I create a temp table > using a SQL statement I construct in code to > incorporate various > filter - one of which is a date filter. > > Works well here but when I > send it to the user in Bahrain who's > regional setting is (I assume > from the screen shot he sent) English > U.K. where the date format is > dd/mm/yyyy it fails. ?I set my regional > settings on my box to U.K. > and sure enough it fails - returns all > records with no date > filtering. > > Here's the SQL statement that creates the table: > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue > ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand ?WHERE DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed to > filter out any record in tblDemand where the Due > Date is outside of > the range March 31 to April 7. ?But it don't. > > When I look in > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > doesn't this work? ?Should I be using some kind of different > syntax > for this filter? > > MTIA > > > Rocky Smolin > > Beach Access Software > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > www.bchacc.com > > > > > > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ______________________________________________________________________ > ______ ___________ > > The information transmitted in this message and its attachments (if > any) is intended only for the person or entity to which it is > addressed. The message may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, > or taking of any action in reliance upon this information, by persons > or entities other than the intended recipient is prohibited. > > If you have received this in error, please contact the sender and > delete this e-mail and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, > disclose or distribute the information contained in this e-mail and > any attached files, with the permission of the sender. > > This message has been scanned for viruses. > ______________________________________________________________________ > ______ ___________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Fri Apr 1 00:10:28 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Fri, 1 Apr 2011 18:10:28 +1300 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: <759994F1FF5140A1B7081212566A9630@HAL9005><201103312301.p2VN0u1M028069@databaseadvisors.com> Message-ID: Rocky, I always convert dates in code to Long. That way it always works regardless of the locale. I find it simpler like that. ... WHERE DueDate >= " & CLng(Me.txtGEDueDate) & " AND DueDate <= " & CLng(Me.txtLEDueDate) Or preferably... ... WHERE DueDate Between " & CLng(Me.txtGEDueDate) & " And " & CLng(Me.txtLEDueDate) Regards Steve -----Original Message----- From: Rocky Smolin Sent: Friday, April 01, 2011 12:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Un-American Date Filter When I change the code to "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" And "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" the sql statement still comes out: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# And still no date filtering. From stuart at lexacorp.com.pg Fri Apr 1 00:30:47 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:30:47 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, , <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> Message-ID: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > From stuart at lexacorp.com.pg Fri Apr 1 00:36:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 01 Apr 2011 15:36:51 +1000 Subject: [AccessD] Un-American Date Filter In-Reply-To: <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> References: <759994F1FF5140A1B7081212566A9630@HAL9005>, <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg>, <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> Message-ID: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Simple - if you have six digits on each hand. or even better five limbs in total with 12 fingers/toes on each. :-) -- Stuart On 31 Mar 2011 at 22:00, Jim Lawrence wrote: > Our clock numbering system was invented by the ancient Symmerians, > 3000+ years ago, so why should we change now? It is simple as > everything is calculated on 12s and 60s... |-P > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Thursday, March 31, 2011 5:08 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Un-American Date > Filter > > I remember when New Zealand went metric with its currency back in the > '70s. > > A friend was going overseas and was told by another friend that we > were changing over to metric time next and was asked if could he bring > back a metric watch. > > -- > Stuart > > > On 31 Mar 2011 at 16:44, Rocky Smolin wrote: > > > Metric dates...hmm... 10 days per week, then? > > > > Rocky > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl > > Collins Sent: Thursday, March 31, 2011 4:01 PM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > > > ____________________________________________________________________ > > __ ______ ___________ > > > > Note: This e-mail is subject to the disclaimer contained at the > > bottom of this message. > > ____________________________________________________________________ > > __ ______ ___________ > > > > > > > > Hi Rocky, > > > > To avoid these sort of issues I use dateserial on each and every > > date I process in SQL / VBA to make sure they line up correctly. > > Also from memory the VBE treats all dates passed in VBA as American > > format as default, regardless of the PC's regional setting. Coming > > from the land of "dd-mm-yyyy" as standard it is an issue I need to > > deal with a lot. > > > > Now, if only you pesky Americans got with the program, used a proper > > date format and just swallowed your pride and admit the French were > > right and adopt the (far superior) metric system it would make life > > for the rest of the planet much easier. ;) > > > > cheers > > Darryl. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > > Smolin Sent: Friday, 1 April 2011 5:35 AM To: 'Access Developers > > discussion and problem solving' Subject: Re: [AccessD] Un-American > > Date Filter > > > > Doug: > > > > When I change the code to > > > > "DueDate >= #" & CDate(Format(Me.txtGEDueDate, "dd/m/yyyy")) & "#" > > > > And > > > > "DueDate <= #" & CDate(Format(Me.txtLEDueDate, "dd/mm/yyyy")) & "#" > > > > the sql statement still comes out: > > > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, > > QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, > > tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE > > DueDate > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > > > And still no date filtering. > > > > R > > > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug > > Steele Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers > > discussion and problem solving Subject: Re: [AccessD] Un-American > > Date Filter > > > > Hi Rocky: > > > > I've dealt with this in the past by forcing the date format to > > mm/dd/yy in the SQL, something like: > > > > WHERE DueDate >= > > Cdate(format(ClientInputDateFrom,"mm/dd/yy"))....etc > > > > Doug > > > > On Thu, Mar 31, 2011 at 10:55 AM, Rocky Smolin > > wrote: > Dear List: > > I create a temp > > table using a SQL statement I construct in code to > incorporate > > various filter - one of which is a date filter. > > Works well here > > but when I send it to the user in Bahrain who's > regional setting > > is (I assume from the screen shot he sent) English > U.K. where the > > date format is dd/mm/yyyy it fails. ?I set my regional > settings on > > my box to U.K. and sure enough it fails - returns all > records with > > no date filtering. > > Here's the SQL statement that creates the > > table: > > INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, > > DueDate, > QuantityDue > ) SELECT tblDemand.PartNumber, > > tblDemand.OrderNumber, > tblDemand.DueDate, tblDemand.QuantityDue > > FROM tblDemand ?WHERE DueDate > > > >= #31/03/2011# AND DueDate <= #07/04/2011# > > which is supposed > > > >to > > filter out any record in tblDemand where the Due > Date is outside > > of the range March 31 to April 7. ?But it don't. > > When I look in > > tblDemand, the dates are displayed properly as dd/mm/yyyy. > > Why > > doesn't this work? ?Should I be using some kind of different > > > syntax for this filter? > > MTIA > > > Rocky Smolin > > Beach Access > > Software > > > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > > > www.bchacc.com > > > > > > > > > > > > -- > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > > http://www.databaseadvisors.com > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > ____________________________________________________________________ > > __ ______ ___________ > > > > The information transmitted in this message and its attachments (if > > any) is intended only for the person or entity to which it is > > addressed. The message may contain confidential and/or privileged > > material. Any review, retransmission, dissemination or other use of, > > or taking of any action in reliance upon this information, by > > persons or entities other than the intended recipient is prohibited. > > > > If you have received this in error, please contact the sender and > > delete this e-mail and associated material from any computer. > > > > The intended recipient of this e-mail may only use, reproduce, > > disclose or distribute the information contained in this e-mail and > > any attached files, with the permission of the sender. > > > > This message has been scanned for viruses. > > ____________________________________________________________________ > > __ ______ ___________ > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:38:39 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:38:39 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: Yes, you bet. In Canada, April Fool's day rules!! Doug On Thu, Mar 31, 2011 at 10:30 PM, Stuart McLachlan wrote: > dd Mmm yyyy .... in sequential order. ?(?) > > You mean "01 Apr 2011" ?comes before "01 Jan 2011" ?in your calendar? > > -- > Stuart > > On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > >> Actually, our government (federal and provincial) uses yyyymmdd which >> sorts as a string, a number or as a date without any translation. The >> other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there >> is never any confusion between month and day...and again everything is >> in sequential order. >> >> Jim >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Fri Apr 1 00:43:16 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 31 Mar 2011 22:43:16 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <4D951742.9055.238CB2F4@stuart.lexacorp.com.pg> <9130994B2E714433A8152E90DD3041F6@creativesystemdesigns.com> <4D956473.5253.24BA3B3C@stuart.lexacorp.com.pg> Message-ID: Well, Jim Lawrence & I are directly in line with the output from Fukushima Daiichi, so that's a distinct possibility for the future. On Thu, Mar 31, 2011 at 10:36 PM, Stuart McLachlan wrote: > Simple - ?if you have six digits on each hand. > > or even better five limbs in total with 12 fingers/toes on each. From davidmcafee at gmail.com Fri Apr 1 09:31:45 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 07:31:45 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> References: <757F90EAE81B4D8587C1948BA52F0E6D@nant> <69BC808F88F94EE6876E6453545100DF@creativesystemdesigns.com> Message-ID: That's how I do it Sent from my Droid phone. On Mar 31, 2011 9:46 PM, "Jim Lawrence" wrote: > How does everyone connect to their data on their SQL server? > > I have never done any other method than by passing parameters and calling > the appropriate SP. Does everyone else actually just send sql strings? > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Thursday, March 31, 2011 3:40 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Un-American Date Filter > > That is, unless the backend may be SQL Server, in which case, the > delimiter is a single quote. We used to run into that issue in .Net, > so we built a function to return the date string formatted with the > correct delimiter depending on which database was in use. Easy enough > to create a function to format any date to US format as well. > > Charlotte Foust > > On Thu, Mar 31, 2011 at 2:58 PM, Shamil Salakhetdinov > wrote: >> Hi Rocky -- > >> Of course date string used in SQL expression in American format should be >> enclosed in a pair of '#' symbols - #04/01/2011# .... >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From accessd at shaw.ca Fri Apr 1 10:47:26 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Fri, 1 Apr 2011 08:47:26 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> References: <759994F1FF5140A1B7081212566A9630@HAL9005> <8BF2D525226E4849A29667C757BEDFB9@creativesystemdesigns.com> <4D956307.29933.24B4AF90@stuart.lexacorp.com.pg> Message-ID: <152C372724D34FF3BA3B91793BA65146@creativesystemdesigns.com> It was a date format for human viewing; a number delimitated by letters and then numbers again...found to be the best standard and for easy reading, because of its symmetry and order. OTOH if given a date like 03/06/11, no one will ever know whether it is referring to the Mar 06 1911 or 03 Jun 1911 or Mar 06 2011 or 03 Jun 2011. Worked on a government project to bring all the old data into the computers. When I left 6 months later they were still working on it. With no standards and mixed formats many dates had to be interpeted by manually going through related files. I understand that people are still working on the project and that was almost 15 years ago. ;-) We know of a friend who is tasked with translating of church records which go back over a thousand years...too bad there were no stanadrds in the parishes. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, March 31, 2011 10:31 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Un-American Date Filter dd Mmm yyyy .... in sequential order. (?) You mean "01 Apr 2011" comes before "01 Jan 2011" in your calendar? -- Stuart On 31 Mar 2011 at 21:54, Jim Lawrence wrote: > Actually, our government (federal and provincial) uses yyyymmdd which > sorts as a string, a number or as a date without any translation. The > other date standard they use is dd Mmm yyyy; ie. 01 May 2011 so there > is never any confusion between month and day...and again everything is > in sequential order. > > Jim > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 1 12:37:43 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 01 Apr 2011 19:37:43 +0200 Subject: [AccessD] Un-American Date Filter Message-ID: Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From davidmcafee at gmail.com Fri Apr 1 13:37:04 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 1 Apr 2011 11:37:04 -0700 Subject: [AccessD] Weird issues with one user Message-ID: I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub From iggy at nanaimo.ark.com Fri Apr 1 16:31:40 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Fri, 01 Apr 2011 13:31:40 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D96443C.9090400@nanaimo.ark.com> Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. From rockysmolin at bchacc.com Fri Apr 1 15:56:51 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 13:56:51 -0700 Subject: [AccessD] Can it be done? In-Reply-To: References: Message-ID: <3E670D818042446CB0D4BC865203BB45@HAL9005> Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 1 16:00:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 1 Apr 2011 14:00:02 -0700 Subject: [AccessD] Un-American Date Filter In-Reply-To: References: Message-ID: <352C74FE2635434CA41704AD49475FAB@HAL9005> Demonstrating once again why I've been on this list for lo these many years. I'm going to be doing a lot of scheduling work for this client over in Bahrain in the coming months - Creating a whole shop floor scheduling and control system for them - very date intensive. "I pity the fool who's not a member of AccessD" - Mr. T. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 01, 2011 10:38 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Un-American Date Filter Hi Rocky et al After all these years it's a surprise to me how much uncertainty, hype, and misunderstandings there seems to be about how to handle dates and SQL. It isn't that difficult and no magic is involved, so please read carefully. The rules are simple but strict and should be followed at all times. No exceptions as there do not exist cases where the rules fall short. First, one has to distinguish between a "date/time value" (of data type Date) and a "string expression for a date/time value" (of data type String). The use of any other data type like Double (the underlying data type of Date) or Long is never needed or may even fail (Long!). In VB(A) data type Date is always what to use: Dim datSomeDateTime As Date datSomeDateTime = Now The only exception is Variant which can be used as (a temporary) data type if Null must be an acceptable value. Dim datSomeDateTime As Date Dim varSomeDateTime As Variant varSomeDateTime = rst!Fields("SomeDateTime") If Not IsNull(varSomeDateTime) Then datSomeDateTime = varSomeDateTime End If String expressions for date/time values are needed only for display of formatted values and for building SQL strings. A. Formatted values are used for: 1. A TextBox if you for some reason prefer not to set the Format property of this (clear the Format property): Me!txtSomeDateTime = Format(Now, "mmm-dd") or used as ControlSource: =Format(Now, "mmm-dd") 2. A recordsource for a Combo/ListBox (where any field not text _will_ be casted to text out of your control): Select *, Format([SomeDateTime], "mmm-dd") From tblSomeTable 3. Some other purposes like export to a text file. B. SQL strings are used in many occasions, mostly for creating dynamic SQL queries. Problem here is that different SQL engines as well as ADO take different formats and delimiters for date/time values. In SQL, date/time values can origin from three sources: 1. Fields of data type Date 2. Functions that return data type Date 3. String expressions Whenever a string expression for a date/time value is needed, the date/time value must be converted by you to a string of a defined format to play safe; if you don't, VB(A) will itself cast the date/time value to text using the local settings of Windows, which means you are out of control and your code will fail sooner or later. As to which format to use, it is all about avoiding any possible trap. Here are some typical formats and why not to use them: dd/mm/yyyy - will fail in most cases mm/dd/yyyy - accepted by most engines but will fail in ADO (FindFirst) yyyymmdd - will fail for some engines and anywhere in Access dd-mmm-yy and any other format using literal months - will fail in non-English environments That leaves this single unambiguous format - the ISO format - which will never fail: yyyy/mm/dd (or yyyy-mm-dd, doesn't normally matter) Further, and maybe for the reason to be safe, this _is_ the preferred and recommended format for SQL Server. Thus, there really is no reason to use any other format than this. So, some examples: 1. strSQL = "Select tblA.*, tblB.* From tblA, tblB Where A.[SomeDateField]=B.[SomeDateField];" 2. strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateAdd('d',-8,B.[SomeDateField]);" strSQL = "Select tblA.* From tblA, tblB Where A.[SomeDateField]=DateSerial(" & intYear & "," & intMonth & "," & intDay & ");" 3. strDate = Format(DateAdd("d", -8, Date), "yyyy\/mm\/dd") For Access SQL: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & strDate & "#"; For SQL Server and many other engines: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]='" & strDate & "'"; One important additional note is about fetching values from a TextBox. If this is either bound to a field of data type Date or has been applied a Format property as a date, it will return a value of data type Date. Further, a typed in date _will_ be read according to the local settings of Windows even if these differ from the Format property setting. Thus, the Format property setting has no influence of the value returned. It is only when the TextBox has focus and if you then read the Text property of the TextBox you will have the displayed string returned. This means that the value of such a TextBox can safely (except for Null) be passed to a date/time variable: datSomDateValue = Forms!frmSomeForm!txtSomeDate or to be explicit: datSomDateValue = Forms!frmSomeForm!txtSomeDate.Value This also means that this will never fail (except for Null values or if the form is closed): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= Forms.frmSomeForm.txtSomeDate"; However, this may fail because the date value is casted according to the local settings: strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Forms!frmSomeForm!txtSomeDate & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & datSomeDateValue & "#"; This will not fail in Access SQL (for most other engines replace # with single quote): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= #" & Format(Forms!frmSomeForm!txtSomeDate, "yyyy\/mm\/dd") & "#"; But this may fail (because the date/time values will be casted to text out of your control): strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= DateValue(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & DateValue(Forms!frmSomeForm!txtSomeDate) & "#"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]= CDate(" & Forms!frmSomeForm!txtSomeDate & ")"; strSQL = "Select tblA.* From tblA Where A.[SomeDateField]=#" & CDate(Forms!frmSomeForm!txtSomeDate) & "#"; It also means that - regarding the topic - this doesn't make sense because Forms.frmSomeForm.txtSomeDate already is of data type Date: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) What happens is that first Forms.frmSomeForm.txtSomeDate is casted to a string - because that is what DateValue expects - then casted by DateValue to data type Date. Back and forth. What you will obtain, however, by this method is that a possible time part of Forms!frmSomeForm!txtSomeDate will be stripped. This makes no sense at all as it converts a date/time to a date/time: datSomeDateTime = CDate(Forms!frmSomeForm!txtSomeDate) The only reason for using: datSomeDateTime = DateValue(Forms!frmSomeForm!txtSomeDate) would be the rare case where the TextBox is neither bound to a date/time field nor formatted as a date/time - thus returning a value of data type Text - allowing the user to input a date as text in free style. Happy Dating! /gustav >>> rockysmolin at bchacc.com 31-03-2011 19:55 >>> Dear List: I create a temp table using a SQL statement I construct in code to incorporate various filter - one of which is a date filter. Works well here but when I send it to the user in Bahrain who's regional setting is (I assume from the screen shot he sent) English U.K. where the date format is dd/mm/yyyy it fails. I set my regional settings on my box to U.K. and sure enough it fails - returns all records with no date filtering. Here's the SQL statement that creates the table: INSERT INTO tblKittingToMIS ( PartNumber, OrderNumber, DueDate, QuantityDue ) SELECT tblDemand.PartNumber, tblDemand.OrderNumber, tblDemand.DueDate, tblDemand.QuantityDue FROM tblDemand WHERE DueDate >= #31/03/2011# AND DueDate <= #07/04/2011# which is supposed to filter out any record in tblDemand where the Due Date is outside of the range March 31 to April 7. But it don't. When I look in tblDemand, the dates are displayed properly as dd/mm/yyyy. Why doesn't this work? Should I be using some kind of different syntax for this filter? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Fri Apr 1 16:03:15 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Fri, 1 Apr 2011 14:03:15 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: References: Message-ID: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Hi David, A couple of suggestions that might help you determine if your Modal idea is in fact the problem. In form frm_002D_Company open event try setting focus to an enabled control, this should bring it to the front. Since you you have a parameter declared to pass the name of the calling form, perhaps you could add code to hide the calling form in the on load or on open event of frm_002D_Company and then un hide it on form close. HTH Bill -------------------------------------------------- From: "David McAfee" Sent: Friday, April 01, 2011 11:37 AM To: "Access Developers discussion and problem solving" Subject: [AccessD] Weird issues with one user I've been struggling with this issue for the last couple of days and it is driving me nuts. The user didn't have problems until they were given a newer computer. The computer has Vista as the OS and Access2007. I have some forms that were originally created in Access 2000, and another created in (I believe Access 2003). Now that they have the new computer, when the user clicks on cmdLocationAdd (or Edit), Access seems to lock up. What I believe is happening is that the form 002D is opening up in modal mode, but not on top of the form that is calling it. I can't recreate it on my machine (also a Vista box with A2007). I checked our references and they both match: Visual Basic for Applications Microsoft Access 12.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library Microsoft DAO 3.6 Object Library Any ideas? Here are the related subs: The A2003 calls a form on an OnClick event: Private Sub cmdLocationAdd_Click() Dim strOpenArgs As String strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & Me.lstCompaniesFound.Column(1) 'Debug.Print strOpenArgs DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return Form | Return Field | CompanyName End Sub Private Sub cmdLocationEdit_Click() Dim strOpenArgs As String 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & Me.lstCompaniesFound.Column(1) '2 = Edit DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs Me.lstCompanyLocations.Requery End Sub Private Sub Form_Load() On Error GoTo Form_Load_Error 'Dim errNum As Double, errDesc As String, errLine As Integer If Not IsNull(Me.OpenArgs) Then Dim arrX As Variant arrX = Split(Me.OpenArgs, "|") intMode = arrX(0) Select Case intMode Case 1 'Add Mode Me.txtCompanyID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Addition" Me.Caption = "New Address Entry" 'Hide listbox & cmd button as we don't have an AddressID yet Me.lstAddtionalInfo.Visible = False Me.cmdAddAddtionalInfo.Visible = False Me.cmdEditAddtionalInfo.Visible = False Me.cmdDelAddtionalInfo.Visible = False ' Show fields below, so we can write to the appropriate fields when we append this record Me.txtPhone.Visible = True Me.txtfax.Visible = True Me.txtemail.Visible = True Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") Case 2 'Edit Mode Me.txtAddrID = arrX(1) Me.txtCompanyName = Nz(arrX(4), "") Me.cmdOK.Caption = "Confirm Edit" Me.Caption = "Company Address Edit" 'Show listbox & cmd button as we now have an AddressID Me.lstAddtionalInfo.Visible = True Me.cmdAddAddtionalInfo.Visible = True Me.cmdEditAddtionalInfo.Visible = True Me.cmdDelAddtionalInfo.Visible = True 'No need to show these fields as we have the listbox available Me.txtPhone.Visible = False Me.txtfax.Visible = False Me.txtemail.Visible = False FillAddress (Me.txtAddrID) 'Fill Phone/fax/email info: Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " & Me.txtAddrID Case Else 'Trap code removed End Select strReturnForm = arrX(2) 'Parameter 3, the form that we will return the data to strReturnField = arrX(3) 'Parameter 4, the field in the above form that data will return to Else 'Do stuff when opened without OpenArgs End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 1 16:06:29 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:06:29 -0500 Subject: [AccessD] Can it be done? In-Reply-To: <3E670D818042446CB0D4BC865203BB45@HAL9005> References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Glad it worked perfectly for you! That's what I like to hear about my sample systems. ;) I wonder if MS ever looked at it. Years ago this came up, it was Susan that wanted it, because she was copying and pasting data from the web into an Access form, and wanted the form to always be on top. MS's knowledge base had an article using a form timer... I submitted my solution to them, never heard back. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 01, 2011 3:57 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Can it be done? Drew: Thanks so much for the demo. It worked perfectly. My client will be ecstatic. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, March 31, 2011 11:21 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Yes, I'm sending you my 'always on top' demo off list. You can do this with a timer, which is ugly, and pointless. Access forms are subclassed windows, which make them act a little different than regular windows. For a regular window, setting the ZOrder to -1 will put it on top of other windows. With an access form, you set the ZOrder to -1 for the Access window itself, and then hide the Access window. Then the visible 'popup' form is on top of everything on your desktop. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, March 31, 2011 12:43 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Can it be done? Dear List: A client - has a law firm - wants a pop up form on an existing time keeping form with ten buttons that would be assigned to various clients and legal matters. So when they click a button, the timer changes from the current matter to the one assigned to that button and starts running the clock for the new matter. No problem. But he says he also wants that pop up form to be on top when a lawyer is working on a word doc or other application so that they can switch their timekeeping clock from one matter to another without having to go back to the access app to do it since they may have 10 or fifteen windows open and finding the access app would be awkward for them. I guess if a lawyer is working on a matter and the phone rings they'd want to change the timer from the current matter to the one on the phone - things like that. Anyway, can this be done? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From ssharkins at gmail.com Fri Apr 1 16:19:00 2011 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 1 Apr 2011 17:19:00 -0400 Subject: [AccessD] Can it be done? References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > From DWUTKA at Marlow.com Fri Apr 1 16:21:40 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 1 Apr 2011 16:21:40 -0500 Subject: [AccessD] Can it be done? In-Reply-To: References: <3E670D818042446CB0D4BC865203BB45@HAL9005> Message-ID: That is true, we did! LOL. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, April 01, 2011 4:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Can it be done? Well, we did end up writing about it, so there's that. :) Susan H. > Glad it worked perfectly for you! That's what I like to hear about my > sample systems. ;) > > I wonder if MS ever looked at it. Years ago this came up, it was Susan > that wanted it, because she was copying and pasting data from the web > into an Access form, and wanted the form to always be on top. MS's > knowledge base had an article using a form timer... I submitted my > solution to them, never heard back. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From df.waters at comcast.net Fri Apr 1 16:24:59 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 1 Apr 2011 16:24:59 -0500 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> References: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <007301cbf0b3$41e65f20$c5b31d60$@comcast.net> Boy do I agree with this! I only occasionally create a pivot query. So, I just start with one I've already done and keep tweaking it until it does what I want. It's the fastest way for me. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Friday, April 01, 2011 4:32 PM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 1 23:54:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 00:54:06 -0400 Subject: [AccessD] Word document merge Message-ID: <4D96ABEE.3050501@colbyconsulting.com> I am setting up a word document merge. The document has a "parent / child" or parent / detail format. This is a state document and it needs to look like they give it to me. FName LName From date From time From time From date From time From time From date From time From time Pickup time Return time Signature The form has room for three date time parts, the rest is just once per document. Is this possible with Mail Merge? Do I need to "automate" this by pushing the data into it a field at a time? The form will be filled out and printed, then faxed - or printed to a fax printer. On that note, can I insert a signature picture somehow? TIA for any assistance in this. -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Sat Apr 2 00:11:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 02 Apr 2011 15:11:55 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D96ABEE.3050501@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com> Message-ID: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Are these "one-off" documents, or do you process several in one run? -- Stuart On 2 Apr 2011 at 0:54, jwcolby wrote: > I am setting up a word document merge. The document has a "parent / > child" or parent / detail format. This is a state document and it > needs to look like they give it to me. > > FName LName > > From date From time From time > From date From time From time > From date From time From time > > Pickup time Return time > > Signature > > The form has room for three date time parts, the rest is just once per > document. > > Is this possible with Mail Merge? Do I need to "automate" this by > pushing the data into it a field at a time? > > The form will be filled out and printed, then faxed - or printed to a > fax printer. > > On that note, can I insert a signature picture somehow? > > TIA for any assistance in this. > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 09:48:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 10:48:54 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com> <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg> Message-ID: <4D973756.2030605@colbyconsulting.com> Stuart, > Are these "one-off" documents, or do you process several in one run? I am starting to check inmates out of the local camp for AA meetings, church and the like. This is the checkout document that I have to fill out for each time I check someone out. So I will be filling out a checkout parent/child recordset for each inmate for each time I will check them out. I can never check out more than three inmates at a time, so I might fill out for one inmate for church, and two for an AA meeting on Tuesday. Like that. Actually I eventually figured it out. I am using bookmarks and inserting data in the bookmarks. I think the way it will work is that I will have a button on the form where I fill out the data. fill one "checkout", print it, do the next, print it. I have to sign these and then fax them to the prison. I would like to eventually have a signature gif which I insert into the document, and eventually fax them straight out of my machine. John W. Colby www.ColbyConsulting.com On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > Are these "one-off" documents, or do you process several in one run? > From stuart at lexacorp.com.pg Sat Apr 2 09:57:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 03 Apr 2011 00:57:24 +1000 Subject: [AccessD] Word document merge In-Reply-To: <4D973756.2030605@colbyconsulting.com> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> Message-ID: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) Do you need to insert the signature at print time, or can you just put it in the blank template document? I generally do the latter. -- Stuart On 2 Apr 2011 at 10:48, jwcolby wrote: > Stuart, > > > Are these "one-off" documents, or do you process several in one > run? > > I am starting to check inmates out of the local camp for AA meetings, > church and the like. This is the checkout document that I have to > fill out for each time I check someone out. So I will be filling out > a checkout parent/child recordset for each inmate for each time I will > check them out. I can never check out more than three inmates at a > time, so I might fill out for one inmate for church, and two for an AA > meeting on Tuesday. Like that. > > Actually I eventually figured it out. I am using bookmarks and > inserting data in the bookmarks. I think the way it will work is that > I will have a button on the form where I fill out the data. fill one > "checkout", print it, do the next, print it. > > I have to sign these and then fax them to the prison. I would like to > eventually have a signature gif which I insert into the document, and > eventually fax them straight out of my machine. > > John W. Colby > www.ColbyConsulting.com > > On 4/2/2011 1:11 AM, Stuart McLachlan wrote: > > Are these "one-off" documents, or do you process several in one run? > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 2 10:20:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:20:47 -0400 Subject: [AccessD] Word document merge In-Reply-To: <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> References: <4D96ABEE.3050501@colbyconsulting.com>, <4D96B01B.29394.29C9C656@stuart.lexacorp.com.pg>, <4D973756.2030605@colbyconsulting.com> <4D973954.18184.2BE1D2BF@stuart.lexacorp.com.pg> Message-ID: <4D973ECF.7070301@colbyconsulting.com> Well... I am intending to share the app so "at print time" is the best solution. John W. Colby www.ColbyConsulting.com On 4/2/2011 10:57 AM, Stuart McLachlan wrote: > That was exactly what I was going to suggest if it wasn't a long mailmerge run :-) > > Do you need to insert the signature at print time, or can you just put it in the blank template > document? I generally do the latter. > From jwcolby at colbyconsulting.com Sat Apr 2 10:37:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 11:37:07 -0400 Subject: [AccessD] datatype Time(7) precision Message-ID: <4D9742A3.8050002@colbyconsulting.com> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. -- John W. Colby www.ColbyConsulting.com From iggy at nanaimo.ark.com Sat Apr 2 11:55:30 2011 From: iggy at nanaimo.ark.com (Tony Septav) Date: Sat, 02 Apr 2011 08:55:30 -0800 Subject: [AccessD] Pivot Tables Message-ID: <4D975502.6050102@nanaimo.ark.com> Hey All This is incredible if it wasn't so sad. Been fooling around with the Pivot Tables in Access 2003. I had originally installed the OCW11.dll for Access 2003 in the reference library. Finally found Microsoft's "Programming Pivot Table Reports in Access 2002." All the goodies for programmatically controlling the Pivot Table with Access VBA. Spent the last couple of hours trying their examples. Some worked fine, with others part of it would work other parts wouldn't and with some the examples it just crashed (type mismatch, this property can't be used with this object etc. etc. etc.). Farted around trying to figure out what it was I was doing wrong. Finally the "DUH" light went on, I noticed the Dim Pivot Table properties were preceded with OWC10, eg. Pt as OCW10.PivotTable I had changed these to OCW11. I switched to the OCW10.dll for Access 2002 and changed the OCW11 back to OCW10, and low and behold eveything worked beautifully. Who in they right mind would provide something like this to the developer, without a warning, I am baffled. The time I have wasted over the last couple of days I could have by now designed my own pseudo pivot table. Hey Zeus!!!! From gustav at cactus.dk Sat Apr 2 11:49:59 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 02 Apr 2011 18:49:59 +0200 Subject: [AccessD] datatype Time(7) precision Message-ID: Hi John That should influence the fractions of a second only: http://msdn.microsoft.com/en-us/library/bb677243.aspx Specifies the number of digits for the fractional part of the seconds. This can be an integer from 0 to 7. The default fractional precision is 7 (100ns). As Access out of the box doesn't support fractions of seconds, you must be facing another issue. /gustav >>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07 >>> What does the (7) really mean? Is it possible to manipulate that number to determine how many seconds / milliseconds etc that SQL server is expecting to be entered? Im am trying to enter time in Access and I am currently required to enter the seconds part hh:mm:ss 08:00:00 If I don't enter the seconds SQL Server complains as I try to store the field. From jwcolby at colbyconsulting.com Sat Apr 2 13:19:14 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 02 Apr 2011 14:19:14 -0400 Subject: [AccessD] datatype Time(7) precision In-Reply-To: References: Message-ID: <4D9768A2.7000105@colbyconsulting.com> As it turns out, it is a driver issue. Using vanilla ODBC rather than the native SQL Server causes the (data entry) issue to go away. John W. Colby www.ColbyConsulting.com On 4/2/2011 12:49 PM, Gustav Brock wrote: > Hi John > > That should influence the fractions of a second only: > > http://msdn.microsoft.com/en-us/library/bb677243.aspx > Specifies the number of digits for the fractional part of the seconds. > This can be an integer from 0 to 7. > The default fractional precision is 7 (100ns). > > As Access out of the box doesn't support fractions of seconds, you must be facing another issue. > > /gustav > > >>>> jwcolby at colbyconsulting.com 02-04-2011 17:37:07>>> > What does the (7) really mean? Is it possible to manipulate that number to determine how many > seconds / milliseconds etc that SQL server is expecting to be entered? > > Im am trying to enter time in Access and I am currently required to enter the seconds part > > hh:mm:ss > > 08:00:00 > > If I don't enter the seconds SQL Server complains as I try to store the field. > > > From gustav at cactus.dk Sun Apr 3 07:45:20 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 03 Apr 2011 14:45:20 +0200 Subject: [AccessD] Rapid Application Development: LightSwitch Beta 2 Message-ID: Hi all Here is a better, though still brief, introduction to the new beta: http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/threads Click at the top under Announcements the topic: Visual Studio LightSwitch Beta 2 Released with Go Live License! .. We'd also like to announce that Beta 2 comes with a "Go Live" license which means you can now start using Visual Studio LightSwitch for production projects /gustav >>> gustav at cactus.dk 03-04-2011 11:07 >>> Hi members of "VS2010 SP1 club" Then those interested in true RAD may proceed obtaining the recent LightSwitch Beta 2 which requires VS2010 SP1: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=cff6c4ef-a29a-4c82-9a59-8a3bbb65ec3d The Beta 1 must be uninstalled first. Apart from many minor improvements "too numerous to mention" as the team tells, an interesting new feature is direct deployment to Windows/SQL Azure. Also, the Visual Studio LightSwitch Beta 2 Training Kit: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=AC1D8EB5-AC8E-45D5-B1E3-EFB8E4E3EBD1 /gustav >>> shamil at smsconsulting.spb.ru 02-04-2011 16:26:55 >>> Hi Gustav at al, <<< So I did and ran the SP1 again. This time - as everything was downloaded - it took about an hour to finish. >>> Yes, I have also got to the "VS2010 SP1 club" today. :) Setup went smoothly and took a bit more than an hour.... Thank you. -- Shamil From rockysmolin at bchacc.com Sun Apr 3 10:05:52 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sun, 3 Apr 2011 08:05:52 -0700 Subject: [AccessD] Solution in Search of a Problem Message-ID: I got a .pages file from a friend and, of course, couldn't open it. It was made on a (shudder) Mac. I got this tip from the web, though on opening it. Save the .pages file, change the extension to .zip, double click to unzip. In the zip file there will be a file called preview.pdf which will be the .pages doc converted to pdf. Walla! Rocky From Darryl.Collins at iag.com.au Sun Apr 3 20:02:54 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Mon, 4 Apr 2011 11:02:54 +1000 Subject: [AccessD] Pivot Tables In-Reply-To: <4D96443C.9090400@nanaimo.ark.com> Message-ID: <201104040103.p34133uS024641@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Pivot tables in Access are so insipid and fiddly that almost anyone who needs to use PTs seriously end up using Excel anyway, and either hooks Excel into the database or pushes the source out of the database into an Excel workbook / template which then automatically produces the PT using code. Best of both world then. Excel's PT ability is far superior to what is native in Access. My advice would be that using Excel is still the better approach. Of course your milage may vary depending on what you want to do. Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Saturday, 2 April 2011 8:32 AM To: Access Developers discussion and problem solving Subject: [AccessD] Pivot Tables Hey All I have been fooling around with Pivot Tables, got everythng working. But........ After many hours of research, I have not experienced a more convulted description of how to programatically do things with ACCESSand Pivot Tables, properties, objects etc. when dealing with the Pivot Table. I can find tons of EXCEL examples but when you try out the examples they do not work in ACCESS. It is like MS said "Here you go, here is a new feature, but don't bother us, if you run into problems". If anyone has a good source of information for Pivot Tables and ACCESS (programming with VBA) could you please let me know. Thanks Kindly. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From rusty.hammond at cpiqpc.com Mon Apr 4 10:02:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 4 Apr 2011 10:02:44 -0500 Subject: [AccessD] Windows Terminal Services and RemoteApp - nice Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE117@CPIEMAIL-EVS1.CPIQPC.NET> A nice little introduction to Windows terminal services and the newer RemoteApp feature from FMS. Gives the ability to connect to a Terminal Server session and only show the app(s) you want the user to see. http://www.fmsinc.com/MicrosoftAccess/terminal-services/remoteapp.htm Rusty Hammond IT Dept. - B-20 Senior Developer CPI Qualified Plan Consultants, Inc. (620) 793-8473 ext. 416 rusty.hammond at cpiqpc.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From bheygood at abestsystems.com Mon Apr 4 14:06:54 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:06:54 -0700 Subject: [AccessD] datatype Time(7) precision In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <8BC8D7BC2C9840278F464D0A8CF5B340@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:08:37 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:08:37 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From bheygood at abestsystems.com Mon Apr 4 14:09:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 12:09:01 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: <4D9768A2.7000105@colbyconsulting.com> References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <0D38443FD37B4E6AAF674630AD1040E7@Seven> Good Morning, I have always been successful in mapping one of my folders on a local drive to appear as a drive (example: M:\). Now with Win 7, I have had no luck in writing and sometimes reading the resulting mapped drive. I am pretty sure it has to do with some aspect of user/admin rights. But when I change and modify the properties of the mapped drive, I still am not able to use it. It's very important as I, like most of you, need to replicate a clients setup so as not to have to redo links and other operations. Like Barry found out (libraries), I am sure that this is another instance of MS protecting us from ourselves. ????s What is the secret to this ? Best, Bob Heygood From davidmcafee at gmail.com Mon Apr 4 14:58:26 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 4 Apr 2011 12:58:26 -0700 Subject: [AccessD] Weird issues with one user In-Reply-To: <5F016B3563E9447A81D7A3AFE217A357@BPCS> References: <5F016B3563E9447A81D7A3AFE217A357@BPCS> Message-ID: I added the set focus. I also noticed that AutoCenter was off, so I turned that on. I put out an update and the user said that it worked, so I'm not sure which one fixed it, but it is fixed. Thanks. David On Fri, Apr 1, 2011 at 2:03 PM, Bill Patten wrote: > Hi David, > > A couple of suggestions that might help you determine if your Modal idea is > in fact the problem. > > In form frm_002D_Company open event try setting focus to an enabled > control, this should bring it to the front. > > Since you you have a parameter declared to pass the name of the calling > form, perhaps you could add code to hide the calling form in the on load or > on open event > of frm_002D_Company and then un hide it on form close. > > HTH > > > Bill > -------------------------------------------------- > From: "David McAfee" > Sent: Friday, April 01, 2011 11:37 AM > To: "Access Developers discussion and problem solving" > > Subject: [AccessD] Weird issues with one user > > I've been struggling with this issue for the last couple of days and it is > driving me nuts. > > The user didn't have problems until they were given a newer computer. > The computer has Vista as the OS and Access2007. > > I have some forms that were originally created in Access 2000, and another > created in (I believe Access 2003). > > Now that they have the new computer, when the user clicks on cmdLocationAdd > (or Edit), Access seems to lock up. > > What I believe is happening is that the form 002D is opening up in modal > mode, but not on top of the form that is calling it. > > I can't recreate it on my machine (also a Vista box with A2007). > > I checked our references and they both match: > > Visual Basic for Applications > Microsoft Access 12.0 Object Library > OLE Automation > Microsoft ActiveX Data Objects 2.1 Library > Microsoft DAO 3.6 Object Library > > Any ideas? > > Here are the related subs: > > > The A2003 calls a form on an OnClick event: > > Private Sub cmdLocationAdd_Click() > Dim strOpenArgs As String > strOpenArgs = "1|" & Me.lstCompaniesFound.Column(0) & "|||" & > Me.lstCompaniesFound.Column(1) > 'Debug.Print strOpenArgs > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > 'frm_002D_Company's opening Args are: Mode | CompanyID or AddrID | Return > Form | Return Field | CompanyName > End Sub > > Private Sub cmdLocationEdit_Click() > Dim strOpenArgs As String > 'frm_002D_Company's opening Args are: Mode | AddrID | null | null | null | > strOpenArgs = "2|" & Me.lstCompanyLocations.Column(1) & "|||" & > Me.lstCompaniesFound.Column(1) '2 = Edit > DoCmd.OpenForm "frm_002D_Company", , , , , acDialog, strOpenArgs > Me.lstCompanyLocations.Requery > End Sub > > > Private Sub Form_Load() > On Error GoTo Form_Load_Error > 'Dim errNum As Double, errDesc As String, errLine As Integer > > If Not IsNull(Me.OpenArgs) Then > Dim arrX As Variant > arrX = Split(Me.OpenArgs, "|") > intMode = arrX(0) > Select Case intMode > Case 1 'Add Mode > Me.txtCompanyID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Addition" > Me.Caption = "New Address Entry" > 'Hide listbox & cmd button as we don't have an AddressID yet > Me.lstAddtionalInfo.Visible = False > Me.cmdAddAddtionalInfo.Visible = False > Me.cmdEditAddtionalInfo.Visible = False > Me.cmdDelAddtionalInfo.Visible = False > ' Show fields below, so we can write to the appropriate fields > when we append this record > Me.txtPhone.Visible = True > Me.txtfax.Visible = True > Me.txtemail.Visible = True > > Me.txtLocationName = Nz(Me.txtLocationName, "Main Office") > Case 2 'Edit Mode > Me.txtAddrID = arrX(1) > Me.txtCompanyName = Nz(arrX(4), "") > Me.cmdOK.Caption = "Confirm Edit" > Me.Caption = "Company Address Edit" > 'Show listbox & cmd button as we now have an AddressID > Me.lstAddtionalInfo.Visible = True > Me.cmdAddAddtionalInfo.Visible = True > Me.cmdEditAddtionalInfo.Visible = True > Me.cmdDelAddtionalInfo.Visible = True > 'No need to show these fields as we have the listbox available > Me.txtPhone.Visible = False > Me.txtfax.Visible = False > Me.txtemail.Visible = False > FillAddress (Me.txtAddrID) > 'Fill Phone/fax/email info: > Me.lstAddtionalInfo.RowSource = "EXEC stp_002DFillCompanyInfo " > & Me.txtAddrID > Case Else > 'Trap code removed > End Select > strReturnForm = arrX(2) 'Parameter 3, the form that we will return the > data to > strReturnField = arrX(3) 'Parameter 4, the field in the above form that > data will return to > Else > 'Do stuff when opened without OpenArgs > End If > > End Sub > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Mon Apr 4 15:20:51 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 13:20:51 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a local > drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading the > resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I still am > not able to use it. > > It's very important as I, like most of you, need to replicate a clients > setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another instance of > MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 16:05:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:05:45 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: References: , , Message-ID: <4D9A32A9.25393.377FC767@stuart.lexacorp.com.pg> I agree with Charlotte completely. That's exactly what I do. Use UNC paths, not mappings, store your development and production paths somewhere in te FE and include a re-link procress to switch between development and production BEs. Triggering the rellink can be controlled in all sorts of ways, including fully automated by checking the location of the FE on startup. -- Stuart On 4 Apr 2011 at 13:20, Charlotte Foust wrote: > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a local > drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading the > resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I still am > not able to > use it. > > It's very important as I, like most of you, need to > replicate a clients > setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another instance of > MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheygood at abestsystems.com Mon Apr 4 16:24:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Mon, 4 Apr 2011 14:24:39 -0700 Subject: [AccessD] Mapped Drive In-Reply-To: References: <4D9768A2.7000105@colbyconsulting.com> Message-ID: <41760139BA5C46879CDDA9E6D324546D@Seven> Thanks for the response. The client is dictating which drive I have to use. Yes, I tried to set some looser permissions from the properties dialog. Lately sometimes it "sticks" and the changes I made are there next time I check. And sometimes not. Irregardless, I can't write to files in that folder. Error = You do not have permissions..... -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Mapped Drive Frankly, I think you would be better off providing for a means storing whatever location the program is in and using a pointer to that location in your code. I can guarantee that somewhere along the way, a single user will have already mapped the drive you want to use in such a way that your mapping will break on their end too. I'm not clear on whether you set mapping to M:\ in Win 7 and then set the user permissions on the mapped drive from the security tab of the Properties dialog of the mapped drive or not. On your own machine you can create a shortcut the run the access app as administrator, which should give you permissions to the mapped drive as well. Are you saying that doesn't work reliably? And is this SP1 or vanilla Win 7? Charlotte Foust On Mon, Apr 4, 2011 at 12:08 PM, b heygood wrote: > ?Good Morning, > > ? I have always been successful in mapping one of my folders on a > local drive to appear as a drive (example: M:\). > > Now with Win 7, I have had no luck in writing and sometimes reading > the resulting mapped drive. > > I am pretty sure it has to do with some aspect of user/admin rights. > > But when I change and modify the properties of the mapped drive, I > still am not able to use it. > > It's very important as I, like most of you, need to replicate a > clients setup so as not to have to redo links and other operations. > > Like Barry found out (libraries), I am sure that this is another > instance of MS protecting us from ourselves. > > ?????s > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Mon Apr 4 16:31:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 07:31:38 +1000 Subject: [AccessD] Mapped Drive In-Reply-To: <41760139BA5C46879CDDA9E6D324546D@Seven> References: , , <41760139BA5C46879CDDA9E6D324546D@Seven> Message-ID: <4D9A38BA.25221.37977B2B@stuart.lexacorp.com.pg> Permissions on a folder are whihcever are the more severe between direct and shared. You need to set appropriate permissions on the actual folder in Explorer as well in the Sharing dialog. -- Stuart On 4 Apr 2011 at 14:24, b heygood wrote: > Thanks for the response. > The client is dictating which drive I have to use. > > Yes, I tried to set some looser permissions from the properties > dialog. Lately sometimes it "sticks" and the changes I made are there > next time I check. And sometimes not. Irregardless, I can't write to > files in that folder. Error = You do not have permissions..... > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust Sent: Monday, April 04, 2011 1:21 PM To: Access Developers > discussion and problem solving Subject: Re: [AccessD] Mapped Drive > > Frankly, I think you would be better off providing for a means storing > whatever location the program is in and using a pointer to that > location in your code. I can guarantee that somewhere along the way, > a single user will have already mapped the drive you want to use in > such a way that your mapping will break on their end too. > > I'm not clear on whether you set mapping to M:\ in Win 7 and then set > the user permissions on the mapped drive from the security tab of the > Properties dialog of the mapped drive or not. On your own machine you > can create a shortcut the run the access app as administrator, which > should give you permissions to the mapped drive as well. Are you > saying that doesn't work reliably? And is this SP1 or vanilla Win 7? > > Charlotte Foust > > > > On Mon, Apr 4, 2011 at 12:08 PM, b heygood > wrote: > ?Good Morning, > > ? I have always been successful in mapping > one of my folders on a > local drive to appear as a drive (example: > M:\). > > Now with Win 7, I have had no luck in writing and sometimes > reading > the resulting mapped drive. > > I am pretty sure it has to > do with some aspect of user/admin rights. > > But when I change and > modify the properties of the mapped drive, I > still am not able to > use it. > > It's very important as I, like most of you, need to > replicate a > clients setup so as not to have to redo links and other > operations. > > Like Barry found out (libraries), I am sure that this > is another > instance of MS protecting us from ourselves. > > ?????s > > > ?What is the secret to this ? > > Best, > > Bob Heygood > > -- > > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 17:54:16 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 18:54:16 -0400 Subject: [AccessD] Error 3027 Message-ID: <000001cbf31b$3b72b1b0$b2581510$@com> Hello, I wanted to fill a Query with AddNew and Update. But I get the error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." What can I do to fix this problem? TIA. Saludos Actuary Ralf Lister La Paz, Bolivia From stuart at lexacorp.com.pg Mon Apr 4 18:04:12 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:04:12 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000001cbf31b$3b72b1b0$b2581510$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> Message-ID: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Hard to say without seeing the query, but a common reason for a query being RO is that it doesn't include the PK of the table you are trying to update. -- Stuart On 4 Apr 2011 at 18:54, Ralf Lister wrote: > Hello, > > > > I wanted to fill a Query with AddNew and Update. But I get the error > message " Error 3027 at run time./ You can't update. The database a/o > object is "read only"." What can I do to fix this problem? > > > > TIA. > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 18:06:06 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 11:06:06 +1200 Subject: [AccessD] Archives Down Message-ID: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From charlotte.foust at gmail.com Mon Apr 4 18:24:28 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 4 Apr 2011 16:24:28 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Mon Apr 4 18:49:34 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 09:49:34 +1000 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com>, <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg>, Message-ID: <4D9A590E.11612.3815C21C@stuart.lexacorp.com.pg> I assumed that the query was the source of a DAO.recordset in VBA. But I was wrong once before, it's conceivable that I am again. -- Stuart On 4 Apr 2011 at 16:24, Charlotte Foust wrote: > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From rlister at actuarial-files.com Mon Apr 4 19:42:32 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Mon, 4 Apr 2011 20:42:32 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> Message-ID: <000501cbf32a$5b411900$11c34b00$@com> Thank you all for your help. Charlotte, I`m gathering information data about one person, make some calculations and save this calculations in the fields of a query by Set dbs = CurrentDb Set rst = dbs.OpenRecordset("qryBeneficiosAlt") With rst .AddNew ![FechaCalculo] = Now ![Nombre] = gstrNombre ![Beneficiario] = gstrBeneficiario ![Edad] = gintEdad ![Sexo] = gstrSexo ![Densidad] = gintDensidad ![TasaActualUSD] = gsngTasaActualUSD ![TasaCompUSD] = gsngTasaCompUSD ![CC] = gsngCC ' CC = Compensacion de Cotizaciones ![PBR] = gsngPBR ' PBR = Pension Base Referencial ![LimSolInf] = gsngLimSolInf ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial ![PR] = gsngPR ' Porcentaje Referencial ![BeneficiosAltPension] = gsngBeneficiosAltPension ![ValorAportes] = gsngValorAportes ![GF] = gsngGF .Update End With to be able to make a report on this very query as a Control Source. After printing the report I delete the data in the query with "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. But at "AddNew I get this error message " Error 3027 at run time./ You can't update. The database a/o object is "read only"." Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Another possible reason is a multiple table query. Anyhow, queries don't have AddNew and Update methods (although there are append and update queries), so can you clarify what you're actually trying to do? Charlotte Foust On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan wrote: > Hard to say without seeing the query, but a common reason for a query being RO is that it > doesn't include the PK of the table you are trying to update. > > -- > Stuart > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> message " Error 3027 at run time./ You can't update. The database a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 From stuart at lexacorp.com.pg Mon Apr 4 20:28:51 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 11:28:51 +1000 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> Message-ID: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > .AddNew > > ![FechaCalculo] = Now > > ![Nombre] = gstrNombre > > ![Beneficiario] = gstrBeneficiario > > ![Edad] = gintEdad > > ![Sexo] = gstrSexo > > ![Densidad] = gintDensidad > > ![TasaActualUSD] = gsngTasaActualUSD > > ![TasaCompUSD] = gsngTasaCompUSD > > ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ![LimSolInf] = gsngLimSolInf > > ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ![PR] = gsngPR ' Porcentaje Referencial > > ![BeneficiosAltPension] = gsngBeneficiosAltPension > > ![ValorAportes] = gsngValorAportes > > ![GF] = gsngGF > > .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query. Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > > _____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From newsgrps at dalyn.co.nz Mon Apr 4 20:38:48 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Tue, 05 Apr 2011 13:38:48 +1200 Subject: [AccessD] Creating ADE's in Access 2010 Message-ID: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From Darryl.Collins at iag.com.au Mon Apr 4 20:54:32 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 11:54:32 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <201104050154.p351seYM014934@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hey, that is good to know. So this will create an A2003 version MDE that will run on both A2003 and A2007/10? I will try this at home later and see what happens. Nice if it works like I think it should and much easier than doing it the 'proper' way. cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Tuesday, 5 April 2011 11:39 AM To: accessd at databaseadvisors.com Subject: [AccessD] Creating ADE's in Access 2010 For those of you who still use ade's (which I do), here is a handy tip I found at this location regarding creating ade files in Access 2010 (the tip is at the very bottom) http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/32a3e571-f07d-44cb-9b0a-3478b5c90fa3/ {Quote} You can create a .mde using Access 2010. You have to right click in the white space of the Ribbon and select Customize the Ribbon. Then in the Choose comands from: dropdown choose All Commands. Scroll down until you find Make MDE File... Then you create a new group on the ribbon in Customize Ribbon and add the command to your new group on the ribbon. It will tell you to restart the database. Once you have done that, Make MDE File will show up in the new location you added it to on the Ribbon and it will create the .mde for you. {End Quote} What I discovered is that if you load an adp then the ribbon item changes to Make ADE (as it does in Access XP etc). Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Mon Apr 4 21:03:06 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Tue, 05 Apr 2011 12:03:06 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <201104050154.p351seYM014934@databaseadvisors.com> References: <20110405013941.COQX4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz>, <201104050154.p351seYM014934@databaseadvisors.com> Message-ID: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > From Darryl.Collins at iag.com.au Mon Apr 4 21:51:26 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 5 Apr 2011 12:51:26 +1000 Subject: [AccessD] Creating ADE's in Access 2010 In-Reply-To: <4D9A785A.20837.389003C0@stuart.lexacorp.com.pg> Message-ID: <201104050251.p352pXOH017248@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am been largely ok with forward compatibility so far, although there has been some issues between 2003 and 2007. Might be fun to try this out though and see what happens with a 2007 'mde' in A2003 etc. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Tuesday, 5 April 2011 12:03 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Creating ADE's in Access 2010 Good luck! I've always had great difficulty running MDEs on different versions of Access. -- Stuart On 5 Apr 2011 at 11:54, Darryl Collins wrote: > > hey, that is good to know. So this will create an A2003 version MDE > that will run on both A2003 and A2007/10? > > I will try this at home later and see what happens. Nice if it works > like I think it should and much easier than doing it the 'proper' way. > > cheers > Darryl. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Gustav at cactus.dk Tue Apr 5 05:35:25 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 05 Apr 2011 12:35:25 +0200 Subject: [AccessD] Windows 8, Metro and modern UI Message-ID: Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screenshots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experience/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-revealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wallpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-transportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav From accessd at shaw.ca Tue Apr 5 12:47:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 5 Apr 2011 10:47:38 -0700 Subject: [AccessD] [dba-Tech] Windows 8, Metro and modern UI In-Reply-To: References: Message-ID: <0B83A3EE0FDC4839B506AFFA025B107D@creativesystemdesigns.com> Hi Gustav: The new designs looks (more like sounds) really interesting. I like that they are going more towards a flat and clean design with an emphasis on transitions. The only issues, especially if you are working with web based applications is the font options. There is only so much you can do with half dozen standard internal fonts you will find on every computer/browser as even the most fancy CSS has it limitations...and just downloading font images is not the answer if you application is going international. I have been working with this coding to allow a wider range of fonts to be deployed but there has to be a judicious trade off in performance and there is a limited set of size options. http://www.960development.com/how-to-write-cross-browser-font-face-syntax/ Jim -----Original Message----- From: dba-tech-bounces at databaseadvisors.com [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Tuesday, April 05, 2011 3:35 AM To: accessd at databaseadvisors.com; dba-tech at databaseadvisors.com Subject: [dba-Tech] Windows 8, Metro and modern UI Hi all The ideas and early screenshots seem more promising than I first thought: http://www.youtube.com/watch?v=5zqGXWnYe_U http://www.winrumors.com/windows-8-metro-ui-welcome-screen-and-ribbon-screen shots-leak/ http://www.winrumors.com/windows-8s-real-metro-ui-is-immersive-tablet-experi ence/ http://www.winrumors.com/windows-8-immersive-tablet-tile-ui-and-pdf-reader-r evealed/ http://www.winrumors.com/new-windows-8-screenshots-leak-including-updated-wa llpaper/ Based on the ideas of Metro as it is (the UI of Windows Phone 7), the design principles of this is very clever reading: Clean, Light, Open and Fast Alive in Motion Celebrate Typography Content, Not Chrome Authentically Digital http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/02/16/from-tra nsportation-to-pixels.aspx which also might indicate which direction future UIs will follow. It should be a good inspiration for design of UI for your own apps as well! /gustav _______________________________________________ dba-Tech mailing list dba-Tech at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-tech Website: http://www.databaseadvisors.com From EdTesiny at oasas.state.ny.us Tue Apr 5 14:22:18 2011 From: EdTesiny at oasas.state.ny.us (Tesiny, Ed) Date: Tue, 5 Apr 2011 15:22:18 -0400 Subject: [AccessD] Archives Down In-Reply-To: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> References: <20110404230700.PWKB4106.mta03.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: Nope, looks like it's down Ed Tesiny EdTesiny at oasas.state.ny.us -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Monday, April 04, 2011 7:06 PM To: Access Developers discussion and problem solving Subject: [AccessD] Archives Down Is it just me or are the archives down again? Regards David Emerson Dalyn Software Ltd Wellington, New Zealand -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 5 15:02:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 15:02:26 -0500 Subject: [AccessD] Query grid question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From charlotte.foust at gmail.com Tue Apr 5 15:49:01 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:49:01 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000501cbf32a$5b411900$11c34b00$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <4D9A4E6C.29339.37EC3AA5@stuart.lexacorp.com.pg> <000501cbf32a$5b411900$11c34b00$@com> Message-ID: You actually want to add data to tables, so why try to use the query to do so? In any case, if it isn't updateable it's usually because of the structure of the query. However, in your case, depending on the version of Access you're using, you haven't declared a recordset type, so your recordset may be a snapshot, which is not updatable by definition, regardless of whether the query is. Charlotte Foust On Mon, Apr 4, 2011 at 5:42 PM, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations ?and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > > ? ?.AddNew > > ? ?![FechaCalculo] = Now > > ? ?![Nombre] = gstrNombre > > ? ?![Beneficiario] = gstrBeneficiario > > ? ?![Edad] = gintEdad > > ? ?![Sexo] = gstrSexo > > ? ?![Densidad] = gintDensidad > > ? ?![TasaActualUSD] = gsngTasaActualUSD > > ? ?![TasaCompUSD] = gsngTasaCompUSD > > ? ?![CC] = gsngCC ' CC = Compensacion de Cotizaciones > > ? ?![PBR] = gsngPBR ' PBR = Pension Base Referencial > > ? ?![LimSolInf] = gsngLimSolInf > > ? ?![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > > ? ?![PR] = gsngPR ' Porcentaje Referencial > > ? ?![BeneficiosAltPension] = gsngBeneficiosAltPension > > ? ?![ValorAportes] = gsngValorAportes > > ? ?![GF] = gsngGF > > ? ?.Update > > End With > > > > to be able to make a report on this very query as a Control Source. After > printing the report I delete the data in the query with "DoCmd.RunSQL > "DELETE FROM qryBeneficiosAlt"" and the whole thing begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You can't > update. The database a/o ?object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust > Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > > > Another possible reason is a multiple table query. ?Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: >> Hard to say without seeing the query, but a common reason for a query > being RO is that it >> doesn't include the PK of the table you are trying to update. >> >> -- >> Stuart >> >> On 4 Apr 2011 at 18:54, Ralf Lister wrote: >> >>> Hello, >>> >>> >>> >>> I wanted to fill a Query with AddNew and Update. But I get the error >>> message " Error 3027 at run time./ You can't update. The database a/o >>> object is "read only"." What can I do to fix this problem? >>> >>> >>> >>> TIA. >>> >>> >>> >>> Saludos >>> >>> Actuary Ralf Lister >>> >>> La Paz, Bolivia >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > ?_____ > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 5 15:50:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 13:50:15 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Tue Apr 5 16:03:30 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 5 Apr 2011 16:03:30 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Here is a good example SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM WHERE Groups.Name like "MANIFOLD *" and Groups.Name not like "* AREA" and Groups.GroupingType="CGRP" and Members.ChildPTYPE="COMP" and Members.PID=Groups.PID and CM.PID=Members.ChildPID ORDER BY Members.ChildPID, Groups.Name; -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 3:50 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question What does the SQL look like when you view that? Charlotte Foust On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester wrote: > I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rlister at actuarial-files.com Tue Apr 5 17:50:03 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 18:50:03 -0400 Subject: [AccessD] Error 3027 In-Reply-To: <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> References: <000001cbf31b$3b72b1b0$b2581510$@com>, , <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> Message-ID: <000601cbf3e3$cedce560$6c96b020$@com> Thanks a lot Stuart, The SQL is: SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, tblWerte.BeneficiosAltPension, tblDisposiciones.GF FROM tblWerte, tblDisposiciones; Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 Can you post the SQL behind qryBeneficiosAlt? -- Stuart On 4 Apr 2011 at 20:42, Ralf Lister wrote: > Thank you all for your help. > > > > Charlotte, I`m gathering information data about one person, make some > calculations? and save this calculations in the fields of a query by > > > > Set dbs = CurrentDb > > Set rst = dbs.OpenRecordset("qryBeneficiosAlt") > > > > With rst > >???? .AddNew > >???? ![FechaCalculo] = Now > >???? ![Nombre] = gstrNombre > >???? ![Beneficiario] = gstrBeneficiario > >???? ![Edad] = gintEdad > >???? ![Sexo] = gstrSexo > >???? ![Densidad] = gintDensidad > >???? ![TasaActualUSD] = gsngTasaActualUSD > >???? ![TasaCompUSD] = gsngTasaCompUSD > >???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones > >???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial > >???? ![LimSolInf] = gsngLimSolInf > >???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial > >???? ![PR] = gsngPR ' Porcentaje Referencial > >???? ![BeneficiosAltPension] = gsngBeneficiosAltPension > >???? ![ValorAportes] = gsngValorAportes > >???? ![GF] = gsngGF > >???? .Update > > End With > > > > to be able to make a report on this very query as a Control Source. > After printing the report I delete the data in the query with > "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing > begins again. > > > > But at "AddNew I get this error message " Error 3027 at run time./ You > can't update. The database a/o? object is "read only"." > > > > Saludos > > Actuary Ralf Lister > > La Paz, Bolivia > > > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte > Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access > Developers discussion and problem solving Asunto: Re: [AccessD] Error > 3027 > > > > Another possible reason is a multiple table query.? Anyhow, queries > don't have AddNew and Update methods (although there are append and > update queries), so can you clarify what you're actually trying to do? > > Charlotte Foust > > On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan > wrote: > Hard to say without seeing the > query, but a common reason for a query being RO is that it > doesn't > include the PK of the table you are trying to update. > > -- > Stuart > > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> > I wanted to fill a Query with AddNew and Update. But I get the error > >> message " Error 3027 at run time./ You can't update. The database > a/o >> object is "read only"." What can I do to fix this problem? >> > >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La > Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> > AccessD at databaseadvisors.com >> > http://databaseadvisors.com/mailman/listinfo/accessd >> Website: > http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com > -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > >?? _____? > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: > 04/04/11 > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:07:43 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:07:43 -0700 Subject: [AccessD] Error 3027 In-Reply-To: <000601cbf3e3$cedce560$6c96b020$@com> References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rlister at actuarial-files.com Tue Apr 5 18:16:11 2011 From: rlister at actuarial-files.com (Ralf Lister) Date: Tue, 5 Apr 2011 19:16:11 -0400 Subject: [AccessD] Error 3027 In-Reply-To: References: <000001cbf31b$3b72b1b0$b2581510$@com> <000501cbf32a$5b411900$11c34b00$@com> <4D9A7053.29912.3870A7CB@stuart.lexacorp.com.pg> <000601cbf3e3$cedce560$6c96b020$@com> Message-ID: <000d01cbf3e7$74facea0$5ef06be0$@com> Thank's Charlotte, Thank's a lot for your help. I wouldn't have found this silly error with your help. I'll join now the tables. Saludos Actuary Ralf Lister La Paz, Bolivia De: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte Foust Enviado el: Martes, 05 de Abril de 2011 07:08 p.m. Para: Access Developers discussion and problem solving Asunto: Re: [AccessD] Error 3027 your SQL doesn't establish a join between the two tables, so the result will be a cartesian product, which is never updatable. Assuming you want to update tblWerte and you need to use tblDisposiciones, you need to join the tables on some shared field so that you will return only the fields in each record that relates to the fields in the other table's records. Charlotte Foust On Tue, Apr 5, 2011 at 3:50 PM, Ralf Lister wrote: > Thanks a lot Stuart, > > The SQL is: > > SELECT tblWerte.FechaCalculo, tblWerte.Nombre, tblWerte.Beneficiario, > tblWerte.Edad, tblWerte.Sexo, tblWerte.Densidad, tblWerte.TasaActualUSD, > tblWerte.TasaCompUSD, tblWerte.CC, tblWerte.PBR, tblWerte.LimSolInf, > tblWerte.MSR, tblWerte.PR, tblWerte.ValorAportes, > tblWerte.BeneficiosAltPension, tblDisposiciones.GF > FROM tblWerte, tblDisposiciones; > > > Saludos > Actuary Ralf Lister > La Paz, Bolivia > > De: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] En nombre de Stuart McLachlan > Enviado el: Lunes, 04 de Abril de 2011 09:29 p.m. > Para: Access Developers discussion and problem solving > Asunto: Re: [AccessD] Error 3027 > > Can you post the SQL behind qryBeneficiosAlt? > > -- > Stuart > > On 4 Apr 2011 at 20:42, Ralf Lister wrote: > >> Thank you all for your help. >> >> >> >> Charlotte, I`m gathering information data about one person, make some >> calculations? and save this calculations in the fields of a query by >> >> >> >> Set dbs = CurrentDb >> >> Set rst = dbs.OpenRecordset("qryBeneficiosAlt") >> >> >> >> With rst >> >>???? .AddNew >> >>???? ![FechaCalculo] = Now >> >>???? ![Nombre] = gstrNombre >> >>???? ![Beneficiario] = gstrBeneficiario >> >>???? ![Edad] = gintEdad >> >>???? ![Sexo] = gstrSexo >> >>???? ![Densidad] = gintDensidad >> >>???? ![TasaActualUSD] = gsngTasaActualUSD >> >>???? ![TasaCompUSD] = gsngTasaCompUSD >> >>???? ![CC] = gsngCC ' CC = Compensacion de Cotizaciones >> >>???? ![PBR] = gsngPBR ' PBR = Pension Base Referencial >> >>???? ![LimSolInf] = gsngLimSolInf >> >>???? ![MSR] = gsngMSR ' MSR = Monto Salarial Referencial >> >>???? ![PR] = gsngPR ' Porcentaje Referencial >> >>???? ![BeneficiosAltPension] = gsngBeneficiosAltPension >> >>???? ![ValorAportes] = gsngValorAportes >> >>???? ![GF] = gsngGF >> >>???? .Update >> >> End With >> >> >> >> to be able to make a report on this very query as a Control Source. >> After printing the report I delete the data in the query with >> "DoCmd.RunSQL "DELETE FROM qryBeneficiosAlt"" and the whole thing >> begins again. >> >> >> >> But at "AddNew I get this error message " Error 3027 at run time./ You >> can't update. The database a/o? object is "read only"." >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La Paz, Bolivia >> >> >> >> De: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] En nombre de Charlotte >> Foust Enviado el: Lunes, 04 de Abril de 2011 07:24 p.m. Para: Access >> Developers discussion and problem solving Asunto: Re: [AccessD] Error >> 3027 >> >> >> >> Another possible reason is a multiple table query.? Anyhow, queries >> don't have AddNew and Update methods (although there are append and >> update queries), so can you clarify what you're actually trying to do? >> >> Charlotte Foust >> >> On Mon, Apr 4, 2011 at 4:04 PM, Stuart McLachlan >> wrote: > Hard to say without seeing the >> query, but a common reason for a query being RO is that it > doesn't >> include the PK of the table you are trying to update. > > -- > Stuart >> > > On 4 Apr 2011 at 18:54, Ralf Lister wrote: > >> Hello, >> >> >> >> >> I wanted to fill a Query with AddNew and Update. But I get the error >> >> message " Error 3027 at run time./ You can't update. The database >> a/o >> object is "read only"." What can I do to fix this problem? >> >> >> >> >> TIA. >> >> >> >> Saludos >> >> Actuary Ralf Lister >> >> La >> Paz, Bolivia >> >> >> >> -- >> AccessD mailing list >> >> AccessD at databaseadvisors.com >> >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com > -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> >>?? _____ >> >> No virus found in this message. >> Checked by AVG - www.avg.com >> Version: 10.0.1209 / Virus Database: 1500/3550 - Release Date: >> 04/04/11 >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ________________________________________ > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1209 / Virus Database: 1500/3551 - Release Date: 04/05/11 > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ________________________________________ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1209 / Virus Database: 1500/3553 - Release Date: 04/05/11 From charlotte.foust at gmail.com Tue Apr 5 18:19:03 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 5 Apr 2011 16:19:03 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 5 22:54:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 05 Apr 2011 23:54:53 -0400 Subject: [AccessD] Autonumber when? Message-ID: <4D9BE40D.8050502@colbyconsulting.com> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From rusty.hammond at cpiqpc.com Tue Apr 5 23:02:58 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 5 Apr 2011 23:02:58 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Hi John, Do the following: .Update .BookMark = .LastModified mlngLogID = !PLSL_ID HTH Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 10:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Wed Apr 6 05:09:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 06:09:49 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C3BED.1000700@colbyconsulting.com> Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From ab-mi at post3.tele.dk Wed Apr 6 05:52:23 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 12:52:23 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <953E20402FC54D7AABE4F2578153A13D@abpc> Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. With rs .AddNew .!PLSL_IDPLSUSR = mlngIDUser .!PLSL_FE = CurrentProject.Name .!PLSL_Login = blnLogIn .!PLSL_WorkstationID = CurrentMachineName() On Error Resume Next .Update mlngLogID = .!PLSL_ID If Err Then mlngLogID = .!PLSL_ID End If .Close End With Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 12:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 05, 2011 10:55 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Autonumber when? > > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as > follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep > things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Wed Apr 6 06:06:52 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 13:06:52 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John How about: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 05:54 >>> In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 06:57:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:57:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C5532.4060906@colbyconsulting.com> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > From jwcolby at colbyconsulting.com Wed Apr 6 06:58:01 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 07:58:01 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <953E20402FC54D7AABE4F2578153A13D@abpc> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <953E20402FC54D7AABE4F2578153A13D@abpc> Message-ID: <4D9C5549.2050804@colbyconsulting.com> Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> From Gustav at cactus.dk Wed Apr 6 07:44:24 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 14:44:24 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi John No, it was not the same. It works! /gustav >>> jwcolby at colbyconsulting.com 06-04-2011 13:57 >>> Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? From Chester_Kaup at kindermorgan.com Wed Apr 6 07:38:28 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 6 Apr 2011 07:38:28 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> The grid is completely empty except for the two tables. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, April 05, 2011 6:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question OK, there is no join between the tables and the you're aliasing fields as well as tables. You won't see any joins because you haven't created explicit joins, only implicit in the Where conditions: > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID That won't show up in the Access grid as joins. Are you saying that you don't see the field aliases in the grid? Charlotte Foust On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester wrote: > Here is a good example > > SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo > FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM > WHERE Groups.Name like "MANIFOLD *" and > ?Groups.Name not like "* AREA" and > ?Groups.GroupingType="CGRP" and > ?Members.ChildPTYPE="COMP" and > ?Members.PID=Groups.PID and > ?CM.PID=Members.ChildPID > ORDER BY Members.ChildPID, Groups.Name; > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 3:50 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > What does the SQL look like when you view that? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester > wrote: >> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >> >> >> Chester Kaup >> >> Engineering Technician >> >> Kinder Morgan CO2 Company, LLP >> >> Office (432) 688-3797 >> >> FAX (432) 688-3799 >> >> >> >> >> >> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From ab-mi at post3.tele.dk Wed Apr 6 07:52:21 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 14:52:21 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5549.2050804@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><953E20402FC54D7AABE4F2578153A13D@abpc> <4D9C5549.2050804@colbyconsulting.com> Message-ID: <14A5B079377C4684B1473AEB5D140AAE@abpc> Ok, I see. Then try a MoveLast after the Update and before reading the new autonumber, i.e. With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .MoveLast mlngLogID = !PLSL_ID .Close End With Works for me. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 13:58 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Asger, The ! replaces the . John W. Colby www.ColbyConsulting.com On 4/6/2011 6:52 AM, Asger Blond wrote: > Not sure, but in your With...End With construction I suppose you need a period in front of each line implying rs, i.e. > With rs > .AddNew > .!PLSL_IDPLSUSR = mlngIDUser > .!PLSL_FE = CurrentProject.Name > .!PLSL_Login = blnLogIn > .!PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > .Update > mlngLogID = .!PLSL_ID > If Err Then > mlngLogID = .!PLSL_ID > End If > .Close > End With > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 6. april 2011 12:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Thanks Rusty, but that didn't seem to do anything either. This was a new record created. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 12:02 AM, Rusty Hammond wrote: >> Hi John, >> Do the following: >> .Update >> .BookMark = .LastModified >> mlngLogID = !PLSL_ID >> >> >> HTH >> >> Rusty >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 05, 2011 10:55 PM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Autonumber when? >> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as >> follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep >> things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> ********************************************************************** >> WARNING: All e-mail sent to and from this address will be received, >> scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. >> corporate e-mail system and is subject to archival, monitoring or review >> by, and/or disclosure to, someone other than the recipient. >> ********************************************************************** >> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Wed Apr 6 08:17:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 06:17:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: I don't know if this helps, but I always call @@IDENTITY in SQL to get the last PKID. Sent from my Droid phone. On Apr 5, 2011 8:56 PM, "jwcolby" wrote: > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 6 08:24:38 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 09:24:38 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9BE40D.8050502@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com> Message-ID: <07790084744342A6AF9FAE17F48AF13D@XPS> John, You may find the following helpful: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6 -4e13-8876-f6e5faae8dba/ It pretty much covers what has already been said, but goes through some of the in's and out's of why one approach works or doesn't. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 05, 2011 11:55 PM To: Access Developers discussion and problem solving Subject: [AccessD] Autonumber when? In Access an autonumber is created as you start filling in the record. In SQL Server the autonumber is created after you save the record. Thus, the following code, good in Access: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With Fails in SQL Server because !PLSL_ID isn't created yet. I thought something simple like doing an on error and then checking as follows would work: With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With It doesn't. This is with a DAO recordset object to a linked table (trying to keep things simple). Any suggestions how to get the PKID from the SQL Server table? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:25:29 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:25:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C5532.4060906@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 08:25:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:25:45 -0400 Subject: [AccessD] I need help Message-ID: <4D9C69D9.6060702@colbyconsulting.com> In NC where I live, volunteers can check certain inmates out of prison for up to 6 hours for activities like church, AA meetings or pretty much anything legal. I have the required certification to do this and I am writing an application to assist volunteers such as myself in filling out leave pass requests for prison inmates. There is a web search site that anyone can use to search for and observe the information about inmates. I am inserting the URL complete with a random inmate selected. Watch for word wrap. http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=0012345&searchOffenderId=0012345&listurl=pagelistoffendersearchresults&listpage=1 What I need assistance with is reading the info at the very top of the Offender Info in order to extract this and automatically fill in a record in Access. IOW I search for and find an inmate, then I press a button and suck the info in that top area into a record. This will save a fair amount of typing. The problem is I have no idea how to do this. If I view the HTML I find an XML table that holds this stuff but how do I drill down to that area reliably, then extract the info? Preferably without doing it i some code intensive string manipulation way. I already have two other volunteers requesting my program, which I will be making available for free to any volunteers who do checkouts. I am trying to make this as user friendly as possible. Any help is much appreciated. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 08:34:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 09:34:07 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9C6BCF.1020100@colbyconsulting.com> Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against > a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > From rusty.hammond at cpiqpc.com Wed Apr 6 08:47:44 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 08:47:44 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C3BED.1000700@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> When you set your recordset are you using the dbSeeChanges option? You're code should look something like this: dim db as database dim rs as recordset set db=CurrentDB() set rs = db.openrecordset("tblName", dbOpenDynaset, dbSeeChanges) With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update .BookMark = .LastModified mlngLogID = !PLSL_ID .Close End With -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 5:10 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Thanks Rusty, but that didn't seem to do anything either. This was a new record created. John W. Colby www.ColbyConsulting.com On 4/6/2011 12:02 AM, Rusty Hammond wrote: > Hi John, > Do the following: > .Update > .BookMark = .LastModified > mlngLogID = !PLSL_ID > > > HTH > > Rusty > ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From ab-mi at post3.tele.dk Wed Apr 6 08:49:57 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 15:49:57 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From mwp.reid at qub.ac.uk Wed Apr 6 08:50:21 2011 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Wed, 6 Apr 2011 14:50:21 +0100 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <631CF83223105545BF43EFB52CB08295470B44F4C7@EX2K7-VIRT-2.ads.qub.ac.uk> Might help http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845-66a6-4e13-8876-f6e5faae8dba/ Martin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 06 April 2011 14:34 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, The code needs to work whether going to an MDB or SQL BE. The code works fine for an MDB BE but fails for a SQL BE. The only difference between you code and mine is that I place an "On Error Resume Next" in front of the code that works for an MDB BE but fails for an SQL BE. When the code fails (against a SQL BE), I do the save and then I check the error. The error is > 0 so it falls in and does the "mlngLogID = !PLSL_ID". As far as I can see (other than the lack of the error handling in your code) our code is identical. The code works just fine for an MDB BE but it does fail for a SQL BE. I have stepped through the code and !PLSL_ID is a null value after the update when going against an SQL BE. Yours: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With Mine: >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With John W. Colby www.ColbyConsulting.com On 4/6/2011 8:44 AM, Gustav Brock wrote: > Hi John > > No, it was not the same. It works! > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 13:57>>> > Gustav, > > That is what I used in the second code example, surrounded by error > check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 08:58:42 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 09:58:42 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond Sent: Wednesday, April 06, 2011 9:50 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autonumber when? >> as after the .Update the record should still be current. Can't confirm that. You have to do a MoveLast to fetch the inserted value. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert Sendt: 6. april 2011 15:25 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 7:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Gustav, That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. John W. Colby www.ColbyConsulting.com On 4/6/2011 7:06 AM, Gustav Brock wrote: > Hi John > > How about: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > /gustav > > >>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> > In Access an autonumber is created as you start filling in the record. > > In SQL Server the autonumber is created after you save the record. > > Thus, the following code, good in Access: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > Fails in SQL Server because !PLSL_ID isn't created yet. > > I thought something simple like doing an on error and then checking as follows would work: > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > .Close > End With > > It doesn't. > > This is with a DAO recordset object to a linked table (trying to keep things simple). > > Any suggestions how to get the PKID from the SQL Server table? > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:01:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:01:04 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C7220.3060606@colbyconsulting.com> Lambert, I am actually doing *both*. The code needs to function for an MDB BE or an SQL BE. By testing BEFORE the save it works for DAO, the test AFTER the save (is supposed to) works for SQL. For whatever reason it doesn't work for the sql be. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:25 AM, Heenan, Lambert wrote: > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 6 09:01:47 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 10:01:47 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C6BCF.1020100@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: As I said, look again John. You have... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() mlngLogID = !PLSL_ID .Update .Close End With But Gustav (and me if I'd been quick enough) suggests... With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() .Update mlngLogID = !PLSL_ID .Close End With i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. Lambert From jwcolby at colbyconsulting.com Wed Apr 6 09:06:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:06:59 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7383.4080009@colbyconsulting.com> Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? From jwcolby at colbyconsulting.com Wed Apr 6 09:15:41 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:15:41 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C5532.4060906@colbyconsulting.com> Message-ID: <4D9C758D.30905@colbyconsulting.com> It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Wed Apr 6 09:19:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:19:34 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> Message-ID: <4D9C7676.1000303@colbyconsulting.com> If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert From rusty.hammond at cpiqpc.com Wed Apr 6 09:21:02 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:21:02 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Yeah, there's something about linked SQL tables you have to set the recordset bookmark to the lastmodified record, after the update, before you can read the autonumber value when creating new records. It should work for both linked SQL tables and tables in an mdb so trying to read the value before the update isn't really necessary. Martin sent this link earlier that talks about it: http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- 66a6-4e13-8876-f6e5faae8dba/ I've had this code running in an application for several years in Access 97 and 2003. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Wed Apr 6 09:38:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 10:38:29 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7383.4080009@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> Message-ID: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> John, A little code cleanup: Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Should be: Exit_mPLSLogin: On Error Resume Next If Not (rs Is Nothing) Then rs.Close Set rs = Nothing End If Exit Function Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:07 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? Rusty, The following is the actual code. ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function John W. Colby www.ColbyConsulting.com On 4/6/2011 9:47 AM, Rusty Hammond wrote: > When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 09:41:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:41:28 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4D9C7B98.9000909@colbyconsulting.com> It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, before > you can read the autonumber value when creating new records. It should > work for both linked SQL tables and tables in an mdb so trying to read > the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c845- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From jwcolby at colbyconsulting.com Wed Apr 6 09:45:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 10:45:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <9EAFC4E5C21543C7835E6B052EB244DE@XPS> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> Message-ID: <4D9C7C79.4070406@colbyconsulting.com> LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? From rusty.hammond at cpiqpc.com Wed Apr 6 09:46:37 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:46:37 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, now I remember what's going on. I had to go to Access 97 Developer's Handbook (page 269)to refresh my memory (page 1540 of the Access 2000 Developer's Handbook volume 1). You mentioned it in your original post that SQL doesn't create the autonumber value until after the record is created. When using the AddNew method on a Dynaset-type recordset, as soon as you do .Update, that new record gets added to the end of the recordset and is NOT the current record. To get to that new record, you use the .LastModified property of the recordset. You can use either of the following methods to get to the new record: .BookMark = .LastModified OR .Move 0, .LastModified Then get the value of the ID field. The nice thing is it works with either a linked SQL table or Access table. You new code should look like the following (I've rem'ed out your existing lines so you can see the changes): ' 'Adds a record to the table saying that a specific user logged in at a specific time ' '*+ Private class functions Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As DAO.Recordset Dim db As DAO.Database On Error GoTo Err_mPLSLogin Set db = dbDAOCurr Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) If mlngIDUser = 0 Then Exit Function With rs .AddNew !PLSL_IDPLSUSR = mlngIDUser !PLSL_FE = CurrentProject.Name !PLSL_Login = blnLogIn !PLSL_WorkstationID = CurrentMachineName() 'Take out the following two lines - get the ID value after the Update - RustyH 'On Error Resume Next 'mlngLogID = !PLSL_ID .Update 'Added the following line - RustyH .BookMark = .LastModified 'If Err Then mlngLogID = !PLSL_ID 'End If .Close End With Exit_mPLSLogin: On Error Resume Next Set rs = Nothing If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing Exit Function Err_mPLSLogin: Select Case Err Case 0 '.insert Errors you wish to ignore here Resume Next Case Else '.All other errors will trap Beep PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" Resume Exit_mPLSLogin End Select Resume 0 '.FOR TROUBLESHOOTING End Function ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Wed Apr 6 09:57:51 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Wed, 6 Apr 2011 09:57:51 -0500 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7B98.9000909@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE12B@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7B98.9000909@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE12D@CPIEMAIL-EVS1.CPIQPC.NET> Because the record isn't actually saved to the table until you do .Update. It's like creating a new record on a data entry form or directly in the table. You can click the AddNew button and enter data in the fields but until you move to another record or hit the Save Record button, the record isn't saved yet. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 9:41 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? It turns out that I have some other problem. If I remove the On Error Resume Next the .Update fails with an "odbc call failed" error message returned by Jet and in fact the record never stores into the table, thus there is no PK to pull back out. So why does it fail on the update but not on the addnew? :( John W. Colby www.ColbyConsulting.com On 4/6/2011 10:21 AM, Rusty Hammond wrote: > Yeah, there's something about linked SQL tables you have to set the > recordset bookmark to the lastmodified record, after the update, > before you can read the autonumber value when creating new records. > It should work for both linked SQL tables and tables in an mdb so > trying to read the value before the update isn't really necessary. > > Martin sent this link earlier that talks about it: > > http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/3507c84 > 5- > 66a6-4e13-8876-f6e5faae8dba/ > > I've had this code running in an application for several years in > Access > 97 and 2003. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 9:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) Dim rs As > DAO.Recordset Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, > dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, > "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or > review by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:12:57 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:12:57 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7676.1000303@colbyconsulting.com> References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:20 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? If you go all the way back to my original post, I showed where I modified that first method to a second method where I do what you are discussing... I said that the first method did not work, but the second (which should work) also did not work. Look for: >>>I thought something simple like doing an on error and then checking as follows would work: and read what follows... John W. Colby www.ColbyConsulting.com On 4/6/2011 10:01 AM, Heenan, Lambert wrote: > As I said, look again John. > > You have... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > mlngLogID = !PLSL_ID > .Update > .Close > End With > > But Gustav (and me if I'd been quick enough) suggests... > > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close > End With > > i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update. > > Lambert -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Wed Apr 6 10:17:50 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 6 Apr 2011 11:17:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9C6BCF.1020100@colbyconsulting.com> <4D9C7676.1000303@colbyconsulting.com> Message-ID: Although that theory may get blown out of the water as Err should in fact retain its value even after the .Update statement. I just checked with this Sub Err_Test() Dim n As Long On Error Resume Next n = 10 / 0 n = 10 Debug.Print n, Err.Number End Sub Which outputs 10, 11 (as error 11 is Div by zero). But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 06, 2011 11:13 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? "I said that the first method did not work, but the second (which should work) also did not work." And here is why it does not work... On Error Resume Next mlngLogID = !PLSL_ID .Update If Err Then mlngLogID = !PLSL_ID End If You have on Error resume next. Fair enough, but when the statement mlngLogID = !PLSL_ID is executed you will get an error. Because of the Resume Next all that happens after the error is that the .Update statement executes. The .Update statement will not cause any error so when the next line of code runs, Err = 0 and so the mlngLogID = !PLSL_ID does not execute. If you use > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > .Update > mlngLogID = !PLSL_ID > .Close That should work fine with *both* SQL server and native Access apps. Lambert From Gustav at cactus.dk Wed Apr 6 10:41:41 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 06 Apr 2011 17:41:41 +0200 Subject: [AccessD] Autonumber when? Message-ID: Hi Lambert I found out that you read out the value from the record you were at before calling .AddNew. That fooled me. But no error was raised which is what fooled JC. However, Rusty described how to do it with .LastModified which method I tested with success. /gustav >>> Lambert.Heenan at chartisinsurance.com 06-04-2011 17:17 >>> But I'd still like to hear what results you actually do get by using .Update and then grabbing the autonumber value. From ab-mi at post3.tele.dk Wed Apr 6 10:31:25 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Wed, 6 Apr 2011 17:31:25 +0200 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C758D.30905@colbyconsulting.com> References: <4D9C5532.4060906@colbyconsulting.com> <4D9C758D.30905@colbyconsulting.com> Message-ID: Correct. The identity column I used has a clustered PK. If that's not the case then you could open the recordset using a sql ordering by PLSL_ID and using the dbOpenDynaset, dbSeeChanges option. As for another record being inserted before moving last: if that's a risk then you should make the insert calling a sp in SQL Server. In this sp you can use SCOPE_IDENTITY() to get the last identity ("autonumber") value created by the procedure. (Don't use @@IDENTITY for this, since it might eventually return an identity value created by a trigger for your table.) Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 6. april 2011 16:16 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Autonumber when? It also makes the assumption that no other record is inserted before you do the move last. John W. Colby www.ColbyConsulting.com On 4/6/2011 9:58 AM, Heenan, Lambert wrote: > Surely using .MoveLast makes the *assumption* that the table is sorted by the order that records were created in, and that is contrary to the fact that tables have *no* defined order. > > I am not using SQL server, but perhaps someone might explain why it might be that updating a record would result in that record no longer being current? > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Asger Blond > Sent: Wednesday, April 06, 2011 9:50 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Autonumber when? > >>> as after the .Update the record should still be current. > > Can't confirm that. You have to do a MoveLast to fetch the inserted value. > > Asger > > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Heenan, Lambert > Sendt: 6. april 2011 15:25 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Autonumber when? > > Look again John. Gustav beat me to it. What he has suggested is to fill in all your data fields and *then* execute the .Update method. > > That should create the record, and which point PLSL_ID will have a value, and then you should simply be able to read the value, as after the .Update the record should still be current. > > You were originally trying to get the value of PLSL_ID before the .Update, which generates an error. > > Lambert > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 7:58 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Gustav, > > That is what I used in the second code example, surrounded by error check so that when going against a normal mdb be it would not do that line. > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 7:06 AM, Gustav Brock wrote: >> Hi John >> >> How about: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> .Update >> mlngLogID = !PLSL_ID >> .Close >> End With >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 06-04-2011 05:54>>> >> In Access an autonumber is created as you start filling in the record. >> >> In SQL Server the autonumber is created after you save the record. >> >> Thus, the following code, good in Access: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> mlngLogID = !PLSL_ID >> .Update >> .Close >> End With >> >> Fails in SQL Server because !PLSL_ID isn't created yet. >> >> I thought something simple like doing an on error and then checking as follows would work: >> >> With rs >> .AddNew >> !PLSL_IDPLSUSR = mlngIDUser >> !PLSL_FE = CurrentProject.Name >> !PLSL_Login = blnLogIn >> !PLSL_WorkstationID = CurrentMachineName() >> On Error Resume Next >> mlngLogID = !PLSL_ID >> .Update >> If Err Then >> mlngLogID = !PLSL_ID >> End If >> .Close >> End With >> >> It doesn't. >> >> This is with a DAO recordset object to a linked table (trying to keep things simple). >> >> Any suggestions how to get the PKID from the SQL Server table? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 6 10:39:32 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 6 Apr 2011 08:39:32 -0700 Subject: [AccessD] Query grid question In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jimdettman at verizon.net Wed Apr 6 10:43:50 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 06 Apr 2011 11:43:50 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9C7C79.4070406@colbyconsulting.com> References: <4D9BE40D.8050502@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE128@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C3BED.1000700@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE129@CPIEMAIL-EVS1.CPIQPC.NET> <4D9C7383.4080009@colbyconsulting.com> <9EAFC4E5C21543C7835E6B052EB244DE@XPS> <4D9C7C79.4070406@colbyconsulting.com> Message-ID: <1751F81B42C84B468378B7D3CEC911A2@XPS> John, Don't remember exactly why, but it was important not to attempt the close if the object variable was already nothing, so therefore the check. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 06, 2011 10:45 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Autonumber when? LOL, boy howdy! How about this... Exit_mPLSLogin: On Error Resume Next rs.Close Set rs = Nothing Exit Function John W. Colby www.ColbyConsulting.com On 4/6/2011 10:38 AM, Jim Dettman wrote: > John, > > A little code cleanup: > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > > Should be: > > Exit_mPLSLogin: > On Error Resume Next > > If Not (rs Is Nothing) Then > rs.Close > Set rs = Nothing > End If > > Exit Function > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 06, 2011 10:07 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Autonumber when? > > Rusty, > > The following is the actual code. > > ' > 'Adds a record to the table saying that a specific user logged in at a > specific time > ' > '*+ Private class functions > Private Function mPLSLogin(blnLogIn As Boolean) > Dim rs As DAO.Recordset > Dim db As DAO.Database > > On Error GoTo Err_mPLSLogin > > Set db = dbDAOCurr > Set rs = db.OpenRecordset("usystblPLSLog", dbOpenDynaset, dbSeeChanges) > If mlngIDUser = 0 Then Exit Function > With rs > .AddNew > !PLSL_IDPLSUSR = mlngIDUser > !PLSL_FE = CurrentProject.Name > !PLSL_Login = blnLogIn > !PLSL_WorkstationID = CurrentMachineName() > On Error Resume Next > mlngLogID = !PLSL_ID > .Update > If Err Then > mlngLogID = !PLSL_ID > End If > > .Close > End With > > Exit_mPLSLogin: > On Error Resume Next > Set rs = Nothing > If Not (rs Is Nothing) Then rs.Close: Set rs = Nothing > Exit Function > Err_mPLSLogin: > Select Case Err > Case 0 '.insert Errors you wish to ignore here > Resume Next > Case Else '.All other errors will trap > Beep > PLSLogErr Err.Number, Err.Description, Erl, cstrModule, "mPLSLogin" > Resume Exit_mPLSLogin > End Select > Resume 0 '.FOR TROUBLESHOOTING > End Function > > > John W. Colby > www.ColbyConsulting.com > > On 4/6/2011 9:47 AM, Rusty Hammond wrote: >> When you set your recordset are you using the dbSeeChanges option? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 6 14:45:22 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 15:45:22 -0400 Subject: [AccessD] IE search for table Message-ID: <4D9CC2D2.60402@colbyconsulting.com> Function mSearchTable() Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And Len(strOffenderInfo) = 0 Then strOffenderInfo = strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And Len(strMostRecent) = 0 Then strMostRecent = strInnerText End If End If Next varTable Debug.Print strOffenderInfo Debug.Print strMostRecent Cleanup: Set varTable = Nothing: Set varTables = Nothing 'objIE.Quit 'Set objIE = Nothing End Function -- John W. Colby www.ColbyConsulting.com From kismert at gmail.com Wed Apr 6 15:13:46 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 6 Apr 2011 15:13:46 -0500 Subject: [AccessD] Autonumber when? Message-ID: > > jwcolby > ... > The code needs to work whether going to an MDB or SQL BE. The code works > fine for an MDB BE but fails for a SQL BE. > ... > John, This is probably what you are trying to avoid, but I'll say it anyway: You should write separate code to handle the MDB and SQL Server BEs. First, the obvious: Jet and SQL Server are very different. * It is unlikely that this is the only variation you will have to account for throughout your code * Variations in code make it harder to test * When you do want to use SQL Server-specific features, like stored procedures, you will have to split the code anyway * I have a personal distaste of "On Error Resume Next" coding, which I use only for object cleanup code where there is literally nothing to raise an error to. All told, the cost and effort to make a large existing code base generic will likely exceed the cost of just splitting it neatly into libraries that support each database type. Plus, you get more modular, flexible, testable code. Again, this is what you are trying to avoid, but I felt I should say it, anyway. -Ken From jwcolby at colbyconsulting.com Wed Apr 6 15:38:13 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 16:38:13 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: Message-ID: <4D9CCF35.3030705@colbyconsulting.com> I hear you Ken. I have written a framework for MDB BEs. It is very large, and has tons of functionality, and was never intended to run against SQL Server simply because nobody was using that back when I wrote it. Now I am trying to use it for a SQL Server back end. It is not just a simple case of "write a library for this and a library for that. Additionally I need it to work where this table (or set of tables) is kept in an MDB and that one is moved to SQL. I write frameworks. The framework does a ton of stuff which is handled automatically. It handles the not in list and the dbl click of combos for example. The dbl click of a combo opens a form and moves to the record that the combo is displaying. Classes instantiate classes which instantiate classes. I am just not sure that "writing separate libs" is a viable option. It would mean a complete rewrite of the framework and then a complete rewrite of the FE. John W. Colby www.ColbyConsulting.com On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >> jwcolby >> ... >> The code needs to work whether going to an MDB or SQL BE. The code works >> fine for an MDB BE but fails for a SQL BE. >> ... >> > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken From davidmcafee at gmail.com Wed Apr 6 15:58:29 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 6 Apr 2011 13:58:29 -0700 Subject: [AccessD] Autonumber when? In-Reply-To: <4D9CCF35.3030705@colbyconsulting.com> References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: Perfect time to rewrite it for "unbound" >:P On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > On 4/6/2011 4:13 PM, Kenneth Ismert wrote: > >> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >>> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I >> use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries >> that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 6 16:20:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:20:08 -0400 Subject: [AccessD] Autonumber when? In-Reply-To: References: <4D9CCF35.3030705@colbyconsulting.com> Message-ID: <4D9CD908.8050904@colbyconsulting.com> ;) John W. Colby www.ColbyConsulting.com On 4/6/2011 4:58 PM, David McAfee wrote: > Perfect time to rewrite it for "unbound">:P > > > On Wed, Apr 6, 2011 at 1:38 PM, jwcolby wrote: > >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> On 4/6/2011 4:13 PM, Kenneth Ismert wrote: >> >>> >>>> jwcolby >>>> ... >>>> The code needs to work whether going to an MDB or SQL BE. The code works >>>> fine for an MDB BE but fails for a SQL BE. >>>> ... >>>> >>>> >>> John, >>> >>> This is probably what you are trying to avoid, but I'll say it anyway: >>> >>> You should write separate code to handle the MDB and SQL Server BEs. >>> >>> First, the obvious: Jet and SQL Server are very different. >>> * It is unlikely that this is the only variation you will have to account >>> for throughout your code >>> * Variations in code make it harder to test >>> * When you do want to use SQL Server-specific features, like stored >>> procedures, you will have to split the code anyway >>> * I have a personal distaste of "On Error Resume Next" coding, which I >>> use >>> only for object cleanup code where there is literally nothing to raise an >>> error to. >>> >>> All told, the cost and effort to make a large existing code base generic >>> will likely exceed the cost of just splitting it neatly into libraries >>> that >>> support each database type. >>> >>> Plus, you get more modular, flexible, testable code. >>> >>> Again, this is what you are trying to avoid, but I felt I should say it, >>> anyway. >>> >>> -Ken >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From jwcolby at colbyconsulting.com Wed Apr 6 16:23:21 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:23:21 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CD9C9.7090909@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 6 16:25:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Apr 2011 17:25:39 -0400 Subject: [AccessD] SQL Server timeout Message-ID: <4D9CDA53.2090800@colbyconsulting.com> I am having issues where the Fe will "disconnect" (the term is mine) from SQL Server. If I click on a linked table it will timeout and give me an error message saying the odbc connection is invalid. I can *immediately* click on the same table (or any other) and it will open. Any idea what is going on? -- John W. Colby www.ColbyConsulting.com From Chester_Kaup at kindermorgan.com Thu Apr 7 07:41:44 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 7 Apr 2011 07:41:44 -0500 Subject: [AccessD] Query grid question In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DC7@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03DE3@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197BB03E89@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BB04055@houex1.kindermorgan.com> The query runs OK. The number of returned records is the same as what I would call a normal query. Something like this. SELECT GroupMaster.Name, dbo_DSS_CompletionMaster.PID, ConfigMaster.WellName FROM dbo_DSS_CompletionMaster INNER JOIN (ConfigMaster INNER JOIN GroupMaster ON ConfigMaster.PID = GroupMaster.PID) ON dbo_DSS_CompletionMaster.PID = ConfigMaster.ChildPID WHERE (((GroupMaster.Name) Like "Manifold*" And (GroupMaster.Name) Not Like "*Area")); -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 06, 2011 10:40 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Query grid question The question that hasn't be asked is what kind of results you get if you try to run the query. What happens? Do you get an error, do you get a bunch of records in a cartesian product, or what? Charlotte Foust On Wed, Apr 6, 2011 at 5:38 AM, Kaup, Chester wrote: > The grid is completely empty except for the two tables. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Tuesday, April 05, 2011 6:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Query grid question > > OK, there is no join between the tables and the you're aliasing fields > as well as tables. ?You won't see any joins because you haven't > created explicit joins, only implicit in the Where conditions: > >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID > > That won't show up in the Access grid as joins. ?Are you saying that > you don't see the field aliases in the grid? > > Charlotte Foust > > On Tue, Apr 5, 2011 at 2:03 PM, Kaup, Chester > wrote: >> Here is a good example >> >> SELECT Groups.Name AS Manifold, Members.ChildPID AS API14, CM.Well_Number AS WellNo >> FROM GroupMaster AS Groups, ConfigMaster AS Members, dbo_DSS_CompletionMaster AS CM >> WHERE Groups.Name like "MANIFOLD *" and >> ?Groups.Name not like "* AREA" and >> ?Groups.GroupingType="CGRP" and >> ?Members.ChildPTYPE="COMP" and >> ?Members.PID=Groups.PID and >> ?CM.PID=Members.ChildPID >> ORDER BY Members.ChildPID, Groups.Name; >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust >> Sent: Tuesday, April 05, 2011 3:50 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Query grid question >> >> What does the SQL look like when you view that? >> >> Charlotte Foust >> >> On Tue, Apr 5, 2011 at 1:02 PM, Kaup, Chester >> wrote: >>> I have a database in which a user has added some queries created in SAS. When I open the query in the design grid only the tables show up; no links between tables or grid with the table name, filed name condition etc. Any ideas what is happening? >>> >>> >>> Chester Kaup >>> >>> Engineering Technician >>> >>> Kinder Morgan CO2 Company, LLP >>> >>> Office (432) 688-3797 >>> >>> FAX (432) 688-3799 >>> >>> >>> >>> >>> >>> No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 7 16:47:24 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 7 Apr 2011 14:47:24 -0700 Subject: [AccessD] E Mail hyperlink In-Reply-To: <4D9C69D9.6060702@colbyconsulting.com> References: <4D9C69D9.6060702@colbyconsulting.com> Message-ID: Hello, I using Access 2003 to create a contact database. I am trying to create a field (which is currently text) in a table (or the related form) which acts as hyperlink to the email address which is typed in there for each contact. i.e. we want to be able to click on the field and have it open to new mail message. Can you tell me how to do this please? I have gotten so far as to be able to right click on the control and edit hyperlink to indicate that it is an email address, but then it wants me to type in the address. I can't do this for all 5K+. Other than just leaving the data in text and automating Outlook via vba when clicking the control.... Just seems like I should be able to do this. bob heygood From stuart at lexacorp.com.pg Thu Apr 7 17:09:55 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 08 Apr 2011 08:09:55 +1000 Subject: [AccessD] E Mail hyperlink In-Reply-To: References: <4D9C69D9.6060702@colbyconsulting.com>, Message-ID: <4D9E3633.21526.A28319F@stuart.lexacorp.com.pg> Sub txtEmail_DoubleClick() Docmd.SendObject vbSendNoObject,,,txtEmail,,,,,True, End Sub On 7 Apr 2011 at 14:47, b heygood wrote: > Hello, I using Access 2003 to create a contact database. I am trying > to create a field (which is currently text) in a table (or the related > form) which acts as hyperlink to the email address which is typed in > there for each contact. i.e. we want to be able to click on the field > and have it open to new mail message. Can you tell me how to do this > please? > > I have gotten so far as to be able to right click on the control and > edit hyperlink to indicate that it is an email address, but then it > wants me to type in the address. I can't do this for all 5K+. > > Other than just leaving the data in text and automating Outlook via > vba when clicking the control.... Just seems like I should be able to > do this. > > bob heygood > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Thu Apr 7 21:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 07 Apr 2011 22:46:37 -0400 Subject: [AccessD] data validation Message-ID: <4D9E770D.5030102@colbyconsulting.com> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Fri Apr 8 02:27:38 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 08 Apr 2011 09:27:38 +0200 Subject: [AccessD] data validation Message-ID: Hi John I think a lot depends on your user interface. We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. /gustav >>> jwcolby at colbyconsulting.com 08-04-2011 04:46 >>> Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From adtp at airtelmail.in Fri Apr 8 04:06:55 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Fri, 8 Apr 2011 14:36:55 +0530 Subject: [AccessD] data validation References: <4D9E770D.5030102@colbyconsulting.com> Message-ID: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> J.C., In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). Best wishes, A.D.Tejpal ------------ Brief Description (Sample Db: DentalAppointments) ========================= This sample db demonstrates Appointments Planner for a dental clinic having two chairs. The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. Caution - (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open & use the sample db. (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. Version - Access 2000 file format Reference - DAO 3.6 ======================================= ----- Original Message ----- From: jwcolby To: Access Developers discussion and problem solving Sent: Friday, April 08, 2011 08:16 Subject: [AccessD] data validation Scenario: I fill out a pass request = date / time from / time to. The pass request's time from needs to be < the Time to. Three detail records - location / time from / time to. The detail record's time from needs to be >= the pass request time from and <= the pass request time time to. Any subsequent detail record needs to follow the same rules but also needs to be after the first request's time from / to. Any change to any time needs to re-perform the validation. Pass request: 5/1/2011 08:45 - 13:00 Detail record: Church 09:00 - 11:00 Restaurant 11:00-12:00 park 12:00-12:45 There must always be a pass request date / time There must always be one or more detail records. There may be up to three detail records. How would you perform data validation in this scenario? I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. Etc. I have never had to do a validation like this but now I need to. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 8 08:00:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:00:48 -0400 Subject: [AccessD] data validation In-Reply-To: References: Message-ID: <4D9F0700.7050109@colbyconsulting.com> Thanks Gustav. I haven't wrapped my mind around the "how to" do adjustments. The data is entered into a main form (pass request) sub form (request detail), with the request detail being a continuous form. AFAICT I can't write back to the subform controls because (AFAIK) doing so writes that value into every record. I would have to write them back to the table using SQL and then requery the subform to show the changes. An additional issue is that these forms are bound to SQL Server data through linked tables. I too am looking at using the recordset clone, however one of the issues I am trying to work around is that if I move to binding the form to an ADO recordset, then the RecordsetClone property becomes non-functional. I am going to put this in the "ToDo" file I think and get some other, less... "complicated" issues handled first. John W. Colby www.ColbyConsulting.com On 4/8/2011 3:27 AM, Gustav Brock wrote: > Hi John > > I think a lot depends on your user interface. > > We do a similar thing when filling in time sheets for a day. Nothing fancy. If you enter a time and duration, and that overlaps an existing following period, it shifts the start time to the end of that period and calculates the end time. If the end time will overlap a later period, that period is shifted to have a start equal to the end time of the period you entered. > If a period is shortened, a free slot is created as it cannot know if you plan to enter a new period into the free slot or move the following period back to remove the free slot. > > The tricky part for us is that you can enter start/end time, start time and duration in hours:minutes, or start time and duration in decimal hours. All four entries can be edited and then the others are adjusted and rounded correctly as are the sum of periods. Again, nothing fancy once you have got the hold on it. No classes and though I haven't the code at hand, I recall most adjustments are done with a simple loop through the recordset (recordsetclone) holding the periods, thus no queries. > > /gustav > > >>>> jwcolby at colbyconsulting.com 08-04-2011 04:46>>> > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to > check the details against itself, with a collection to hold the time classes. Time classes have > code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > From jwcolby at colbyconsulting.com Fri Apr 8 08:21:34 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 08 Apr 2011 09:21:34 -0400 Subject: [AccessD] data validation In-Reply-To: <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> References: <4D9E770D.5030102@colbyconsulting.com> <6F802C7E9E84463B88E757B5EA36D72A@personal4a8ede> Message-ID: <4D9F0BDE.9010700@colbyconsulting.com> Thanks A.D. These time slots are entirely determined by the user, and can be any length. Basically the user decides "I will be in this location from time X to time Y". The times have to be non-overlapping to other time slots and entirely contained within the pass request times. I actually have a function that takes a pair of data points, each data point consisting of PK, time from and time to and returns a boolean true if they collide. It was written to handle comparing two records. John W. Colby www.ColbyConsulting.com On 4/8/2011 5:06 AM, A.D. Tejpal wrote: > J.C., > > In this context, my sample db named DentalAppointments might perhaps be of interest to you. It is available at Rogers Access Library. Link: > http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=45 > > The sample displays default time-slots of 30 minutes each, with the facility to expand or shrink the same by altering the start and (or) end times for any given particular slot. Such alteration is permitted only if it does not impinge upon already booked slots. > > When the user expands an existing time-slot, and if the altered duration infringes with any other free slots, the affected time slots get disabled and highlighted in a different color. In short, there is built in safeguard against entry of conflicting time slots. > > You could adapt the underlying approach suitably, for your specific needs. (In the scenario mentioned by you, time from and time to of pass request could be considered similar to the scheduled working hours of the clinic in sample db). > > A brief description is given below. (Attention is drawn to the precautions regarding prior registration of Date And Time Picker control as mentioned below). > > Best wishes, > A.D.Tejpal > ------------ > > Brief Description > (Sample Db: DentalAppointments) > ========================= > This sample db demonstrates Appointments Planner for a dental clinic having two chairs. > > The Planner opens with appointment grid for today's date pre-selected and the cursor moves to first available free time slot. > > If any other date is selected in the Date Picker control, fresh appointment grid for that date is presented (if not already existing). > > Default values of time slots can be altered (e.g. longer slots might be needed for some tasks) - provided it does not intrude upon an already booked timeslot. > > Caution - > (a) An activex control named 'Microsoft Date And Time Picker Control' has been used in this database. This control is required to be registered in the access installation on user's computer, before attempting to open& use the sample db. > > (b) For registration - file mscomct2.ocx should be available in System32 folder of windows operating system. Open any access database other than this db (even a blank one will do), click Tools -> Activex Controls -> Register. Navigate to the location of above .ocx file and click OK. > > Version - Access 2000 file format > > Reference - DAO 3.6 > ======================================= > > ----- Original Message ----- > From: jwcolby > To: Access Developers discussion and problem solving > Sent: Friday, April 08, 2011 08:16 > Subject: [AccessD] data validation > > > Scenario: > > I fill out a pass request = date / time from / time to. > The pass request's time from needs to be< the Time to. > > Three detail records - location / time from / time to. > > The detail record's time from needs to be>= the pass request time from and<= the pass request time > time to. > > Any subsequent detail record needs to follow the same rules but also needs to be after the first > request's time from / to. > > Any change to any time needs to re-perform the validation. > > Pass request: > > 5/1/2011 08:45 - 13:00 > > Detail record: > > Church 09:00 - 11:00 > Restaurant 11:00-12:00 > park 12:00-12:45 > > There must always be a pass request date / time > There must always be one or more detail records. > There may be up to three detail records. > > How would you perform data validation in this scenario? > > I vote for a pair of classes - time class and supervisor which is the pass time and has code to check the details against itself, with a collection to hold the time classes. Time classes have code to compare itself against another time class. > > Etc. > > I have never had to do a validation like this but now I need to. > -- > John W. Colby > www.ColbyConsulting.com From gustav at cactus.dk Sat Apr 9 03:54:55 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 09 Apr 2011 10:54:55 +0200 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Message-ID: Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug From accessd at shaw.ca Sat Apr 9 20:35:29 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 9 Apr 2011 18:35:29 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! In-Reply-To: References: Message-ID: Hi Gustav: Thanks for posting this. There is a fix/patch for all application other than those using VBA (C++ and .Net) and having installed Windowss7 SP1. Currently there is no solution. http://support.microsoft.com/kb/2517589 This is a major major type ADO error and it may very put an end to a large project I am working on. :-( I think I am going to have a couple of beer tonight and not even think about computers...two months of work shot and no work-around. Most of my large clients (they are banks but I do not program for them just hardware) are still using XP so I am sure they are aware of this issue and how interested will they now be in considering an upgrade? Such an error would mean millions to them. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 09, 2011 1:55 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissue s/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From listmaster at databaseadvisors.com Sat Apr 9 20:50:16 2011 From: listmaster at databaseadvisors.com (Bryan Carbonnell) Date: Sat, 9 Apr 2011 21:50:16 -0400 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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 bill_patten at embarqmail.com Sun Apr 10 01:14:18 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 9 Apr 2011 23:14:18 -0700 Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! Resent after meltdown. In-Reply-To: References: Message-ID: <67E0822B933B446893A4CD21E01864DF@BPCS> Thanks for the update Gustav, Finally showing that the problem effected more than dot net and 32/64 client issues helps, and had I known that 2 weeks ago would have probably saved me some time. I am lucky, I only have 2 clients using my ADP's at this time. Both are fully developed and are just in a maintenance mode so I don't have to work on them very much. The problem with both clients was solved by transferring the application to one of my XP machines, decompiling, and recompiling in the XP Machine and shipping to the clients. I still don't understand why some PC's worked and some didn't but now they all work. Since my machine caused the problem, (Win 7 64 SP1) I don't think I should bill my clients so I'm sure I can send the bill for 10 hours of trouble shooting and testing to Microsoft. Ya Think? Bill -------------------------------------------------- From: "Gustav Brock" Sent: Saturday, April 09, 2011 1:54 AM To: Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! Hi Bill et al There is a lengthy discussion on this here: http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/3a4ce946-effa-4f77-98a6-34f11c6b5a13 However, it doesn't add much as the essentials seem to be updated in the KB article posted below by Doug. /gustav >>> bill_patten at embarqmail.com 31-03-2011 20:27 >>> I am having similar problems with 2 clients. I just moved an ADP Access 2003 from my development machine (Win7 64 SP1 ) to an XP machine, decompiled it, set the reference to activex 2.6 from 2.7 recompiled, repair and compacted and shipped it. It now works on one machine that it did not work on. They will let me know later about the other machines as people start to use the application. What is really strange it always worked on some of their machines and we were not able to find any differences in versions or references. The second client is running it on Windows Server 2003. I have access to it using LogMeIn so will experiment tonight to see if changing the active x reference, or decompile compile on an XP machine or both fixes it. Many other people seem to be removing SP 1 from their development machines, but I'd rather not go backwards, course I've been known to cut off my nose to spite my face. If I learn anything new tonight I'll let you all know. Bill -------------------------------------------------- From: "Doug Steele" Sent: Thursday, March 31, 2011 11:09 AM To: "Access Developers discussion and problem solving" Subject: Re: [AccessD] Using ADO and Windows 7 SP1? Be careful! I believe so, from reading the discussions. I was able fix the problem by removing the ADO reference on the client machine, compiling (got errors on missing reference) then reinstating the reference and compiling once more. I'm not sure if the first compile step does anything, but it doesn't do any harm. Doug On Thu, Mar 31, 2011 at 10:47 AM, John Bartow wrote: > Hi Doug, > Just for clarification purposes, if the compiled access database running > ADO > is compiled on anything older than W7SP1 does it still work correctly on > W7SP1? > > John B. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, March 30, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO and Windows 7 SP1? Be careful! > > I had a call from a client this morning. Some code that I had written > using > ADO to write records to a back end, code which has been working for 2 or 3 > years, was crashing with a message indicating that ADO wasn't working. > Unfortunately, it was a bit of a panic situation and I didn't get a screen > dump of the message. I putzed around with the references and > re-compiling, > and got it to work. Turns out that this is probably an example of a known > problem: > > http://support.microsoft.com/kb/2517589 > > There is also a discussion (well, a bunch of bitching) about this in the > LinkedIn Access Developers group. If I understand it correctly, an Access > database using ADO which is compiled on a computer running Windows 7 SP1 > will NOT run properly on any other version of Windows. > I`m running Win7 SP1 and my client is Win7, so I guess this was the > problem. > > I wonder if I can send an invoice for my debugging time to Microsoft... > > Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Sun Apr 10 12:39:16 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Sun, 10 Apr 2011 10:39:16 -0700 Subject: [AccessD] OT - Home networking question Message-ID: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug From accessd at shaw.ca Sun Apr 10 13:32:00 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 10 Apr 2011 11:32:00 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <188AEE9832FD4C49B6748669D96F689E@creativesystemdesigns.com> Hi Doug: Off the top, as you appears to be using a simple work-group type network, with no servers, the first things to check if a computer is not seeing the network, would be one of three items: 1. The workgroup name has to be the same on all your computers. 2. The IP range has to be the same i.e. 192.168.177.xxx where xxx is a different value for every computer on the network. (Note: the value 177 can be any number but it also must be consistent network wide) 3. The subnet mask usually defaults to 255.255.255.0...check for a key-in error. If these items are checked and are consistent then we have to look at the router configuration and whether you are using your ISP as your domain controller which will make it a whole different ball of wax. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 10:39 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Sun Apr 10 13:34:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sun, 10 Apr 2011 13:34:19 -0500 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: Download nbtscan http://www.softpedia.com/progDownload/nbtscan-Download-100891.html Rename the .exe downloaded to nbtscan.exe (get rid of the version numbers in the file name) Then, from a command prompt, run: Nbtscan 192.168.0.1-255 (where this would be if the IP of your machine is 192.168.0.x (otherwise change the first three numbers to that of your network) You'll then get a list of IP addresses on your network. However, if you actually have 3 routers plugged into the hub, you may have 3 separate routers, each with their own subnet. If the routers don't know what's on the other routers, then you may not be able to communicate between networks..... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Sunday, April 10, 2011 12:39 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] OT - Home networking question Folks, I know there are several members of this group who are knowledgeable about computer networking. We have a network in our home/offices that has evolved over time. The basic configuration is that out of our cable modem there is an Ethernet hub. 3 cables come out of this hub and go to routers, one in my office in one part of the house, one in my wife's office, and one to our wifi. These have been added as requirements came about so this probably isn't the best configuration. At the present we don't use the network to access machines in other parts of the system. I have several in my office that access each other, but they are on the same router. I do want to stay with the wired systems to the offices. We just added a home security system that can be monitored over the network. It is connected to my router as it is closest to the box. I can access the system by typing in it's IP address. Now I am trying to access it from other points in the network and the IP is not visible. As you can probably tell I am network challenged. I think what I need to do is find the IP address of the security system from outside my router. How can this be done? Thanks Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Sun Apr 10 17:46:38 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 11 Apr 2011 08:46:38 +1000 Subject: [AccessD] OT - Home networking question In-Reply-To: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> Message-ID: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Mon Apr 11 11:17:08 2011 From: jedi at charm.net (Michael Bahr) Date: Mon, 11 Apr 2011 12:17:08 -0400 (EDT) Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> What Stuart suggest is a much better design. For the home, in most cases, you only need 1 router right after the modem. Then everybody else connects to the router either through wireless or switches to extend the ethernet. 1. Replace the hub with a router. 2. Replace the 3 routers (behind the hub) with switches--not hubs. Mike > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable > modem and > hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 11:27:10 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:27:10 -0400 Subject: [AccessD] New Language In-Reply-To: <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> Message-ID: <4DA32BDE.4020100@colbyconsulting.com> My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > From dw-murphy at cox.net Mon Apr 11 11:52:12 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 09:52:12 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> Message-ID: <003c01cbf868$d4127de0$7c3779a0$@cox.net> Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 11:57:17 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 12:57:17 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <4059.24.35.23.165.1302538628.squirrel@mail.expedient.net> Message-ID: <4DA332ED.5040905@colbyconsulting.com> 3) Make sure your switches are gigabit! John W. Colby www.ColbyConsulting.com On 4/11/2011 12:17 PM, Michael Bahr wrote: > What Stuart suggest is a much better design. For the home, in most cases, > you only need 1 router right after the modem. Then everybody else > connects to the router either through wireless or switches to extend the > ethernet. > > 1. Replace the hub with a router. > 2. Replace the 3 routers (behind the hub) with switches--not hubs. > > Mike > >> Are you sure that your terminology if correct? >> >> It would make more sense if you has one router attached to your cable >> modem and >> hubs/switches connected to that router from the three locations. >> >> Can you give us the make/model numbers of these devices? >> >> -- >> Stuart >> >> >> On 10 Apr 2011 at 10:39, Doug Murphy wrote: >> >>> Folks, >>> >>> I know there are several members of this group who are knowledgeable >>> about computer networking. We have a network in our home/offices that >>> has evolved over time. The basic configuration is that out of our >>> cable modem there is an Ethernet hub. 3 cables come out of this hub >>> and go to routers, one in my office in one part of the house, one in >>> my wife's office, and one to our wifi. These have been added as >>> requirements came about so this probably isn't the best configuration. >>> At the present we don't use the network to access machines in other >>> parts of the system. I have several in my office that access each >>> other, but they are on the same router. I do want to stay with the >>> wired systems to the offices. We just added a home security system >>> that can be monitored over the network. It is connected to my router >>> as it is closest to the box. I can access the system by typing in it's >>> IP address. Now I am trying to access it from other points in the >>> network and the IP is not visible. As you can probably tell I am >>> network challenged. I think what I need to do is find the IP address >>> of the security system from outside my router. How can this be done? >>> >>> Thanks >>> >>> Doug >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From kismert at gmail.com Mon Apr 11 12:10:29 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 12:10:29 -0500 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] Message-ID: John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > From accessd at shaw.ca Mon Apr 11 12:32:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 10:32:07 -0700 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: Excellent summary and words (code) to live by. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Monday, April 11, 2011 10:10 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: Autonumber when?] John, All: I'm going to expand a little on what I'm trying to get at. This post really isn't advice on what you should do. And it certainly isn't criticism. I have been returning to the old Lisp idea of functional programming: libraries of functions that act only on their inputs and only return a result. The goal is 'side-effect-free' -- inputs are NEVER modified, and external variables are never referenced. If a function needs to return complex information, it returns either a type or an object. Database functions unavoidably have side-effects, but these are regarded as 'external' to the code, and are explicitly documented. The thing that surprised me was how well libraries play with objects. Libraries provide discrete, testable chunks of code that support any instance. Libraries separate functions into common-sense groups. Classes provide an instance wrapper over the libraries, stringing functions together to support the application. Plus, it is pretty easy to convert classes to this scheme while maintaining compatibility. The advantages became apparent when I refactored some of my early monolithic classes. These large, 'kitchen sink' classes had dozens of methods which mixed database, business, and application functionality. They were unwieldy, hard-to-understand, and hard-to-extend. I simply copied the class into a module, stripped out the instance stuff (properties and module-level variables), and turned the methods into side-effect-free functions. I then stripped out the code within the original class methods, turning them into wrappers calling library functions with their instance variables. The result: classes become lightweight, making their functionality much more obvious. Compatibility is maintained, but the new system is much easier to refactor and extend. The class on-top-of function approach is also a good answer to those who want to re-use your code, but can't because they need some method that is marked private in a class. They typically demand that all methods be made public, which is usually silly because the class designer has good reasons for limiting the public visibility of certain methods or properties. But with a function library, you can have your cake and eat it, too. Classes hold the instance information, and interact with libraries in an instance-safe way, because the functions never modify their inputs. Others with different needs can call the functions directly, or write their own classes. Heck, I even find myself cramped by my own classes at times, and having the option to call underlying functions directly has benefited me. Writing test code for functions is much easier than for complex class systems. Test code provides reasonable proof of reliability. Reliable complexity can only be built out of small, simple, understandable, and testable pieces. -Ken > ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Wed, 6 Apr 2011 15:13:46 -0500 > Subject: Re: [AccessD] Autonumber when? > > > > jwcolby > > ... > > The code needs to work whether going to an MDB or SQL BE. The code works > > fine for an MDB BE but fails for a SQL BE. > > ... > > > > John, > > This is probably what you are trying to avoid, but I'll say it anyway: > > You should write separate code to handle the MDB and SQL Server BEs. > > First, the obvious: Jet and SQL Server are very different. > * It is unlikely that this is the only variation you will have to account > for throughout your code > * Variations in code make it harder to test > * When you do want to use SQL Server-specific features, like stored > procedures, you will have to split the code anyway > * I have a personal distaste of "On Error Resume Next" coding, which I use > only for object cleanup code where there is literally nothing to raise an > error to. > > All told, the cost and effort to make a large existing code base generic > will likely exceed the cost of just splitting it neatly into libraries that > support each database type. > > Plus, you get more modular, flexible, testable code. > > Again, this is what you are trying to avoid, but I felt I should say it, > anyway. > > -Ken > > > > ---------- Forwarded message ---------- > From: jwcolby > To: Access Developers discussion and problem solving < > accessd at databaseadvisors.com> > Date: Wed, 06 Apr 2011 16:38:13 -0400 > Subject: Re: [AccessD] Autonumber when? > I hear you Ken. > > I have written a framework for MDB BEs. It is very large, and has tons of > functionality, and was never intended to run against SQL Server simply > because nobody was using that back when I wrote it. > > Now I am trying to use it for a SQL Server back end. It is not just a > simple case of "write a library for this and a library for that. > Additionally I need it to work where this table (or set of tables) is kept > in an MDB and that one is moved to SQL. > > I write frameworks. The framework does a ton of stuff which is handled > automatically. It handles the not in list and the dbl click of combos for > example. The dbl click of a combo opens a form and moves to the record that > the combo is displaying. Classes instantiate classes which instantiate > classes. > > I am just not sure that "writing separate libs" is a viable option. It > would mean a complete rewrite of the framework and then a complete rewrite > of the FE. > > John W. Colby > www.ColbyConsulting.com > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 12:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 13:47:23 -0400 Subject: [AccessD] Libraries and Frameworks [Was: Autonumber when?] In-Reply-To: References: Message-ID: <4DA33EAB.70505@colbyconsulting.com> Ken, I understand the reasoning and all however... because the code is no longer contained within the object that needs it, you now open yourself up to the old "I need to modify this method... oops... that change breaks something else that uses the code". Class programming exists for a reason. Placing code in the object that needs the code exists for a reason. Black box programming exists for a reason. The reason in many cases is to prevent exactly this kind of interaction when we accidentally change a piece of code used in many places and break one of those places. Yes, there are instances where lots of different things need the exact same code, and yes, I have been known to call module functions from classes, but it truly is a questionable practice in most cases. John W. Colby www.ColbyConsulting.com On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > John, All: > > I'm going to expand a little on what I'm trying to get at. This post really > isn't advice on what you should do. And it certainly isn't criticism. > > I have been returning to the old Lisp idea of functional programming: > libraries of functions that act only on their inputs and only return a > result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > external variables are never referenced. If a function needs to return > complex information, it returns either a type or an object. Database > functions unavoidably have side-effects, but these are regarded as > 'external' to the code, and are explicitly documented. > > The thing that surprised me was how well libraries play with objects. > Libraries provide discrete, testable chunks of code that support any > instance. Libraries separate functions into common-sense groups. Classes > provide an instance wrapper over the libraries, stringing functions together > to support the application. > > Plus, it is pretty easy to convert classes to this scheme while maintaining > compatibility. > > The advantages became apparent when I refactored some of my early monolithic > classes. These large, 'kitchen sink' classes had dozens of methods which > mixed database, business, and application functionality. They were unwieldy, > hard-to-understand, and hard-to-extend. I simply copied the class into a > module, stripped out the instance stuff (properties and module-level > variables), and turned the methods into side-effect-free functions. I then > stripped out the code within the original class methods, turning them into > wrappers calling library functions with their instance variables. > > The result: classes become lightweight, making their functionality much more > obvious. Compatibility is maintained, but the new system is much easier to > refactor and extend. > > The class on-top-of function approach is also a good answer to those who > want to re-use your code, but can't because they need some method that is > marked private in a class. They typically demand that all methods be made > public, which is usually silly because the class designer has good reasons > for limiting the public visibility of certain methods or properties. > > But with a function library, you can have your cake and eat it, too. Classes > hold the instance information, and interact with libraries in an > instance-safe way, because the functions never modify their inputs. Others > with different needs can call the functions directly, or write their own > classes. Heck, I even find myself cramped by my own classes at times, and > having the option to call underlying functions directly has benefited me. > > Writing test code for functions is much easier than for complex class > systems. Test code provides reasonable proof of reliability. Reliable > complexity can only be built out of small, simple, understandable, and > testable pieces. > > -Ken > > >> ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Wed, 6 Apr 2011 15:13:46 -0500 >> Subject: Re: [AccessD] Autonumber when? >>> >>> jwcolby >>> ... >>> The code needs to work whether going to an MDB or SQL BE. The code works >>> fine for an MDB BE but fails for a SQL BE. >>> ... >>> >> >> John, >> >> This is probably what you are trying to avoid, but I'll say it anyway: >> >> You should write separate code to handle the MDB and SQL Server BEs. >> >> First, the obvious: Jet and SQL Server are very different. >> * It is unlikely that this is the only variation you will have to account >> for throughout your code >> * Variations in code make it harder to test >> * When you do want to use SQL Server-specific features, like stored >> procedures, you will have to split the code anyway >> * I have a personal distaste of "On Error Resume Next" coding, which I use >> only for object cleanup code where there is literally nothing to raise an >> error to. >> >> All told, the cost and effort to make a large existing code base generic >> will likely exceed the cost of just splitting it neatly into libraries that >> support each database type. >> >> Plus, you get more modular, flexible, testable code. >> >> Again, this is what you are trying to avoid, but I felt I should say it, >> anyway. >> >> -Ken >> >> >> >> ---------- Forwarded message ---------- >> From: jwcolby >> To: Access Developers discussion and problem solving< >> accessd at databaseadvisors.com> >> Date: Wed, 06 Apr 2011 16:38:13 -0400 >> Subject: Re: [AccessD] Autonumber when? >> I hear you Ken. >> >> I have written a framework for MDB BEs. It is very large, and has tons of >> functionality, and was never intended to run against SQL Server simply >> because nobody was using that back when I wrote it. >> >> Now I am trying to use it for a SQL Server back end. It is not just a >> simple case of "write a library for this and a library for that. >> Additionally I need it to work where this table (or set of tables) is kept >> in an MDB and that one is moved to SQL. >> >> I write frameworks. The framework does a ton of stuff which is handled >> automatically. It handles the not in list and the dbl click of combos for >> example. The dbl click of a combo opens a form and moves to the record that >> the combo is displaying. Classes instantiate classes which instantiate >> classes. >> >> I am just not sure that "writing separate libs" is a viable option. It >> would mean a complete rewrite of the framework and then a complete rewrite >> of the FE. >> >> John W. Colby >> www.ColbyConsulting.com >> >> >> From rusty.hammond at cpiqpc.com Mon Apr 11 13:00:35 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:00:35 -0500 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From rusty.hammond at cpiqpc.com Mon Apr 11 13:05:06 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Mon, 11 Apr 2011 13:05:06 -0500 Subject: [AccessD] New Language In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14C@CPIEMAIL-EVS1.CPIQPC.NET> Okay, that's my duh moment for the afternoon. I'll look at the msdn link below. Rusty -----Original Message----- From: Rusty Hammond Sent: Monday, April 11, 2011 1:01 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jimdettman at verizon.net Mon Apr 11 13:45:52 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Mon, 11 Apr 2011 14:45:52 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <003c01cbf868$d4127de0$7c3779a0$@cox.net> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> Message-ID: <4CF42796B1DC41E2B84C92485E599533@LaptopII> Doug, No need to replace the three routers; use can use them as a hub. The trick is to disable the DNS in reach, set RIP to none, and then when you connect to the one router after the cable modem, plug the cable into the LAN port (not the WAN port as it is now). This also effectively turns a Wireless Router into a simple Wireless Access point. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 11, 2011 12:52 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question Thank you Stuart, Drew and Jim, You all had similar suggestions which is probably the way the network should have been done from the start. I am going to remove the first Ethernet hub and go directly into the first router. We will then branch out from there. The reason for this mess in the first place was that I only had one cable to my office and several computers there to network together. What I am thinking would be the cleanest approach now would be to put the Ethernet hub in my office and let the router attached to the cable modem assign all our network IP addresses. Would that work? Thanks again. It is really great to have access to so much knowledge 24/7 Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Sunday, April 10, 2011 3:47 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question Are you sure that your terminology if correct? It would make more sense if you has one router attached to your cable modem and hubs/switches connected to that router from the three locations. Can you give us the make/model numbers of these devices? -- Stuart On 10 Apr 2011 at 10:39, Doug Murphy wrote: > Folks, > > I know there are several members of this group who are knowledgeable > about computer networking. We have a network in our home/offices that > has evolved over time. The basic configuration is that out of our > cable modem there is an Ethernet hub. 3 cables come out of this hub > and go to routers, one in my office in one part of the house, one in > my wife's office, and one to our wifi. These have been added as > requirements came about so this probably isn't the best configuration. > At the present we don't use the network to access machines in other > parts of the system. I have several in my office that access each > other, but they are on the same router. I do want to stay with the > wired systems to the offices. We just added a home security system > that can be monitored over the network. It is connected to my router > as it is closest to the box. I can access the system by typing in it's > IP address. Now I am trying to access it from other points in the > network and the IP is not visible. As you can probably tell I am > network challenged. I think what I need to do is find the IP address > of the security system from outside my router. How can this be done? > > Thanks > > Doug > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Mon Apr 11 14:14:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:14:50 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3532A.9040606@colbyconsulting.com> And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From jwcolby at colbyconsulting.com Mon Apr 11 14:16:12 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 15:16:12 -0400 Subject: [AccessD] OT - Home networking question In-Reply-To: <4CF42796B1DC41E2B84C92485E599533@LaptopII> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> Message-ID: <4DA3537C.7010509@colbyconsulting.com> Oh... some routers use 192.168.1.xx instead of 1.9.168.0.xx in which case you have to modify my previous advice to match what your router uses. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > From accessd at shaw.ca Mon Apr 11 14:58:10 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 12:58:10 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> My daughters have all grown up with computers. From childhood, their rooms have been wired for computers...coax cable and all. My oldest daughter learned to type on the keyboard before she could talk. She would sit in my lap and enter the keys as I called them out. She could start up the Commodore 64 and load games from memory. My youngest daughter made her first web site when she was ten, a Sailor-moon site. ;-) At that time she used notepad to build her site and she knew more about web sites and HTML coding than I did. Today, both my daughters are married or in a long term relationship with programmers (both with a least one degree in computer science) and they all work in the business; one in computer graphic designer (and fashion design) and two in animation and one as an application developer but if pushed the girls are both pretty good programmers (At the age of 15 my oldest daughter was short-listed in a job competition and the company sent her their whole software line as a consolation...It was Blizzard software with Warcraft etc.) The one I feel sorry for is my wife Maria who totally non-computer literate and has to listen to rest of the family talk shop and coding etc. at ever family gathering. I really hope your wife likes computers. ;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 9:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 15:02:08 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 13:02:08 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <4DA3532A.9040606@colbyconsulting.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> Message-ID: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. The > trick is to disable the DNS in reach, set RIP to none, and then when you > connect to the one router after the cable modem, plug the cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple Wireless > Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet hub > and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the Ethernet hub > in my office and let the router attached to the cable modem assign all our > network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in it's >> IP address. Now I am trying to access it from other points in the >> network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Mon Apr 11 15:09:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Mon, 11 Apr 2011 15:09:32 -0500 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: John, I understand the reasoning and all however... because the code is no longer > contained within the object that needs it, you now open yourself up to the > old "I need to modify this method... oops... that change breaks something > else that uses the code". > It is always possible to over-factor, and merge two similar pieces of code together that really should be separate. In that case, you factor the code back into multiple pieces, and correct the dependencies. > Class programming exists for a reason. Placing code in the object that > needs the code exists for a reason. Black box programming exists for a > reason. The reason in many cases is to prevent exactly this kind of > interaction when we accidentally change a piece of code used in many places > and break one of those places. > I would submit that calling side-effect free functions from a class does not pierce the black box. The important things, state and access, are protected by the class. But the function can be anywhere: built-in VBA functions, Access application methods, or DAO library calls. You undoubtedly call these functions from within your classes. > Yes, there are instances where lots of different things need the exact same > code, and yes, I have been known to call module functions from classes, but > it truly is a questionable practice in most cases. > Test cases replace questionability with a guarantee of proper function. The function shouldn't define what it does -- the test cases should. If changes to a function break a test, then you know immediately that there is a problem. Functional unit testing guards against changes that would break dependent code. I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. -Ken > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > >> John, All: >> >> I'm going to expand a little on what I'm trying to get at. This post >> really >> isn't advice on what you should do. And it certainly isn't criticism. >> >> I have been returning to the old Lisp idea of functional programming: >> libraries of functions that act only on their inputs and only return a >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> external variables are never referenced. If a function needs to return >> complex information, it returns either a type or an object. Database >> functions unavoidably have side-effects, but these are regarded as >> 'external' to the code, and are explicitly documented. >> >> The thing that surprised me was how well libraries play with objects. >> Libraries provide discrete, testable chunks of code that support any >> instance. Libraries separate functions into common-sense groups. Classes >> provide an instance wrapper over the libraries, stringing functions >> together >> to support the application. >> >> Plus, it is pretty easy to convert classes to this scheme while >> maintaining >> compatibility. >> >> The advantages became apparent when I refactored some of my early >> monolithic >> classes. These large, 'kitchen sink' classes had dozens of methods which >> mixed database, business, and application functionality. They were >> unwieldy, >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> module, stripped out the instance stuff (properties and module-level >> variables), and turned the methods into side-effect-free functions. I then >> stripped out the code within the original class methods, turning them into >> wrappers calling library functions with their instance variables. >> >> The result: classes become lightweight, making their functionality much >> more >> obvious. Compatibility is maintained, but the new system is much easier to >> refactor and extend. >> >> The class on-top-of function approach is also a good answer to those who >> want to re-use your code, but can't because they need some method that is >> marked private in a class. They typically demand that all methods be made >> public, which is usually silly because the class designer has good reasons >> for limiting the public visibility of certain methods or properties. >> >> But with a function library, you can have your cake and eat it, too. >> Classes >> hold the instance information, and interact with libraries in an >> instance-safe way, because the functions never modify their inputs. Others >> with different needs can call the functions directly, or write their own >> classes. Heck, I even find myself cramped by my own classes at times, and >> having the option to call underlying functions directly has benefited me. >> >> Writing test code for functions is much easier than for complex class >> systems. Test code provides reasonable proof of reliability. Reliable >> complexity can only be built out of small, simple, understandable, and >> testable pieces. >> >> -Ken >> >> From charlotte.foust at gmail.com Mon Apr 11 15:22:19 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 13:22:19 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: I have to say, that I would put those module level functions into a utility class and call the class method. I don't like calling module level stuff from a class. The built in things you call are already part of a library/dll so it isn't the same. Charlotte Foust On Mon, Apr 11, 2011 at 1:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. ?Placing code in the object that >> needs the code exists for a reason. ?Black box programming exists for a >> reason. ?The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. ?Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Mon Apr 11 15:25:26 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:25:26 -0400 Subject: [AccessD] New Language In-Reply-To: <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> Message-ID: <4DA363B6.8000005@colbyconsulting.com> My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim From jwcolby at colbyconsulting.com Mon Apr 11 15:36:04 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 11 Apr 2011 16:36:04 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA36634.3080604@colbyconsulting.com> > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object that >> needs the code exists for a reason. Black box programming exists for a >> reason. The reason in many cases is to prevent exactly this kind of >> interaction when we accidentally change a piece of code used in many places >> and break one of those places. >> > > I would submit that calling side-effect free functions from a class does not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call these > functions from within your classes. > > >> Yes, there are instances where lots of different things need the exact same >> code, and yes, I have been known to call module functions from classes, but >> it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really >>> isn't advice on what you should do. And it certainly isn't criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return a >>> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >>> external variables are never referenced. If a function needs to return >>> complex information, it returns either a type or an object. Database >>> functions unavoidably have side-effects, but these are regarded as >>> 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. Classes >>> provide an instance wrapper over the libraries, stringing functions >>> together >>> to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining >>> compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic >>> classes. These large, 'kitchen sink' classes had dozens of methods which >>> mixed database, business, and application functionality. They were >>> unwieldy, >>> hard-to-understand, and hard-to-extend. I simply copied the class into a >>> module, stripped out the instance stuff (properties and module-level >>> variables), and turned the methods into side-effect-free functions. I then >>> stripped out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality much >>> more >>> obvious. Compatibility is maintained, but the new system is much easier to >>> refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those who >>> want to re-use your code, but can't because they need some method that is >>> marked private in a class. They typically demand that all methods be made >>> public, which is usually silly because the class designer has good reasons >>> for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. Others >>> with different needs can call the functions directly, or write their own >>> classes. Heck, I even find myself cramped by my own classes at times, and >>> having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex class >>> systems. Test code provides reasonable proof of reliability. Reliable >>> complexity can only be built out of small, simple, understandable, and >>> testable pieces. >>> >>> -Ken >>> >>> From dw-murphy at cox.net Mon Apr 11 15:42:36 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 13:42:36 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <006c01cbf888$fded7730$f9c86590$@cox.net> Great info. Thanks guys. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Apr 11 16:59:04 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 01:59:04 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA36634.3080604@colbyconsulting.com> References: <4DA36634.3080604@colbyconsulting.com> Message-ID: <85CF23CEAE904982B6ED4556F847CB7B@nant> <<< I doubt seriously that anyone uses your paradigm in .net. >>> http://fsharp.net ? -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 12 ?????? 2011 ?. 0:36 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > I haven't found a reason why classes can't rely on properly crafted and tested module-level functions. Do you program in .Net? Everything is an object. There is no "module", though there can be static classes / functions. I haven't done a poll, but I doubt seriously that anyone uses your paradigm in .net. John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no > longer >> contained within the object that needs it, you now open yourself up >> to the old "I need to modify this method... oops... that change >> breaks something else that uses the code". >> > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > >> Class programming exists for a reason. Placing code in the object >> that needs the code exists for a reason. Black box programming >> exists for a reason. The reason in many cases is to prevent exactly >> this kind of interaction when we accidentally change a piece of code >> used in many places and break one of those places. >> > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > >> Yes, there are instances where lots of different things need the >> exact same code, and yes, I have been known to call module functions >> from classes, but it truly is a questionable practice in most cases. >> > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> >>> John, All: >>> >>> I'm going to expand a little on what I'm trying to get at. This post >>> really isn't advice on what you should do. And it certainly isn't >>> criticism. >>> >>> I have been returning to the old Lisp idea of functional programming: >>> libraries of functions that act only on their inputs and only return >>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>> modified, and external variables are never referenced. If a function >>> needs to return complex information, it returns either a type or an >>> object. Database functions unavoidably have side-effects, but these >>> are regarded as 'external' to the code, and are explicitly documented. >>> >>> The thing that surprised me was how well libraries play with objects. >>> Libraries provide discrete, testable chunks of code that support any >>> instance. Libraries separate functions into common-sense groups. >>> Classes provide an instance wrapper over the libraries, stringing >>> functions together to support the application. >>> >>> Plus, it is pretty easy to convert classes to this scheme while >>> maintaining compatibility. >>> >>> The advantages became apparent when I refactored some of my early >>> monolithic classes. These large, 'kitchen sink' classes had dozens >>> of methods which mixed database, business, and application >>> functionality. They were unwieldy, hard-to-understand, and >>> hard-to-extend. I simply copied the class into a module, stripped >>> out the instance stuff (properties and module-level variables), and >>> turned the methods into side-effect-free functions. I then stripped >>> out the code within the original class methods, turning them into >>> wrappers calling library functions with their instance variables. >>> >>> The result: classes become lightweight, making their functionality >>> much more obvious. Compatibility is maintained, but the new system >>> is much easier to refactor and extend. >>> >>> The class on-top-of function approach is also a good answer to those >>> who want to re-use your code, but can't because they need some >>> method that is marked private in a class. They typically demand that >>> all methods be made public, which is usually silly because the class >>> designer has good reasons for limiting the public visibility of certain methods or properties. >>> >>> But with a function library, you can have your cake and eat it, too. >>> Classes >>> hold the instance information, and interact with libraries in an >>> instance-safe way, because the functions never modify their inputs. >>> Others with different needs can call the functions directly, or >>> write their own classes. Heck, I even find myself cramped by my own >>> classes at times, and having the option to call underlying functions directly has benefited me. >>> >>> Writing test code for functions is much easier than for complex >>> class systems. Test code provides reasonable proof of reliability. >>> Reliable complexity can only be built out of small, simple, >>> understandable, and testable pieces. >>> >>> -Ken >>> >>> -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Mon Apr 11 17:07:07 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Mon, 11 Apr 2011 15:07:07 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA363B6.8000005@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> Message-ID: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> It sounds like your daughter has a very rare disease and her life will be very challenged. It does appear that she is growing up in the best environment and will be able to reach her full potential. It seems that she has achieved a great deal and has an almost gifted ability with computers. Your little scientist sounds like he is off to a great start and with you as his father his success is assured. Now I had better watch out for the Off Topic police...;-) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My daughter Allie will turn 8 in June. She has a genetic duplication meaning that she has 2 copies of a section of one gene. Bad news, it causes low intellectual functioning - IQ ~ 70, speech apraxia, general muscle planning problems etc. But Allie knows how to use the computer. She cannot type (or read very well yet) but she can play her games, gets on YouTube and watches videos, she can navigate the interface for the Windows 7 video center etc. Her teachers are amazed at her computer skills. Her favorite thing in all the world is to do the scanning of our stuff at checkout at the grocery store. :) She has most of the checkers wrapped around her finger. ;) Robbie OTOH is a marginally gifted little guy, very bright. A little scientist / engineer, loves anything in that area of knowledge. With luck he will be a doctor and support me in my old age. ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 3:58 PM, Jim Lawrence wrote: > My daughters have all grown up with computers. From childhood, their rooms > have been wired for computers...coax cable and all. My oldest daughter > learned to type on the keyboard before she could talk. She would sit in my > lap and enter the keys as I called them out. She could start up the > Commodore 64 and load games from memory. > > My youngest daughter made her first web site when she was ten, a Sailor-moon > site. ;-) At that time she used notepad to build her site and she knew more > about web sites and HTML coding than I did. > > Today, both my daughters are married or in a long term relationship with > programmers (both with a least one degree in computer science) and they all > work in the business; one in computer graphic designer (and fashion design) > and two in animation and one as an application developer but if pushed the > girls are both pretty good programmers (At the age of 15 my oldest daughter > was short-listed in a job competition and the company sent her their whole > software line as a consolation...It was Blizzard software with Warcraft > etc.) > > The one I feel sorry for is my wife Maria who totally non-computer literate > and has to listen to rest of the family talk shop and coding etc. at ever > family gathering. > > I really hope your wife likes computers. ;-) > > Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Mon Apr 11 18:35:02 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 12 Apr 2011 09:35:02 +1000 Subject: [AccessD] New Language In-Reply-To: <4DA32BDE.4020100@colbyconsulting.com> Message-ID: <201104112335.p3BNZAnu007707@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Hi John, My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. good luck John, keep keeping us informed on your progress here. regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, 12 April 2011 2:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want something easy to > use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From BradM at blackforestltd.com Mon Apr 11 20:04:51 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Mon, 11 Apr 2011 20:04:51 -0500 Subject: [AccessD] New Language References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Mon Apr 11 20:17:17 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Mon, 11 Apr 2011 18:17:17 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no "module", > though there can be static classes / functions. ?I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Mon Apr 11 21:39:31 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 11 Apr 2011 19:39:31 -0700 Subject: [AccessD] OT - Home networking question In-Reply-To: <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> References: <001801cbf7a6$368e0520$a3aa0f60$@cox.net> <4DA2334E.26093.19BCEA17@stuart.lexacorp.com.pg> <003c01cbf868$d4127de0$7c3779a0$@cox.net> <4CF42796B1DC41E2B84C92485E599533@LaptopII> <4DA3532A.9040606@colbyconsulting.com> <554CC7ED20BA4871B75B413423AD834A@creativesystemdesigns.com> Message-ID: <000301cbf8ba$d9f66440$8de32cc0$@cox.net> Thanks all. A few of your suggested tweaks and all is good. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, April 11, 2011 1:02 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] OT - Home networking question PS: Always save your router setting after the changes have been perfected. So if anything blows up it will only take you minutes instead of days to recover. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] OT - Home networking question And set the router interface page to a new address. Typically the router answers up on 192.168.0.1. Obviously if you have two of these things, the second has to answer up somewhere else - I usually do 192.168.0.2, 192.168.0.3 etc. In order to set that part, you have to plug the router directly into a disconnected laptop or pc. That allows the disconnected computer to "talk to" 192.168.0.1 on the "second" or alternate router long enough to tell that router to answer up on an alternate address. And then never do a factory reset... or you will have to do this all over. John W. Colby www.ColbyConsulting.com On 4/11/2011 2:45 PM, Jim Dettman wrote: > Doug, > > No need to replace the three routers; use can use them as a hub. > The trick is to disable the DNS in reach, set RIP to none, and then > when you connect to the one router after the cable modem, plug the > cable into the LAN > port (not the WAN port as it is now). > > This also effectively turns a Wireless Router into a simple > Wireless Access point. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy > Sent: Monday, April 11, 2011 12:52 PM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] OT - Home networking question > > Thank you Stuart, Drew and Jim, > > You all had similar suggestions which is probably the way the network should > have been done from the start. I am going to remove the first Ethernet > hub and go directly into the first router. We will then branch out from there. > The reason for this mess in the first place was that I only had one > cable to > my office and several computers there to network together. What I am > thinking would be the cleanest approach now would be to put the > Ethernet hub > in my office and let the router attached to the cable modem assign all > our network IP addresses. Would that work? > > Thanks again. It is really great to have access to so much knowledge > 24/7 > > Doug > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan > Sent: Sunday, April 10, 2011 3:47 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] OT - Home networking question > > Are you sure that your terminology if correct? > > It would make more sense if you has one router attached to your cable modem > and hubs/switches connected to that router from the three locations. > > Can you give us the make/model numbers of these devices? > > -- > Stuart > > > On 10 Apr 2011 at 10:39, Doug Murphy wrote: > >> Folks, >> >> I know there are several members of this group who are knowledgeable >> about computer networking. We have a network in our home/offices that >> has evolved over time. The basic configuration is that out of our >> cable modem there is an Ethernet hub. 3 cables come out of this hub >> and go to routers, one in my office in one part of the house, one in >> my wife's office, and one to our wifi. These have been added as >> requirements came about so this probably isn't the best configuration. >> At the present we don't use the network to access machines in other >> parts of the system. I have several in my office that access each >> other, but they are on the same router. I do want to stay with the >> wired systems to the offices. We just added a home security system >> that can be monitored over the network. It is connected to my router >> as it is closest to the box. I can access the system by typing in >> it's IP address. Now I am trying to access it from other points in >> the network and the IP is not visible. As you can probably tell I am >> network challenged. I think what I need to do is find the IP address >> of the security system from outside my router. How can this be done? >> >> Thanks >> >> Doug >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 00:58:20 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 09:58:20 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA36634.3080604@colbyconsulting.com><85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: Hi Charlotte -- No, wait - in fact VB.NET and C# do support first-order functional programming paradigms (LINQ and related stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html And here they say that MS Excel is a kind of functional programming environment http://en.wikipedia.org/wiki/Functional_programming So you should know and use them for quite some time already - foundations of functional programming paradigm... :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: 12 ?????? 2011 ?. 5:17 To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 OMG, I think I got let go just in time!! I'm too old for another whole new paradigm. Charlotte Foust On Mon, Apr 11, 2011 at 2:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net. >>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > ?> I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > Do you program in .Net? ?Everything is an object. ?There is no > "module", though there can be static classes / functions. ?I haven't > done a poll, but I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you >> factor the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. ?Placing code in the object >>> that needs the code exists for a reason. ?Black box programming >>> exists for a reason. ?The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and >> access, are protected by the class. But the function can be anywhere: >> built-in VBA functions, Access application methods, or DAO library >> calls. You undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test >> cases should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This >>>> post really isn't advice on what you should do. And it certainly >>>> isn't criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only >>>> return a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a >>>> function needs to return complex information, it returns either a >>>> type or an object. Database functions unavoidably have >>>> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support >>>> any instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to >>>> those who want to re-use your code, but can't because they need >>>> some method that is marked private in a class. They typically >>>> demand that all methods be made public, which is usually silly >>>> because the class designer has good reasons for limiting the public >>>> visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying >>>> functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> From jwcolby at colbyconsulting.com Tue Apr 12 05:18:31 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:18:31 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <85CF23CEAE904982B6ED4556F847CB7B@nant> References: <4DA36634.3080604@colbyconsulting.com> <85CF23CEAE904982B6ED4556F847CB7B@nant> Message-ID: <4DA426F7.7000803@colbyconsulting.com> Well, now we are all happy! ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 5:59 PM, Shamil Salakhetdinov wrote: > <<< I doubt seriously that anyone uses your paradigm in .net.>>> > > http://fsharp.net ? > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 12 ?????? 2011 ?. 0:36 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > Do you program in .Net? Everything is an object. There is no "module", > though there can be static classes / functions. I haven't done a poll, but > I doubt seriously that anyone uses your paradigm in .net. > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no >> longer >>> contained within the object that needs it, you now open yourself up >>> to the old "I need to modify this method... oops... that change >>> breaks something else that uses the code". >>> >> >> It is always possible to over-factor, and merge two similar pieces of >> code together that really should be separate. In that case, you factor >> the code back into multiple pieces, and correct the dependencies. >> >> >>> Class programming exists for a reason. Placing code in the object >>> that needs the code exists for a reason. Black box programming >>> exists for a reason. The reason in many cases is to prevent exactly >>> this kind of interaction when we accidentally change a piece of code >>> used in many places and break one of those places. >>> >> >> I would submit that calling side-effect free functions from a class >> does not pierce the black box. The important things, state and access, >> are protected by the class. But the function can be anywhere: built-in >> VBA functions, Access application methods, or DAO library calls. You >> undoubtedly call these functions from within your classes. >> >> >>> Yes, there are instances where lots of different things need the >>> exact same code, and yes, I have been known to call module functions >>> from classes, but it truly is a questionable practice in most cases. >>> >> >> Test cases replace questionability with a guarantee of proper >> function. The function shouldn't define what it does -- the test cases >> should. If changes to a function break a test, then you know >> immediately that there is a problem. Functional unit testing guards >> against changes that would break dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted >> and tested module-level functions. >> >> -Ken >> >> >>> >>> John W. Colby >>> www.ColbyConsulting.com >>> >>> On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >>> >>>> John, All: >>>> >>>> I'm going to expand a little on what I'm trying to get at. This post >>>> really isn't advice on what you should do. And it certainly isn't >>>> criticism. >>>> >>>> I have been returning to the old Lisp idea of functional programming: >>>> libraries of functions that act only on their inputs and only return >>>> a result. The goal is 'side-effect-free' -- inputs are NEVER >>>> modified, and external variables are never referenced. If a function >>>> needs to return complex information, it returns either a type or an >>>> object. Database functions unavoidably have side-effects, but these >>>> are regarded as 'external' to the code, and are explicitly documented. >>>> >>>> The thing that surprised me was how well libraries play with objects. >>>> Libraries provide discrete, testable chunks of code that support any >>>> instance. Libraries separate functions into common-sense groups. >>>> Classes provide an instance wrapper over the libraries, stringing >>>> functions together to support the application. >>>> >>>> Plus, it is pretty easy to convert classes to this scheme while >>>> maintaining compatibility. >>>> >>>> The advantages became apparent when I refactored some of my early >>>> monolithic classes. These large, 'kitchen sink' classes had dozens >>>> of methods which mixed database, business, and application >>>> functionality. They were unwieldy, hard-to-understand, and >>>> hard-to-extend. I simply copied the class into a module, stripped >>>> out the instance stuff (properties and module-level variables), and >>>> turned the methods into side-effect-free functions. I then stripped >>>> out the code within the original class methods, turning them into >>>> wrappers calling library functions with their instance variables. >>>> >>>> The result: classes become lightweight, making their functionality >>>> much more obvious. Compatibility is maintained, but the new system >>>> is much easier to refactor and extend. >>>> >>>> The class on-top-of function approach is also a good answer to those >>>> who want to re-use your code, but can't because they need some >>>> method that is marked private in a class. They typically demand that >>>> all methods be made public, which is usually silly because the class >>>> designer has good reasons for limiting the public visibility of certain > methods or properties. >>>> >>>> But with a function library, you can have your cake and eat it, too. >>>> Classes >>>> hold the instance information, and interact with libraries in an >>>> instance-safe way, because the functions never modify their inputs. >>>> Others with different needs can call the functions directly, or >>>> write their own classes. Heck, I even find myself cramped by my own >>>> classes at times, and having the option to call underlying functions > directly has benefited me. >>>> >>>> Writing test code for functions is much easier than for complex >>>> class systems. Test code provides reasonable proof of reliability. >>>> Reliable complexity can only be built out of small, simple, >>>> understandable, and testable pieces. >>>> >>>> -Ken >>>> >>>> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 12 05:50:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 06:50:28 -0400 Subject: [AccessD] New Language In-Reply-To: <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> Message-ID: <4DA42E74.6040007@colbyconsulting.com> > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim From jwcolby at colbyconsulting.com Tue Apr 12 08:03:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 09:03:11 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: Message-ID: <4DA44D8F.7060106@colbyconsulting.com> I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... From jimdettman at verizon.net Tue Apr 12 09:09:29 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 12 Apr 2011 10:09:29 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: <4DA44D8F.7060106@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up to the >> old "I need to modify this method... oops... that change breaks something >> else that uses the code". ... -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rusty.hammond at cpiqpc.com Tue Apr 12 09:15:00 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 12 Apr 2011 09:15:00 -0500 Subject: [AccessD] New Language In-Reply-To: References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net>, <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg><4DA32BDE.4020100@colbyconsulting.com><49A286ABF515E94A8505CD14DEB721700DCFE14B@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE14E@CPIEMAIL-EVS1.CPIQPC.NET> Thanks Brad. That looks promising. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Monday, April 11, 2011 8:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Rusty, You might want to check out alice.org Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of Rusty Hammond Sent: Mon 4/11/2011 1:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language I have a nine year old wanting to start creating games on a website. I've only dabbled in websites and haven't looked at game programming in years. Any ideas on where to start? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From jwcolby at colbyconsulting.com Tue Apr 12 09:54:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 10:54:11 -0400 Subject: [AccessD] New Language In-Reply-To: <201104112335.p3BNZAnu007707@databaseadvisors.com> References: <201104112335.p3BNZAnu007707@databaseadvisors.com> Message-ID: <4DA46793.6090507@colbyconsulting.com> from http://en.wikipedia.org/wiki/BASIC The eight design principles of BASIC were: 1. Be easy for beginners to use. 2. Be a general-purpose programming language. 3. Allow advanced features to be added for experts (while keeping the language simple for beginners). 4. Be interactive. 5. Provide clear and friendly error messages. 6. Respond quickly for small programs. 7. Not to require an understanding of computer hardware. 8. Shield the user from the operating system. There are phases in learning to program. 0) Selecting a learning tool 1) learning programming concepts, keywords and constructs (loops / tests) 2) coming up with an idea of something to program 3) selecting a tool to implement the idea 4) Learning the tool 5) Implementing that idea 6) Go to 1 Whether or not basic will be around in the future it is a good language for starting to learn to program. IMHO, more than anything else, the programming environment and specifically the ease or difficulty of use of that environment determines the success of learning to program. Access and VBA is certainly not the easiest to use environment, but it is still very easy. Creating a database is easy. Creating a new module is easy. Creating a form and button and text box is easy. You can progress one step at a time. 1) Here is how to build a database container. 2) Here is how to create a module and save it 3) Here is how to open that module and add a function 4) Here is the debug window - how to execute that method and see a result. etc. The advantage of starting in Access is that while you are at it, you're teaching the concepts in a real life environment, which has enormous power to "go to the next step" particular in database applications. 5) here is how to create a table (and what a table is) 6) Fields 7) open and enter data (cool, the data is stored!) All tightly integrated. 8) Here is a form and a button. 9) here is the code that runs when the button is clicked. easy to move on to more stuff, interesting stuff, stuff that can earn Dad money... ;) John W. Colby www.ColbyConsulting.com On 4/11/2011 7:35 PM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > Hi John, > > My only concern would be that VBA is (probably) a slowly dying language - or at least being phased out by .net etc. Mind you the principles of good programming are similar regardless of the language. Interested to hear about this as one day it will be my turn to teach my kids. The oldest is only 3 but already he enjoys poking around on the computer. "Work" he calls it. > > good luck John, keep keeping us informed on your progress here. > > regards > Darryl. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, 12 April 2011 2:27 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My 10 year old son is independently and without prompting asking dad to teach him how to program a > computer. :) > > It appears that he has decided that what dad does is pretty cool. > > Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. > IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute > code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things > like a simple "add two numbers" first project. > > Does anyone want to share "teaching the kids" stories? > > John W. Colby > www.ColbyConsulting.com > > On 3/25/2011 5:41 PM, Stuart McLachlan wrote: >> For all you people who are looking at moving away from Acces who want something easy to >> use and are wedded to the .Net world, MS have just the thing for you: >> >> http://msdn.microsoft.com/en-us/beginner/ff384126.aspx >> >> :-) >> >> >> From bheygood at abestsystems.com Tue Apr 12 10:34:43 2011 From: bheygood at abestsystems.com (b heygood) Date: Tue, 12 Apr 2011 08:34:43 -0700 Subject: [AccessD] Administrivia - DBA Server Downtime In-Reply-To: References: Message-ID: <669B553C66A64AB6924FBE3758A17756@Seven> thanks for all your work. bob heygood -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell Sent: Saturday, April 09, 2011 6:50 PM To: administrivia at databaseadvisors.com Subject: [AccessD] Administrivia - DBA Server Downtime Good Saturday Evening folks, Today, Saturday April 9, 2011, the server that hosts Database Advisors Mailing lists, had a minor meltdown. We had about 18 hours of down time, from about 6 am ET to about 9pm ET. During that time, emails sent to any of the lists MAY have been lost. If you sent an email to any of the lists during this time, and haven't seen it by Sunday morning, please resend it, as it may have been a victim of the meltdown. We apologise for any inconvenience this may have caused you. Your humble listmaster, Bryan -- 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!" -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From kismert at gmail.com Tue Apr 12 10:38:39 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 10:38:39 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: >Charlotte Foust: > I have to say, that I would put those module level functions into a > utility class and call the class method. I don't like calling module > level stuff from a class. The built in things you call are already > part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is > no "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses > your paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support first-order > functional programming paradigms (LINQ and related stuff...) > http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional > programming environment > http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > John, > > I understand the reasoning and all however... because the code is no longer > > contained within the object that needs it, you now open yourself up to > the > > old "I need to modify this method... oops... that change breaks something > > else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of code > together that really should be separate. In that case, you factor the code > back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object that > > needs the code exists for a reason. Black box programming exists for a > > reason. The reason in many cases is to prevent exactly this kind of > > interaction when we accidentally change a piece of code used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class does > not > pierce the black box. The important things, state and access, are protected > by the class. But the function can be anywhere: built-in VBA functions, > Access application methods, or DAO library calls. You undoubtedly call > these > functions from within your classes. > > > > Yes, there are instances where lots of different things need the exact > same > > code, and yes, I have been known to call module functions from classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper function. The > function shouldn't define what it does -- the test cases should. If changes > to a function break a test, then you know immediately that there is a > problem. Functional unit testing guards against changes that would break > dependent code. > > I haven't found a reason why classes can't rely on properly crafted and > tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This post > >> really > >> isn't advice on what you should do. And it certainly isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only return a > >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and > >> external variables are never referenced. If a function needs to return > >> complex information, it returns either a type or an object. Database > >> functions unavoidably have side-effects, but these are regarded as > >> 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support any > >> instance. Libraries separate functions into common-sense groups. Classes > >> provide an instance wrapper over the libraries, stringing functions > >> together > >> to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining > >> compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic > >> classes. These large, 'kitchen sink' classes had dozens of methods which > >> mixed database, business, and application functionality. They were > >> unwieldy, > >> hard-to-understand, and hard-to-extend. I simply copied the class into a > >> module, stripped out the instance stuff (properties and module-level > >> variables), and turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality much > >> more > >> obvious. Compatibility is maintained, but the new system is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to those who > >> want to re-use your code, but can't because they need some method that > is > >> marked private in a class. They typically demand that all methods be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write their own > >> classes. Heck, I even find myself cramped by my own classes at times, > and > >> having the option to call underlying functions directly has benefited > me. > >> > >> Writing test code for functions is much easier than for complex class > >> systems. Test code provides reasonable proof of reliability. Reliable > >> complexity can only be built out of small, simple, understandable, and > >> testable pieces. > >> > >> -Ken > From jwcolby at colbyconsulting.com Tue Apr 12 11:03:54 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 12:03:54 -0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA477EA.3010002@colbyconsulting.com> My question is, why do regression testing if we never regress? I write these functions and they are done. They work or they don't. We are currently testing them manually. Take the flag class, dead simple. It reads / writes to SQL server or it doesn't. We test the flag by actually using it and watching that the flag sets. It works, it is used forever. That is a simple example but the concept extends. It is not that we do not test, we do but once these functions work we are not modifying them. Actually in fact, we do paradigm changes (code functions custom written to read / write the flags in SQL Server to a flag class), but even here, the new flag class entirely replaces a couple of dozen functions, each of which wrote one flag. I would like to stress that it is not testing that I question, it is not unit testing that I question, it is when and where it might be applied, and when and where it is more trouble than it is worth. John W. Colby www.ColbyConsulting.com On 4/12/2011 10:09 AM, Jim Dettman wrote: > John, > > If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > For example, I develop a customer class, which handles CRUD operations for > customers. > > As result, I would develop four separate basic unit tests for that object: > > 1. Adding a record. > 2. Deleting a record. > 3. Reading a record. > 4. Updating a record. > > Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. A function > can be made to accept > args and return a value and never modify anything external to itself. It > would make programming > some functionality much more complicated however. Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. The > process builds that. No flag > is used, we just ask SQL server whether the objects exist and create them if > not. When we *fill* > that table, a piece of SQL code executed in a function. That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. *IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. The function itself does not modify the parameters passed > in. It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. I went to a > great deal of effort to get all of this stuff working this way. I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. I am not sitting at a desk collecting a paycheck regardless of what > I produce. I do not > have a test department, I am the test department. I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... From accessd at shaw.ca Tue Apr 12 12:39:27 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 10:39:27 -0700 Subject: [AccessD] New Language In-Reply-To: <4DA42E74.6040007@colbyconsulting.com> References: <001601cbeb05$428fdf40$c7af9dc0$@comcast.net> <4D8D0C15.22575.420F903@stuart.lexacorp.com.pg> <4DA32BDE.4020100@colbyconsulting.com> <50F386C3B8184CF5904736DADE2B2124@creativesystemdesigns.com> <4DA363B6.8000005@colbyconsulting.com> <68AD796E771B449887C56C8CF7A4ACAD@creativesystemdesigns.com> <4DA42E74.6040007@colbyconsulting.com> Message-ID: Wasn't it Henry Fonda that said, and allow me to paraphrase, "The most successful people are either very smart or very nice." I wish you daughter well. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 3:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language > It sounds like your daughter has a very rare disease and her life will be very challenged. Allie has Williams Region Duplication Syndrome. The Williams Region was discovered back in the 60s when it was determined that some people had a genetic deletion - mission part of that gene. Doctors have been able to find genetic deletions since the 60s apparently, and always suspected that where there is a deletion there is a weak point in the gene and that probably there would be duplications - perhaps in the same numbers as deletions. However they didn't have the tools to *find* or see the duplications. About 5 years ago they they started creating such tools. Allie was about the 40th person in the United States and about the 100th world wide that was *diagnosed* with this duplication syndrome, however the doctors suspect that there are many more that are just undiagnosed. And yes, her life will be challenging for sure. What she has going for her is that she is cheerful by nature, quite cute and everyone loves her. She just has that effect on everyone around her. That will get her a long way in life. John W. Colby www.ColbyConsulting.com On 4/11/2011 6:07 PM, Jim Lawrence wrote: > It sounds like your daughter has a very rare disease and her life will be > very challenged. It does appear that she is growing up in the best > environment and will be able to reach her full potential. It seems that she > has achieved a great deal and has an almost gifted ability with computers. > > Your little scientist sounds like he is off to a great start and with you as > his father his success is assured. > > Now I had better watch out for the Off Topic police...;-) > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Monday, April 11, 2011 1:25 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] New Language > > My daughter Allie will turn 8 in June. She has a genetic duplication > meaning that she has 2 copies > of a section of one gene. Bad news, it causes low intellectual functioning > - IQ ~ 70, speech > apraxia, general muscle planning problems etc. > > But Allie knows how to use the computer. She cannot type (or read very well > yet) but she can play > her games, gets on YouTube and watches videos, she can navigate the > interface for the Windows 7 > video center etc. Her teachers are amazed at her computer skills. > > Her favorite thing in all the world is to do the scanning of our stuff at > checkout at the grocery > store. :) > > She has most of the checkers wrapped around her finger. ;) > > Robbie OTOH is a marginally gifted little guy, very bright. A little > scientist / engineer, loves > anything in that area of knowledge. With luck he will be a doctor and > support me in my old age. ;) > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 3:58 PM, Jim Lawrence wrote: >> My daughters have all grown up with computers. From childhood, their rooms >> have been wired for computers...coax cable and all. My oldest daughter >> learned to type on the keyboard before she could talk. She would sit in my >> lap and enter the keys as I called them out. She could start up the >> Commodore 64 and load games from memory. >> >> My youngest daughter made her first web site when she was ten, a > Sailor-moon >> site. ;-) At that time she used notepad to build her site and she knew > more >> about web sites and HTML coding than I did. >> >> Today, both my daughters are married or in a long term relationship with >> programmers (both with a least one degree in computer science) and they > all >> work in the business; one in computer graphic designer (and fashion > design) >> and two in animation and one as an application developer but if pushed the >> girls are both pretty good programmers (At the age of 15 my oldest > daughter >> was short-listed in a job competition and the company sent her their whole >> software line as a consolation...It was Blizzard software with Warcraft >> etc.) >> >> The one I feel sorry for is my wife Maria who totally non-computer > literate >> and has to listen to rest of the family talk shop and coding etc. at ever >> family gathering. >> >> I really hope your wife likes computers. ;-) >> >> Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 12:54:27 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 21:54:27 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Hi Ken -- <<< VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. >>> Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) has limited capabilities - the issue is that VBA implementation (within MS Office) is "crappy"... I mean that when one tries to go to use advanced VBA features, which should work by definition, they get all kinds of "blues" - and MS answer is that VBA wasn't intended to be used like that... And when everything is done within VBA (syntax and semantics) why there should be any mentioning of any programmers'/developers' intentions which go beyond VBA capabilities? That "limited capability by implementation" was the main reason I did mainly quit VBA development ... <<< The Lisp idea of closures is fundamental to getting JavaScript to do lots of useful things. >>> I have read/learned LISP in theory quite some time ago - and I must note I'm ignorant in this area... Yes, JavaScript is a great programming language - I'm (trying) to get it mastered now (OO JavaScript) - and I really like it... And the paradox is that JavaScript isn't an Object Oriented language but how powerful and flexible it's to simulate all/most of OOP concepts... <<< If a block of code doesn't require state, why should it be in a class? >>> OOP IMO is more useful/natural way to design and to develop software solutions simulating real world "objects" behaviors... Yes, the more loosely coupled and the less stateful one gets their classes designed the more they look like just "standard" modules with functions... (This World is dual isn't it?)... <<< F# is one of the most interesting .NET languages for me. >>> Yes, it looks interesting here too but I doubt I will have an opportunity to learn and to use it in the near future... But who knows how it all will evolve... <<< You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. >>> I'm not sure how do you use VBA in TDD - could you please elaborate a bit more on this subject here? Do you have your custom VBA TDD framework? Or you just develop and use special test VBA modules/functions and call that stuff TDD? That's OK with me - I'm just wondering what practice is behind your VBA TDD terminology... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 12 ?????? 2011 ?. 19:39 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] >Charlotte Foust: > I have to say, that I would put those module level functions into a >utility class and call the class method. I don't like calling module >level stuff from a class. The built in things you call are already >part of a library/dll so it isn't the same. But if they are just utility functions, why go through the effort of instantiating a class, when you can just call it directly in a module? If a block of code doesn't require state, why should it be in a class? As long as you write side-effect-free functions, you can write libraries that work just as well as the built-in stuff. > jwcolby: > Do you program in .Net? Everything is an object. There is no > "module", though there can be static classes / functions. > I haven't done a poll, but I doubt seriously that anyone uses your > paradigm in .net. Static classes would work just fine for function libraries -- they meet the criteria of being globally available, and not requiring instantiation. You can use Namespaces to group and name function libraries, as well. > Shamil Salakhetdinov > http://fsharp.net ? F# is one of the most interesting .NET languages for me. I dabbled with Nemerle years ago, which had all kinds of Lispy features, but it doesn't seem to be very actively developed now. > No, wait - in fact VB.NET and C# do support > first-order functional programming paradigms (LINQ and related > stuff...) http://www.info.ucl.ac.be/~pvr/paradigms.html > And here they say that MS Excel is a kind of functional programming > environment http://en.wikipedia.org/wiki/Functional_programming > So you should know and use them for quite some time already - > foundations of functional programming paradigm... :) Having functions as first-class data types (like strings, doubles, etc) turns out to be very handy. The Lisp idea of closures is fundamental to getting Javascript to do lots of useful things. Test-driven programming comes from loosely-typed languages like Lisp and Python. It is a way to define and enforce function, just contracts in Eiffel. VBA is not a very capable language, but you can directly use most of these ideas, and approximate and simulate others in a more-or-less satisfactory way. You can treat VBA as a loosely-typed, partly functional, test-driven programming language, and get tangible benefits. -Ken ---------- Forwarded message ---------- > From: Kenneth Ismert > To: accessd at databaseadvisors.com > Date: Mon, 11 Apr 2011 15:09:32 -0500 > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, > > I understand the reasoning and all however... because the code is no > longer > > contained within the object that needs it, you now open yourself up > > to > the > > old "I need to modify this method... oops... that change breaks > > something else that uses the code". > > > > It is always possible to over-factor, and merge two similar pieces of > code together that really should be separate. In that case, you factor > the code back into multiple pieces, and correct the dependencies. > > > > Class programming exists for a reason. Placing code in the object > > that needs the code exists for a reason. Black box programming > > exists for a reason. The reason in many cases is to prevent exactly > > this kind of interaction when we accidentally change a piece of code > > used in many > places > > and break one of those places. > > > > I would submit that calling side-effect free functions from a class > does not pierce the black box. The important things, state and access, > are protected by the class. But the function can be anywhere: built-in > VBA functions, Access application methods, or DAO library calls. You > undoubtedly call these functions from within your classes. > > > > Yes, there are instances where lots of different things need the > > exact > same > > code, and yes, I have been known to call module functions from > > classes, > but > > it truly is a questionable practice in most cases. > > > > Test cases replace questionability with a guarantee of proper > function. The function shouldn't define what it does -- the test cases > should. If changes to a function break a test, then you know > immediately that there is a problem. Functional unit testing guards > against changes that would break dependent code. > > I haven't found a reason why classes can't rely on properly crafted > and tested module-level functions. > > -Ken > > > > > > John W. Colby > > www.ColbyConsulting.com > > > > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: > > > >> John, All: > >> > >> I'm going to expand a little on what I'm trying to get at. This > >> post really isn't advice on what you should do. And it certainly > >> isn't criticism. > >> > >> I have been returning to the old Lisp idea of functional programming: > >> libraries of functions that act only on their inputs and only > >> return a result. The goal is 'side-effect-free' -- inputs are NEVER > >> modified, and external variables are never referenced. If a > >> function needs to return complex information, it returns either a > >> type or an object. Database functions unavoidably have > >> side-effects, but these are regarded as 'external' to the code, and are explicitly documented. > >> > >> The thing that surprised me was how well libraries play with objects. > >> Libraries provide discrete, testable chunks of code that support > >> any instance. Libraries separate functions into common-sense > >> groups. Classes provide an instance wrapper over the libraries, > >> stringing functions together to support the application. > >> > >> Plus, it is pretty easy to convert classes to this scheme while > >> maintaining compatibility. > >> > >> The advantages became apparent when I refactored some of my early > >> monolithic classes. These large, 'kitchen sink' classes had dozens > >> of methods which mixed database, business, and application > >> functionality. They were unwieldy, hard-to-understand, and > >> hard-to-extend. I simply copied the class into a module, stripped > >> out the instance stuff (properties and module-level variables), and > >> turned the methods into side-effect-free functions. I > then > >> stripped out the code within the original class methods, turning > >> them > into > >> wrappers calling library functions with their instance variables. > >> > >> The result: classes become lightweight, making their functionality > >> much more obvious. Compatibility is maintained, but the new system > >> is much easier > to > >> refactor and extend. > >> > >> The class on-top-of function approach is also a good answer to > >> those who want to re-use your code, but can't because they need > >> some method that > is > >> marked private in a class. They typically demand that all methods > >> be > made > >> public, which is usually silly because the class designer has good > reasons > >> for limiting the public visibility of certain methods or properties. > >> > >> But with a function library, you can have your cake and eat it, too. > >> Classes > >> hold the instance information, and interact with libraries in an > >> instance-safe way, because the functions never modify their inputs. > Others > >> with different needs can call the functions directly, or write > >> their own classes. Heck, I even find myself cramped by my own > >> classes at times, > and > >> having the option to call underlying functions directly has > >> benefited > me. > >> > >> Writing test code for functions is much easier than for complex > >> class systems. Test code provides reasonable proof of reliability. > >> Reliable complexity can only be built out of small, simple, > >> understandable, and testable pieces. > >> > >> -Ken > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Tue Apr 12 13:02:26 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 12 Apr 2011 22:02:26 +0400 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: Hi Jim -- <<< As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. >>> That would be called "integration tests" wouldn't they? That above is a bit "provocative" question I must admit to "fire" new here (?) Unit testing vs. Integration testing vs. Regression testing vs. ... testing Great Debate :) Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: 12 ?????? 2011 ?. 18:09 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 John, If your doing any type of n-tier design, unit testing is a must and you write the tests as you develop the objects. As to your point about bugs and lines of code, unit tests are very simple and limited by nature. You only test one very specific thing with each. It's not one all encompassing test against your entire app, but rather a series of test (possibly thousands). For example, I develop a customer class, which handles CRUD operations for customers. As result, I would develop four separate basic unit tests for that object: 1. Adding a record. 2. Deleting a record. 3. Reading a record. 4. Updating a record. Then I would develop a unit test for each of the business rules, say on credit limit, can't delete a customer with open items, etc. So just for the customer object alone, I might have dozens of unit tests. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 12, 2011 9:03 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 I guess I just don't "get it". OTOH there are a lot of things I don't get. When I write a class, I look at the functions that class needs to perform it's job. If it needs a function that is used elsewhere (in Access) I go to a lib to execute that function. To a smaller extent I do the same in C# (static class methods). But in general the class functions are only used in the class. A function can be made to accept args and return a value and never modify anything external to itself. It would make programming some functionality much more complicated however. Let's take an example. I have records in SQL server where the record itself represents an object. A "supervisor" represents a database which needs a specific process applied (address validation). Due to limitations of the third party address validation program, the sets of tens of millions of addresses have to be broken down into 2 million record "chunks". The process table is child to the supervisor and each process record represents a chunk of up to 2 million records. Address validation of a table of addresses is an extremely complex task requiring dozens of steps. The Supervisor (parent) and process (child) tables contain flags to store state, "Process X has completed". It takes an entire SQL statement to write that flag back to the appropriate table (parent or child) / field. So I have a "flag class" where I initialize the class with the PKID of the record that contains this data (flag), the field name, and the table name. Now the flag class can accept a data and write that data to its specific table / record / field. So (to get back to the subject at hand) there is a process that creates a temporary database and a table to hold the tens of millions of records needing processing. The process builds that. No flag is used, we just ask SQL server whether the objects exist and create them if not. When we *fill* that table, a piece of SQL code executed in a function. That function takes database / src view information (which it does not modify) and returns a boolean true (SQL Server says it did the operation) or false (SQL Server threw an error). However the function also logs to NLog (modifies information outside of the function) with logging type of stuff such as the database name, table, number of records affected etc. *IF* the table filled, the function also directly calls the class property to set the flag (remember the flag class?) saying that it successfully filled the table in the temp database. The pro[erty actually calls the flag class and the flag class writes the data back to SQL server right then and there. The function's reason to exist is to fill a table in a temp database with data from a view in a "live" database. The function itself does not modify the parameters passed in. It returns a true / false which makes the control logic a simple if (the table filled) then else. However it also writes to the NLog the results for status debug and it writes the flag saying that it succeeded, which is immediately written back to SQL Server. There are threads in other processes polling SQL Server every N seconds asking whether there are any processes where flag XYZ has been set, IOW it is ready to move to the next stage of processing. Could I break this down into umpteen other functions that (in the end) every one only does one thing? Of course, but I ain't gonna! I like that the function logs its state in NLog and that the function logs its state in the property and I like that the property immediately writes the information back to SQL Server. I went to a great deal of effort to get all of this stuff working this way. I want a system where every step of the process immediately logs its completion and if I stop the big picture for any reason (power loss or simply shutting down the server) I can pick right up where I left off. Each such flag is written to (initialized) from the code that loads the class instance from SQL Server and then modified in the function that actually performs that step. These process step functions are only used in one place, precisely and only in the class that performs that step. They will never be called from anywhere else (in fact they are private to the class) because no other code anywhere in the world performs that step of address validation processing. As for testing... an interesting read. http://en.wikipedia.org/wiki/Unit_testing particularly "Unit testing limitations". I am not here to get in a peeing match about whether or not... But where is the unit test of the unit test code... This article claims that the unit test requires 2-3 lines of code for every line tested, and we all know that there is (statistically) 1 bug in every 20 lines of code... Since unit testing code is code, and since it introduces 2-3 lines of test code for every line tested and since there are going to be bugs in the unit test code, then we need unit test code for the unit test code for the unit test code for the unit test code for... Kind of like looking in a mirror at a reflection in a mirror behind you. Sounds like the stuff sci-fi novels are made of. ;) At any rate, as a sole proprietor I have to pick a tool which can implement the systems that I design. I am not sitting at a desk collecting a paycheck regardless of what I produce. I do not have a test department, I am the test department. I am actually fascinated with the unit testing concept but I barely have the time to write the code itself, never mind code to test the code which tests the code... Whats a guy to do? John W. Colby www.ColbyConsulting.com On 4/11/2011 4:09 PM, Kenneth Ismert wrote: > John, > > I understand the reasoning and all however... because the code is no longer >> contained within the object that needs it, you now open yourself up >> to the >> old "I need to modify this method... oops... that change breaks >> something else that uses the code". ... From kismert at gmail.com Tue Apr 12 15:11:57 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:11:57 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken From charlotte.foust at gmail.com Tue Apr 12 15:22:00 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 12 Apr 2011 13:22:00 -0700 Subject: [AccessD] AccessD Digest, Vol 98, Issue 7 In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: NUnit testing is a learning experience in itself. Many of the basic tests can be scripted, which my previous employer finally did. However, the business rules tests needed to be hand written, and they largely dispensed with them, which didn't make a lot of sense to me. Every time a new rule was created, all the test would be run again just to be sure nothing got knocked sideways in the process. It is an incredible tool in .Net. Wish it were/had been available in Access. Charlotte Foust On Tue, Apr 12, 2011 at 7:09 AM, Jim Dettman wrote: > John, > > ?If your doing any type of n-tier design, unit testing is a must and you > write the tests as you develop the objects. > > ?As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. You only test one very specific thing with each. It's > not one all encompassing test against your entire app, but rather a series > of test (possibly thousands). > > ?For example, I develop a customer class, which handles CRUD operations for > customers. > > ?As result, I would develop four separate basic unit tests for that object: > > ?1. Adding a record. > ?2. Deleting a record. > ?3. Reading a record. > ?4. Updating a record. > > ?Then I would develop a unit test for each of the business rules, say on > credit limit, can't delete a customer with open items, etc. > > ?So just for the customer object alone, I might have dozens of unit tests. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 12, 2011 9:03 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 > > I guess I just don't "get it". ?OTOH there are a lot of things I don't get. > > When I write a class, I look at the functions that class needs to perform > it's job. ?If it needs a > function that is used elsewhere (in Access) I go to a lib to execute that > function. ?To a smaller > extent I do the same in C# (static class methods). > > But in general the class functions are only used in the class. ?A function > can be made to accept > args and return a value and never modify anything external to itself. ?It > would make programming > some functionality much more complicated however. ?Let's take an example. > > I have records in SQL server where the record itself represents an object. > A "supervisor" > represents a database which needs a specific process applied (address > validation). ?Due to > limitations of the third party address validation program, the sets of tens > of millions of addresses > have to be broken down into 2 million record "chunks". ?The process table is > child to the supervisor > and each process record represents a chunk of up to 2 million records. > > Address validation of a table of addresses is an extremely complex task > requiring dozens of steps. > The Supervisor (parent) and process (child) tables contain flags to store > state, "Process X has > completed". ?It takes an entire SQL statement to write that flag back to the > appropriate table > (parent or child) / field. ?So I have a "flag class" where I initialize the > class with the PKID of > the record that contains this data (flag), the field name, and the table > name. ?Now the flag class > can accept a data and write that data to its specific table / record / > field. > > So (to get back to the subject at hand) there is a process that creates a > temporary database and a > table to hold the tens of millions of records needing processing. ?The > process builds that. ?No flag > is used, we just ask SQL server whether the objects exist and create them if > not. ?When we *fill* > that table, a piece of SQL code executed in a function. ?That function takes > database / src view > information (which it does not modify) and returns a boolean true (SQL > Server says it did the > operation) or false (SQL Server threw an error). > > However the function also logs to NLog (modifies information outside of the > function) with logging > type of stuff such as the database name, table, number of records affected > etc. ?*IF* the table > filled, the function also directly calls the class property to set the flag > (remember the flag > class?) saying that it successfully filled the table in the temp database. > The pro[erty actually > calls the flag class and the flag class writes the data back to SQL server > right then and there. > > The function's reason to exist is to fill a table in a temp database with > data from a view in a > "live" database. ?The function itself does not modify the parameters passed > in. ?It returns a true / > false which makes the control logic a simple if (the table filled) then > else. > > However it also writes to the NLog the results for status debug and it > writes the flag saying that > it succeeded, which is immediately written back to SQL Server. ?There are > threads in other processes > polling SQL Server every N seconds asking whether there are any processes > where flag XYZ has been > set, IOW it is ready to move to the next stage of processing. > > Could I break this down into umpteen other functions that (in the end) every > one only does one > thing? ?Of course, but I ain't gonna! > > I like that the function logs its state in NLog and that the function logs > its state in the property > and I like that the property immediately writes the information back to SQL > Server. ?I went to a > great deal of effort to get all of this stuff working this way. ?I want a > system where every step of > the process immediately logs its completion and if I stop the big picture > for any reason (power loss > or simply shutting down the server) I can pick right up where I left off. > > Each such flag is written to (initialized) from the code that loads the > class instance from SQL > Server and then modified in the function that actually performs that step. > These process step > functions are only used in one place, precisely and only in the class that > performs that step. ?They > will never be called from anywhere else (in fact they are private to the > class) because no other > code anywhere in the world performs that step of address validation > processing. > > As for testing... an interesting read. > > http://en.wikipedia.org/wiki/Unit_testing > > particularly "Unit testing limitations". ?I am not here to get in a peeing > match about whether or > not... But where is the unit test of the unit test code... ?This article > claims that the unit test > requires 2-3 lines of code for every line tested, and we all know that there > is (statistically) 1 > bug in every 20 lines of code... > > Since unit testing code is code, and since it introduces 2-3 lines of test > code for every line > tested and since there are going to be bugs in the unit test code, then we > need unit test code for > the unit test code for the unit test code for the unit test code for... > > Kind of like looking in a mirror at a reflection in a mirror behind you. > > Sounds like the stuff sci-fi novels are made of. ?;) > > At any rate, as a sole proprietor I have to pick a tool which can implement > the systems that I > design. ?I am not sitting at a desk collecting a paycheck regardless of what > I produce. ?I do not > have a test department, I am the test department. ?I am actually fascinated > with the unit testing > concept but I barely have the time to write the code itself, never mind code > to test the code which > tests the code... > > Whats a guy to do? > > John W. Colby > www.ColbyConsulting.com > > On 4/11/2011 4:09 PM, Kenneth Ismert wrote: >> John, >> >> I understand the reasoning and all however... because the code is no > longer >>> contained within the object that needs it, you now open yourself up to > the >>> old "I need to modify this method... oops... that change breaks something >>> else that uses the code". > > ... > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From kismert at gmail.com Tue Apr 12 15:48:47 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Tue, 12 Apr 2011 15:48:47 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Let me give some examples of how I use function libraries, which might help illustrate what I'm talking about. Example 1: Factoring a Monolithic Business Class ======================================= I had a class, that I will call CPart, that had dozens and dozens of functions for dealing with parts. I had methods like CPart.Read and CPart.Save, with a CPart.Part property that I set before reading or saving a part. All was good until I got into situations where I just wanted to read an arbitrary part, without upsetting all of the delicate state that had built up for the 'Current' part. Yes, I could have created another instance of CPart, but it was monolithic, and represented the current (complex) state of the application, which seemed like a lot of effort just to read a part. So, for my first (bad) fix, I made optional parameters, like CPart.Read(Optional vPart As Variant), with internal code: If IsMissing(vPart) Then ' use member variable mvPart Else ' use given vPart End If ' specific code to read part ... Yes, my class inevitably got peppered with these optional parameters and If constructs, which started getting in the way of what the class was really trying to do, added extra complexity, and made it harder to debug and understand. During refactoring, I realized how I could simplify things: I built a module called MPart, with a function PartRead that took a required vPart parameter and returned a part structure or an error. The CPart methods lost their optional parameters and all the If statement nonsense, and the Part method's internal code reduced down to: tPart = MPart.PartRead(mvPart). External code could just call MPart.PartRead directly, without having to bother with creating and initializing a temporary CPart instance. Simplicity, readability, and testability improved all around. CPart shrank dramatically, making it easier to factor in the future. Example 2: Topical Function Libraries ============================= Over time, I have built up quite a few specialized modules for dealing with standard things in standard ways. For instance, MArray deals with arrays. MCollection holds very useful functions for Collections, similarly MString for strings and MVariant for variants. There are also more specialized libraries, like MMD5 for md5 hashes, and MMJD for Modified Julian Dates. There are lots of application-specific function libraries like MPart as well. These module functions have replaced sometimes a dozen half-assed and inconsistently written variations on a theme with one well-tested and thought-through piece of code that is portable among all of my applications. Moving standard code to a new application often reveals unknown weaknesses, which when fixed, strengthen the code for all applications. I find this to be a profitable way to bring consistency, flexibility and stability to my coding efforts. -Ken From accessd at shaw.ca Tue Apr 12 16:16:33 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:16:33 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <528397A8E9B14C68B8F6ACE8E43D0F39@creativesystemdesigns.com> The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking togther applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes closed...in another 5 years...maybe. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A function > can be made to accept args and return a value and never modify anything > external to itself. It would make programming some functionality much more > complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private to > the class) because no other code anywhere in the world performs that step of > address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am actually > fascinated with the unit testing concept but I barely have the time to write > the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I write > these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very simple > and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it (VBA) > has limited capabilities - the issue is that VBA implementation (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly > quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get it > mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language but > how > powerful and flexible it's to simulate all/most of OOP concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and call > that > stuff TDD? > That's OK with me - I'm just wondering what practice is behind your VBA TDD > terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From accessd at shaw.ca Tue Apr 12 16:22:32 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Tue, 12 Apr 2011 14:22:32 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <1E56BD82BB8A46A5A1A19FAB77E0B0C4@creativesystemdesigns.com> Sorry about the previous post but I was typing too fast and hit the mouse pad with the heel of my palm and the post was on it way. The main advantage to a framework, especially if you know it well is the speed you can get results and the price you have to impose on a client. As a rule frameworks are the most ugly things ever created if you wish the tinker or add extra functionality. I have been hacking together applications using ASP.Net in VS and then after it is all roughed in, I go into code and start clear out the garbage/resource directories and after a day or two there is a pretty good lean piece of code left. After that I add those little extras, in JQuery and create some nice graphics and smooth transitions. At one point in time I will dispense with this 'hack' method but that wouldn't happen until I can code in the language with my eyes (nearly) closed...in another 5 years...maybe. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Tuesday, April 12, 2011 1:12 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 12 21:12:35 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 12 Apr 2011 22:12:35 -0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <4DA50693.1040907@colbyconsulting.com> Ken, This stuff is all C# / SQL Server (and a Virtual Machine running a third party app) and is not the same as my framework in Access. This thing is really a custom written application specific to the needs of a single client. I wrote it and have re-factored it a couple of times as my knowledge increased in C#. It is slowly turning into an impressive system. I really wrote it because I was doing everything manually and it was a PITA, error prone (because it was all manual) and just plain not fun! The more I automated the process, the more the client was impressed. To this day the client really has no idea what what the system looks like or how it really works. He is in New York and I am in NC, and he basically has no knowledge of what is involved to do this stuff. He has his business, and I have mine - which is to make his business hum. What impresses him is that he knows (because I billed him for the hours) that doing an order used to take two days for the simplest order. Now it takes well under a day and for simple orders it can be done in a few hours. He used to send me count requests and it used to take an hour and it was a big enough pain that I might not get the results back to him until the next day. Now I get the count order and I can get the results back to him in 5-10 minutes if I can give it my immediate attention. I now have a program where I select a CSV file containing zips and the program does the counts, I press a button and the counts are pasted into an email and emailed off to him (and CC myself). So while he can't see the system (or understand it if he could) he can *feel* the system. I didn't do this to impress the customer I did this to keep the customer and to save my sanity. I now have nine lists which total about 350 million names, and I really need to process every list every month. I can only process 2 million names at a time through the third party software and each chunk takes about 50 minutes average. That's 175 chunks * 50 minutes of processing monthly - 146 hours of computer time every month. To do this stuff "manually" took me 2-3 times that long I am finally getting to the point where the system can do all of that unattended. And... I can process orders on-the-fly and they will break into the queue and jump to the head of the processing line. I'm here to tell you I could not do that manually, and if I were able to the customer would not be willing to pay me the hours required to do that. It really is an impressive system and it has been written (evolved really) starting somewhere around December 2009, so about 16 months, and I was learning C# as I went, which explains much of the refactoring. Now I finally get to relax a little bit and enjoy the fruits of my labor. John W. Colby www.ColbyConsulting.com On 4/12/2011 4:11 PM, Kenneth Ismert wrote: > All, > >> jwcolby: >> ... >> But in general the class functions are only used in the class. A function >> can be made to accept args and return a value and never modify anything >> external to itself. It would make programming some functionality much more >> complicated however. Let's take an example. ... >> > > You have a very impressive system with a lot of capability. But frameworks > have their own inertia: for all that they do, they unquestionably limit your > choices and reduce your options for their sheer bulk. I have wrestled with > this in building my own frameworks, and have entirely dismissed third party > frameworks (Symphony comes to mind) for the thunderous overhead they impose. From shamil at smsconsulting.spb.ru Wed Apr 13 08:24:42 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 17:24:42 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: <7732C63F31AF47ADA03F1D17DE33837F@nant> Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Apr 13 08:59:27 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 13 Apr 2011 09:59:27 -0400 Subject: [AccessD] mscomctl In-Reply-To: References: <4DA44D8F.7060106@colbyconsulting.com> Message-ID: <4DA5AC3F.4060602@colbyconsulting.com> I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com From phpons at gmail.com Wed Apr 13 09:27:35 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 16:27:35 +0200 Subject: [AccessD] How to hide info within a db? Message-ID: Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS From edzedz at comcast.net Wed Apr 13 09:38:47 2011 From: edzedz at comcast.net (Edward Zuris) Date: Wed, 13 Apr 2011 08:38:47 -0600 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <000001cbf9e8$802246d0$5bdea8c0@edz1> Thanks for the information. I was thinking of getting that book. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 7:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Wed Apr 13 10:11:51 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Wed, 13 Apr 2011 10:11:51 -0500 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> There is no encryption available at the table level. However, there are a few things that can be done to hide information... although if a person is a good VBA / Access programmer they could get around them. Creating an encrypted version does nothing to hide the data if one chooses to link or import tables. 1. Hiding the table is the first step... I might consider pending the table with "USys" to signify the table is a user system table. That hides the table unless the user unhides it in the parameters. 2. Roll your own encryption to the field. I call it encryption, but actually all you can do is store the data in Unicode using the StrConv function. When a user attempts to view the data in the table view, all they see is the first character of the field. If you change the field's input mask to password then the length of the field is seen but the number of characters represents the number of bytes in Unicode. For example: Social Security Numbers are nine digits in length, but in Unicode its stored as 18. Just make sure the field's length is long enough to store the extra digits. If they click into the field only one asterisk is seen. They can't copy or paste the data either. Of course this requires that you "encrypt" and "decrypt" each time you need to use the data. One more caveat... a person who sees the asterisk or the one character in length to be able decrypt the field they need to first realize HOW it was modified. 3. In Access 2007, create a ACCDE file. This locks everything down and enables the code to run faster. After the file is created... change the extension to ACCDR. This tells Access it's a runtime version. If someone tries to link or import tables from a runtime version, the file does not show BUT they could paste the name of the file into the dialog box and then it can be linked or imported. I do all three, although my table is not a system table. To the inexperienced or the casual user, these are adequate to keep the information safe. HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 9:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Wed Apr 13 10:17:56 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Wed, 13 Apr 2011 11:17:56 -0400 Subject: [AccessD] mscomctl In-Reply-To: <4DA5AC3F.4060602@colbyconsulting.com> References: <4DA44D8F.7060106@colbyconsulting.com> <4DA5AC3F.4060602@colbyconsulting.com> Message-ID: <6D90731D044D4616A0CBB207291B4C5C@Gateway> Usually, just regsvr32 "fullpath_in_quotes" Can be done in bat, but may need permissions. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 13, 2011 9:59 AM To: Access Developers discussion and problem solving Subject: [AccessD] mscomctl I hate the thing. But I want to use the time picker (I think it has one). What do I have to do to register it when I do an install? Can it be done from a batch file? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Wed Apr 13 11:01:11 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 09:01:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: References: Message-ID: Keep in mind that I come from a .Net world where everything is an object, so I learned to deal with that orientation. Once you get accustomed to that, it makes sense to do it that way. It's all black boxes. Charlotte Foust On Tue, Apr 12, 2011 at 8:38 AM, Kenneth Ismert wrote: >>Charlotte Foust: >> I have to say, that I would put those module level functions into a >> utility class and call the class method. ?I don't like calling module >> level stuff from a class. ?The built in things you call are already >> part of a library/dll so it isn't the same. > > But if they are just utility functions, why go through the effort of > instantiating a class, when you can just call it directly in a module? If a > block of code doesn't require state, why should it be in a class? > > As long as you write side-effect-free functions, you can write libraries > that work just as well as the built-in stuff. > >> jwcolby: >> Do you program in .Net? ?Everything is an object. ?There is >> no "module", though there can be static classes / functions. >> I haven't done a poll, but I doubt seriously that anyone uses >> your paradigm in .net. > > Static classes would work just fine for function libraries -- they meet the > criteria of being globally available, and not requiring instantiation. You > can use Namespaces to group and name function libraries, as well. > >> Shamil Salakhetdinov >> http://fsharp.net ? > > F# is one of the most interesting .NET languages for me. I dabbled with > Nemerle years ago, which had all kinds of Lispy features, but it doesn't > seem to be very actively developed now. > >> No, wait - in fact VB.NET and C# do support first-order >> functional programming paradigms (LINQ and related stuff...) >> http://www.info.ucl.ac.be/~pvr/paradigms.html >> And here they say that MS Excel is a kind of functional >> programming environment >> http://en.wikipedia.org/wiki/Functional_programming >> So you should know and use them for quite some time already - >> foundations of functional programming paradigm... ?:) > > Having functions as first-class data types (like strings, doubles, etc) > turns out to be very handy. > The Lisp idea of closures is fundamental to getting Javascript to do lots of > useful things. > Test-driven programming comes from loosely-typed languages like Lisp and > Python. It is a way to define and enforce function, just contracts in > Eiffel. > > VBA is not a very capable language, but you can directly use most of these > ideas, and approximate and simulate others in a more-or-less satisfactory > way. > > You can treat VBA as a loosely-typed, partly functional, test-driven > programming language, and get tangible benefits. > > -Ken > > > ---------- Forwarded message ---------- >> From: Kenneth Ismert >> To: accessd at databaseadvisors.com >> Date: Mon, 11 Apr 2011 15:09:32 -0500 >> Subject: Re: [AccessD] AccessD Digest, Vol 98, Issue 7 >> John, >> >> I understand the reasoning and all however... because the code is no longer >> > contained within the object that needs it, you now open yourself up to >> the >> > old "I need to modify this method... oops... that change breaks something >> > else that uses the code". >> > >> >> It is always possible to over-factor, and merge two similar pieces of code >> together that really should be separate. In that case, you factor the code >> back into multiple pieces, and correct the dependencies. >> >> >> > Class programming exists for a reason. ?Placing code in the object that >> > needs the code exists for a reason. ?Black box programming exists for a >> > reason. ?The reason in many cases is to prevent exactly this kind of >> > interaction when we accidentally change a piece of code used in many >> places >> > and break one of those places. >> > >> >> I would submit that calling side-effect free functions from a class does >> not >> pierce the black box. The important things, state and access, are protected >> by the class. But the function can be anywhere: built-in VBA functions, >> Access application methods, or DAO library calls. You undoubtedly call >> these >> functions from within your classes. >> >> >> > Yes, there are instances where lots of different things need the exact >> same >> > code, and yes, I have been known to call module functions from classes, >> but >> > it truly is a questionable practice in most cases. >> > >> >> Test cases replace questionability with a guarantee of proper function. The >> function shouldn't define what it does -- the test cases should. If changes >> to a function break a test, then you know immediately that there is a >> problem. Functional unit testing guards against changes that would break >> dependent code. >> >> I haven't found a reason why classes can't rely on properly crafted and >> tested module-level functions. >> >> -Ken >> >> >> > >> > John W. Colby >> > www.ColbyConsulting.com >> > >> > On 4/11/2011 1:10 PM, Kenneth Ismert wrote: >> > >> >> John, All: >> >> >> >> I'm going to expand a little on what I'm trying to get at. This post >> >> really >> >> isn't advice on what you should do. And it certainly isn't criticism. >> >> >> >> I have been returning to the old Lisp idea of functional programming: >> >> libraries of functions that act only on their inputs and only return a >> >> result. The goal is 'side-effect-free' -- inputs are NEVER modified, and >> >> external variables are never referenced. If a function needs to return >> >> complex information, it returns either a type or an object. Database >> >> functions unavoidably have side-effects, but these are regarded as >> >> 'external' to the code, and are explicitly documented. >> >> >> >> The thing that surprised me was how well libraries play with objects. >> >> Libraries provide discrete, testable chunks of code that support any >> >> instance. Libraries separate functions into common-sense groups. Classes >> >> provide an instance wrapper over the libraries, stringing functions >> >> together >> >> to support the application. >> >> >> >> Plus, it is pretty easy to convert classes to this scheme while >> >> maintaining >> >> compatibility. >> >> >> >> The advantages became apparent when I refactored some of my early >> >> monolithic >> >> classes. These large, 'kitchen sink' classes had dozens of methods which >> >> mixed database, business, and application functionality. They were >> >> unwieldy, >> >> hard-to-understand, and hard-to-extend. I simply copied the class into a >> >> module, stripped out the instance stuff (properties and module-level >> >> variables), and turned the methods into side-effect-free functions. I >> then >> >> stripped out the code within the original class methods, turning them >> into >> >> wrappers calling library functions with their instance variables. >> >> >> >> The result: classes become lightweight, making their functionality much >> >> more >> >> obvious. Compatibility is maintained, but the new system is much easier >> to >> >> refactor and extend. >> >> >> >> The class on-top-of function approach is also a good answer to those who >> >> want to re-use your code, but can't because they need some method that >> is >> >> marked private in a class. They typically demand that all methods be >> made >> >> public, which is usually silly because the class designer has good >> reasons >> >> for limiting the public visibility of certain methods or properties. >> >> >> >> But with a function library, you can have your cake and eat it, too. >> >> Classes >> >> hold the instance information, and interact with libraries in an >> >> instance-safe way, because the functions never modify their inputs. >> Others >> >> with different needs can call the functions directly, or write their own >> >> classes. Heck, I even find myself cramped by my own classes at times, >> and >> >> having the option to call underlying functions directly has benefited >> me. >> >> >> >> Writing test code for functions is much easier than for complex class >> >> systems. Test code provides reasonable proof of reliability. ?Reliable >> >> complexity can only be built out of small, simple, understandable, and >> >> testable pieces. >> >> >> >> -Ken >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Wed Apr 13 13:19:12 2011 From: phpons at gmail.com (philippe pons) Date: Wed, 13 Apr 2011 20:19:12 +0200 Subject: [AccessD] How to hide info within a db? In-Reply-To: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> References: <4da5bd3a.c205ec0a.6213.1e99@mx.google.com> Message-ID: Thank's a lot, Jim, I will try to use you advice. Philippe 2011/4/13 jm.hwsn > There is no encryption available at the table level. > However, there are a few things that can be done to hide information... > although if a person is a good VBA / Access programmer they could get > around > them. Creating an encrypted version does nothing to hide the data if one > chooses to link or import tables. > > 1. Hiding the table is the first step... I might consider pending the > table > with "USys" to signify the table is a user system table. That hides the > table unless the user unhides it in the parameters. > > 2. Roll your own encryption to the field. I call it encryption, but > actually all you can do is store the data in Unicode using the StrConv > function. When a user attempts to view the data in the table view, all > they > see is the first character of the field. If you change the field's input > mask to password then the length of the field is seen but the number of > characters represents the number of bytes in Unicode. For example: Social > Security Numbers are nine digits in length, but in Unicode its stored as > 18. > Just make sure the field's length is long enough to store the extra digits. > If they click into the field only one asterisk is seen. They can't copy or > paste the data either. Of course this requires that you "encrypt" and > "decrypt" each time you need to use the data. One more caveat... a person > who sees the asterisk or the one character in length to be able decrypt the > field they need to first realize HOW it was modified. > > 3. In Access 2007, create a ACCDE file. This locks everything down and > enables the code to run faster. After the file is created... change the > extension to ACCDR. This tells Access it's a runtime version. If someone > tries to link or import tables from a runtime version, the file does not > show BUT they could paste the name of the file into the dialog box and then > it can be linked or imported. > > I do all three, although my table is not a system table. To the > inexperienced or the casual user, these are adequate to keep the > information > safe. > > HTH > Jim > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Wednesday, April 13, 2011 9:28 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] How to hide info within a db? > > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dw-murphy at cox.net Wed Apr 13 13:37:11 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Wed, 13 Apr 2011 11:37:11 -0700 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <7732C63F31AF47ADA03F1D17DE33837F@nant> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> Message-ID: <004701cbfa09$cd8869b0$68993d10$@cox.net> Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, > jwcolby: > ... > But in general the class functions are only used in the class. A > function can be made to accept args and return a value and never > modify anything external to itself. It would make programming some > functionality much more complicated however. Let's take an example. ... > You have a very impressive system with a lot of capability. But frameworks have their own inertia: for all that they do, they unquestionably limit your choices and reduce your options for their sheer bulk. I have wrestled with this in building my own frameworks, and have entirely dismissed third party frameworks (Symphony comes to mind) for the thunderous overhead they impose. Part of my interest in functional programming is an emphasis on simplicity that helps to reduce this bulk, by reducing the scope of routines, and restricting the kinds of interactions that can happen between code. This kind of reductionism can actually increase your options, by giving you flexibility. > Could I break this down into umpteen other functions that (in the end) > every one only does one thing? Of course, but I ain't gonna! > ... > They will never be called from anywhere else (in fact they are private > to the class) because no other code anywhere in the world performs > that step of address validation processing. > This sounds like correct factoring of code to me ... you don't want to reduce it too small, and you want to organize in part by specialization -- general code is generally accessible, specific code is less accessible, or not all all to outside code. For general VBA code, nothing is more easily accessible than a public module function. > I do not have a test department, I am the test department. I am > actually fascinated with the unit testing concept but I barely have > the time to write the code itself, never mind code to test the code > which tests the code... > But, for the right client, this can be a valuable part of the deliverables -- as Jim Dettman describes, a set of tests that validate basic function can build a lot of confidence in a customer's eyes that they are getting something that can be shown to work, and that it can be modified by others with less fear of breakage. > My question is, why do regression testing if we never regress? I > write these functions and they are done. They work or they don't. > I think the main point is to prove to someone else that your stuff works. I'm a single programmer shop, so I'm just proving it to myself, and giving myself some peace of mind that the really critical stuff has some backbone to it. > Jim Dettman: > ... > As to your point about bugs and lines of code, unit tests are very > simple and limited by nature. ... > Yes -- clearly, if you get to the point where you are writing a lot of unit tests for your unit tests, that's a sign that your test code might be too complex, and you need to revisit your approach. Shamil Salakhetdinov: > ... > Yes, VBA is not very capable language but the issue IMO isn't that it > (VBA) has limited capabilities - the issue is that VBA implementation > (within MS > Office) is "crappy"... > ... > That "limited capability by implementation" was the main reason I did > mainly quit VBA development ... > Yes, I find I run into the COM-imposed 'ragged edge' far too easily in VBA. I find that 'proper' solutions in VBA usually require more effort in dealing with limitations than other platforms. > ... > Yes, JavaScript is a great programming language - I'm (trying) to get > it mastered now (OO JavaScript) - and I really like it... > And the paradox is that JavaScript isn't an Object Oriented language > but how powerful and flexible it's to simulate all/most of OOP > concepts... > Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. > ... > I'm not sure how do you use VBA in TDD - could you please elaborate a bit > more on this subject here? > Do you have your custom VBA TDD framework? > Or you just develop and use special test VBA modules/functions and > call that stuff TDD? > That's OK with me - I'm just wondering what practice is behind your > VBA TDD terminology... > Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 14:02:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 05:02:02 +1000 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <4DA5F32A.1919.28625544@stuart.lexacorp.com.pg> Jim has aleady given you some ideas, but there other options depending on exactly what it is you want to hide. How much information? What type of information? Under what cirucmstances? i.e when does it need to hidden and when does it need to be visible? There are a number of simple and resaonable secure encrytion routines you can use when you save/retreive data which just rely on a password which you can have the user enter when they open the application. -- Stuart On 13 Apr 2011 at 16:27, philippe pons wrote: > Hi all, > > > I need to hide some information within an access application. > I would like these information to be really hidden. > > How would you do it? > > TIA, > > Philippe PONS > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 14:22:52 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 14:22:52 -0500 Subject: [AccessD] Dir command trouble Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> I am running the following code to get a list of file folders. All it returns is an empty string. What might I be missing? Sub FileFolderLIst() Dim FileFolder As Variant strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, vbDirectory) End Sub Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From shamil at smsconsulting.spb.ru Wed Apr 13 14:35:07 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 13 Apr 2011 23:35:07 +0400 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] In-Reply-To: <004701cbfa09$cd8869b0$68993d10$@cox.net> References: <7732C63F31AF47ADA03F1D17DE33837F@nant> <004701cbfa09$cd8869b0$68993d10$@cox.net> Message-ID: Hi Doug, Not at all - in fact that was Ken who posted that link here: <<< Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: 13 ?????? 2011 ?. 22:37 To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] Shamil, Thank you for the reference to the javascript checker. I just ran some of my code through this. The result wasn't pretty, but it was informative. I'll keep this link. Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Wednesday, April 13, 2011 6:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Hi Ken -- <<< If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. >>> Thank you I jave got bookmarked both book and the site... <<< Right now, I do the most brutally simple testing possible -- if I have a library module 'MFoo', I have a test module called 'testMFoo', with 'test' functions that exercise like-named MFoo functions. I just run the code by hand. I don't have perfect test coverage, either. I'm not sure how or if I will automate it, but I suppose I could loop through all of the 'test*' modules, run each of the 'test*' functions, and log the results. >>> Yes, that's one of the options how to run your test code.... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: 13 ?????? 2011 ?. 0:12 To: accessd at databaseadvisors.com Subject: Re: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98,Issue 7] All, <<< skip>>> Javascript is Prototype-based, which is a simpler (but still enormously useful) object paradigm. If you haven't run into it yet, I would recommend Douglas Crockford's book "Javascript: the Good Parts", which very efficiently shows what to do and what to avoid. Also, I use Crockford's Javascript Lint, http://www.jslint.com/, which promises to 'hurt your feelings'. But, it has never hurt mine, mainly because it has rescued my crappy, non-working Javacript code too many times. <<< skip >>> -Ken -- From kismert at gmail.com Wed Apr 13 14:45:56 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Wed, 13 Apr 2011 14:45:56 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: > Charlotte Foust: > Keep in mind that I come from a .Net world where everything is an > object, so I learned to deal with that orientation. Once you get > accustomed to that, it makes sense to do it that way. It's all black > boxes. > One of my points is that you don't have to think about programming constructs in the terms that their designers intended. If, in C#, you have a static class with all public methods, no properties, and no member variables, then it is a 'function library', for all intents and purposes. Write your methods so that they are side-effect free, and you are an instant functional programmer. VBA has no static classes. But, VBA modules allow properties and member variables, so all you have to do is hack in some initialization code, and voila, a VBA 'static class'. If you aren't proud about the 'purity' of the solution, (and trust me, I am not proud), you can approximate a lot of programming concepts the language wasn't intended to support. -Ken From stuart at lexacorp.com.pg Wed Apr 13 15:15:58 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:15:58 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> Message-ID: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:24:23 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:24:23 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> I found my mistake just as you responded. A one character error in the path name. Thanks for the assistance. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble It works for me on "C:\" Sub FileFolderLIst() Dim FileFolder As Variant Dim strPathname As String strPathname = "C:\" FileFolder = Dir(strPathname) FileFolder = Dir(strPathname, vbDirectory) Debug.Print FileFolder End Sub As does the example in A2K3 Help under Dir() - which show how to *only* list the directories rather all files as well. Sub Test() Dim MyPath As String Dim MyName As String MyPath = "c:\" ' Set the path. MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do While MyName <> "" ' Start the loop. ' Ignore the current directory and the encompassing directory. If MyName <> "." And MyName <> ".." Then ' Use bitwise comparison to make sure MyName is a directory. If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then Debug.Print MyName ' Display entry only if it End If ' it represents a directory. End If MyName = Dir ' Get next entry. Loop End Sub On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > I am running the following code to get a list of file folders. All it > returns is an empty string. What might I be missing? > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > FileFolder = Dir(strPathName) > FileFolder = Dir(strPathName, vbDirectory) > > End Sub > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > ? > No trees were killed in the sending of this message. However a large > number of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:29:42 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:29:42 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> Message-ID: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Wed Apr 13 15:34:35 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Wed, 13 Apr 2011 15:34:35 -0500 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA6047E.28573.28A60543@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99D2@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Problem found! -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Dir command trouble "Pablic" ? :-) -- Stuart On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > I found my mistake just as you responded. A one character error in the > path name. Thanks for the assistance. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > It works for me on "C:\" > > Sub FileFolderLIst() > Dim FileFolder As Variant > Dim strPathname As String > strPathname = "C:\" > FileFolder = Dir(strPathname) > FileFolder = Dir(strPathname, vbDirectory) > Debug.Print FileFolder > End Sub > > > As does the example in A2K3 Help under Dir() - which show how to > *only* list the directories rather all files as well. > > Sub Test() > Dim MyPath As String > Dim MyName As String > MyPath = "c:\" ' Set the path. > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. > Do While MyName <> "" ' Start the loop. > ' Ignore the current directory and the encompassing directory. If > MyName <> "." And MyName <> ".." Then > ' Use bitwise comparison to make sure MyName is a directory. > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > Then > Debug.Print MyName ' Display entry only if it > End If ' it represents a directory. > End If > MyName = Dir ' Get next entry. > Loop > End Sub > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > I am running the following code to get a list of file folders. All > > it returns is an empty string. What might I be missing? > > > > Sub FileFolderLIst() > > > > Dim FileFolder As Variant > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > FileFolder = Dir(strPathName) > > FileFolder = Dir(strPathName, vbDirectory) > > > > End Sub > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > ? > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Wed Apr 13 15:43:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 14 Apr 2011 06:43:18 +1000 Subject: [AccessD] Dir command trouble In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com>, <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg>, <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> Message-ID: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> PEBCAK :-) On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > Problem found! > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] Dir > command trouble > > "Pablic" ? :-) > > -- > Stuart > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > I found my mistake just as you responded. A one character error in > > the path name. Thanks for the assistance. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > It works for me on "C:\" > > > > Sub FileFolderLIst() > > Dim FileFolder As Variant > > Dim strPathname As String > > strPathname = "C:\" > > FileFolder = Dir(strPathname) > > FileFolder = Dir(strPathname, vbDirectory) > > Debug.Print FileFolder > > End Sub > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > *only* list the directories rather all files as well. > > > > Sub Test() > > Dim MyPath As String > > Dim MyName As String > > MyPath = "c:\" ' Set the path. > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > While MyName <> "" ' Start the loop. > > ' Ignore the current directory and the encompassing directory. > > If MyName <> "." And MyName <> ".." Then > > ' Use bitwise comparison to make sure MyName is a directory. > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > Then > > Debug.Print MyName ' Display entry only if it > > End If ' it represents a directory. > > End If > > MyName = Dir ' Get next entry. > > Loop > > End Sub > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > I am running the following code to get a list of file folders. All > > > it returns is an empty string. What might I be missing? > > > > > > Sub FileFolderLIst() > > > > > > Dim FileFolder As Variant > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > vbDirectory) > > > > > > End Sub > > > > > > > > > Chester Kaup > > > Engineering Technician > > > Kinder Morgan CO2 Company, LLP > > > Office (432) 688-3797 > > > FAX (432) 688-3799 > > > > > > ? > > > No trees were killed in the sending of this message. However a > > > large number of electrons were terribly inconvenienced. > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Wed Apr 13 15:46:23 2011 From: davidmcafee at gmail.com (David McAfee) Date: Wed, 13 Apr 2011 13:46:23 -0700 Subject: [AccessD] Dir command trouble In-Reply-To: <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> References: <0B2BF8524B73A248A2F1B81BA751ED3C197BBF998B@houex1.kindermorgan.com> <4DA607B6.20218.28B299B5@stuart.lexacorp.com.pg> <0B2BF8524B73A248A2F1B81BA751ED3C197BBF99DF@houex1.kindermorgan.com> <4DA60AE6.28438.28BF0B1D@stuart.lexacorp.com.pg> Message-ID: I hate it when that happens! :) On Wed, Apr 13, 2011 at 1:43 PM, Stuart McLachlan wrote: > PEBCAK :-) > > On 13 Apr 2011 at 15:34, Kaup, Chester wrote: > > > Problem found! > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > McLachlan Sent: Wednesday, April 13, 2011 3:30 PM To: Access > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > command trouble > > > > "Pablic" ? :-) > > > > -- > > Stuart > > > > > > > > On 13 Apr 2011 at 15:24, Kaup, Chester wrote: > > > > > I found my mistake just as you responded. A one character error in > > > the path name. Thanks for the assistance. > > > > > > -----Original Message----- > > > From: accessd-bounces at databaseadvisors.com > > > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > > > McLachlan Sent: Wednesday, April 13, 2011 3:16 PM To: Access > > > Developers discussion and problem solving Subject: Re: [AccessD] Dir > > > command trouble > > > > > > It works for me on "C:\" > > > > > > Sub FileFolderLIst() > > > Dim FileFolder As Variant > > > Dim strPathname As String > > > strPathname = "C:\" > > > FileFolder = Dir(strPathname) > > > FileFolder = Dir(strPathname, vbDirectory) > > > Debug.Print FileFolder > > > End Sub > > > > > > > > > As does the example in A2K3 Help under Dir() - which show how to > > > *only* list the directories rather all files as well. > > > > > > Sub Test() > > > Dim MyPath As String > > > Dim MyName As String > > > MyPath = "c:\" ' Set the path. > > > MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry. Do > > > While MyName <> "" ' Start the loop. > > > ' Ignore the current directory and the encompassing directory. > > > If MyName <> "." And MyName <> ".." Then > > > ' Use bitwise comparison to make sure MyName is a directory. > > > If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory > > > Then > > > Debug.Print MyName ' Display entry only if it > > > End If ' it represents a directory. > > > End If > > > MyName = Dir ' Get next entry. > > > Loop > > > End Sub > > > > > > > > > > > > > > > On 13 Apr 2011 at 14:22, Kaup, Chester wrote: > > > > > > > I am running the following code to get a list of file folders. All > > > > it returns is an empty string. What might I be missing? > > > > > > > > Sub FileFolderLIst() > > > > > > > > Dim FileFolder As Variant > > > > > > > > strPathName = "M:\SACROC\Data\Pablic\Step-Rate Tests\Area 2\" > > > > FileFolder = Dir(strPathName) FileFolder = Dir(strPathName, > > > > vbDirectory) > > > > > > > > End Sub > > > > > > > > > > > > Chester Kaup > > > > Engineering Technician > > > > Kinder Morgan CO2 Company, LLP > > > > Office (432) 688-3797 > > > > FAX (432) 688-3799 > > > > > > > > > > > > No trees were killed in the sending of this message. However a > > > > large number of electrons were terribly inconvenienced. > > > > > > > > > > > > -- > > > > AccessD mailing list > > > > AccessD at databaseadvisors.com > > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > -- > > > AccessD mailing list > > > AccessD at databaseadvisors.com > > > http://databaseadvisors.com/mailman/listinfo/accessd > > > Website: http://www.databaseadvisors.com > > > > > > > > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Wed Apr 13 17:22:27 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 17:22:27 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Wed Apr 13 18:05:57 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 16:05:57 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From bheid at sc.rr.com Wed Apr 13 19:04:56 2011 From: bheid at sc.rr.com (Bobby Heid) Date: Wed, 13 Apr 2011 20:04:56 -0400 Subject: [AccessD] How to hide info within a db? In-Reply-To: References: Message-ID: <000301cbfa37$97917a30$c6b46e90$@rr.com> Philippe, If this is data, and it is important that it not be read, I would encrypt it. Not sure how you would do it in Access (probably some API), but in .Net Framework, there are library functions to do this. Bobby -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Wednesday, April 13, 2011 10:28 AM To: Access Developers discussion and problem solving Subject: [AccessD] How to hide info within a db? Hi all, I need to hide some information within an access application. I would like these information to be really hidden. How would you do it? TIA, Philippe PONS -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Wed Apr 13 19:58:30 2011 From: df.waters at comcast.net (Dan Waters) Date: Wed, 13 Apr 2011 19:58:30 -0500 Subject: [AccessD] FE's Disconnecting from BE Message-ID: <004301cbfa3f$12cd7710$38686530$@comcast.net> At just one of my customers, we've recently had the experience where the FE files have all, at the same time, had one or more table links disconnect from the BE file, and then all the table links reconnected no more than 15 minutes later. As far as we know, there was no human intervention. A Disk or Network Error was recorded by the FE in the GlobalErrors table with is in the BE file, so this table link did not disconnect. The network setup is a little complex - they use a Storage Area Network (SAN) with multiple disks, virtual server (VMWare), and Citrix. The system is 3 - 6 times slower with data intensive activity compared to my other customers using a LAN and a physical server. Anyone have any ideas on a cause, what I can monitor, or what I could do? Thanks! Dan From accessd at shaw.ca Wed Apr 13 21:05:58 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 13 Apr 2011 19:05:58 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Wed Apr 13 22:45:55 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:45:55 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Wed Apr 13 22:49:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Wed, 13 Apr 2011 22:49:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Does it affect anything other than Reflection? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Wednesday, April 13, 2011 6:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Yep, that confuses everyone until you get used to it. Charlotte Foust On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. > > > > In VB, one of the 'limitations' that was kind of annoying was > dynamically referring to the 'properties' of a class module. > > > > For example, if I wanted the column name from a recordset, I could do > this: > > > > Msgbox rs.Fields.Item(0).Name > > > > But, what if I wanted to get it programmatically, .Name is hard coded: > > > > Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") > > > > That would allow me to put a variable in the properties 'property', to > retrieve a value dynamically. > > > > However, with a standard class module, in VB6/VBA, the only way, I could > find, to do this, was to put in extra code into a class module to create > a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that > did this for me (created a properties property). ?Put a LOT of extra > code into your module though. > > > > In VB.Net, there is a built in capability to do this with the Reflection > Library. ?So here is what I stumbled on. ?I was all excited to use the > Reflection library on a particalur class where I needed to dynamically > list, set, and get properties of a class I built..... > > > > The catch... > > > > In VB: > > > > Public SomeValue as String > > - ? ? ? ? ? And - > > Property Get SomeValue() as string > > SomeValue=strTemp > > End Property > > > > Both create a 'property' called SomeValue. > > > > In VB.Net > > Public SomeValue as String > > Public Property SomeValue() as String > > ? ? ? ? ? ? ? Get > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp > > ? ? ? ? ? ? ? ?End Get > > ? ? ? ? ? ? ? ?Let (value) > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value > > ? ? ? ? ? ? ? ?End Let > > End Property > > > > In the first line, SomeValue is considered a FIELD, not a property. ?The > SomeValue defined with Get/Let statements...THAT'S a PROPERTY. > > > > Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at > all of my properties...until I figured out that some were properties > some were "FIELDS". > > > > LOL. > > > > Of course, there will probably be a dozen people that already knew > that...I'm so late to the game with .Net > > > > Drew > > > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Wed Apr 13 23:55:38 2011 From: rockysmolin at bchacc.com (rockysmolin at bchacc.com) Date: Wed, 13 Apr 2011 21:55:38 -0700 Subject: [AccessD] New Language Message-ID: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Thu Apr 14 00:36:21 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 13 Apr 2011 22:36:21 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. ?In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). ?Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. ?So here is what I stumbled on. ?I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ?The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Thu Apr 14 00:44:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 00:44:08 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Ok, thanks. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 12:36 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB You just have to be aware that there are times to use the fields collection and times not to. If you're looking for a property, it's probably OK, but if you want the value, you have to be careful which event you use. Charlotte Foust On Wed, Apr 13, 2011 at 8:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte > Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or >> thinking about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', >> to retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I >> could find, to do this, was to put in extra code into a class module >> to create a 'Properties' Property. ?In fact, I had written an Add-on >> in VB6 that did this for me (created a properties property). ?Put a >> LOT of extra code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the >> Reflection Library. ?So here is what I stumbled on. ?I was all >> excited to use the Reflection library on a particalur class where I >> needed to dynamically list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - ? ? ? ? ? And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> ? ? ? ? ? ? ? Get >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Return strTemp >> >> ? ? ? ? ? ? ? ?End Get >> >> ? ? ? ? ? ? ? ?Let (value) >> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?strTemp=value >> >> ? ? ? ? ? ? ? ?End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. ? >> The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. ?Drove me nuts, couldn't figure out why I wasn't getting >> at all of my properties...until I figured out that some were >> properties some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for >> the person or entity to which it is addressed and may contain II-VI >> Proprietary and/or II-VI Business Sensitive material. If you are not >> the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, >> disclosure, dissemination, or other use of, or taking of any action >> in reliance upon this information by persons or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From accessd at shaw.ca Thu Apr 14 02:02:38 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 00:02:38 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <0A6A2B6BCA9E41B09708AADD977FB4BC@creativesystemdesigns.com> Message-ID: <7DEDE1F783024A28A3C5D53E63803261@creativesystemdesigns.com> Hi Drew: OK... Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 8:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL, check that code again, I was retrieving a property of a field, not the field itself... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, April 13, 2011 9:06 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi Drew: You can also do it this way: Msgbox rs.fields("BASECOLUMNNAME") Or Msgbox rs.fields(strFieldName) Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, April 13, 2011 3:22 PM To: Access Developers discussion and problem solving Subject: [AccessD] First real stumble with using VB.Net over VB Figured I'd post this here, for those that may be tinkering or thinking about tinkering with .Net. In VB, one of the 'limitations' that was kind of annoying was dynamically referring to the 'properties' of a class module. For example, if I wanted the column name from a recordset, I could do this: Msgbox rs.Fields.Item(0).Name But, what if I wanted to get it programmatically, .Name is hard coded: Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") That would allow me to put a variable in the properties 'property', to retrieve a value dynamically. However, with a standard class module, in VB6/VBA, the only way, I could find, to do this, was to put in extra code into a class module to create a 'Properties' Property. In fact, I had written an Add-on in VB6 that did this for me (created a properties property). Put a LOT of extra code into your module though. In VB.Net, there is a built in capability to do this with the Reflection Library. So here is what I stumbled on. I was all excited to use the Reflection library on a particalur class where I needed to dynamically list, set, and get properties of a class I built..... The catch... In VB: Public SomeValue as String - And - Property Get SomeValue() as string SomeValue=strTemp End Property Both create a 'property' called SomeValue. In VB.Net Public SomeValue as String Public Property SomeValue() as String Get Return strTemp End Get Let (value) strTemp=value End Let End Property In the first line, SomeValue is considered a FIELD, not a property. The SomeValue defined with Get/Let statements...THAT'S a PROPERTY. Go figure. Drove me nuts, couldn't figure out why I wasn't getting at all of my properties...until I figured out that some were properties some were "FIELDS". LOL. Of course, there will probably be a dozen people that already knew that...I'm so late to the game with .Net Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 14 04:39:03 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:39:03 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C0B7.9070509@colbyconsulting.com> Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. From jwcolby at colbyconsulting.com Thu Apr 14 04:42:48 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 05:42:48 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6C198.7060305@colbyconsulting.com> > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From Gustav at cactus.dk Thu Apr 14 05:27:05 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 14 Apr 2011 12:27:05 +0200 Subject: [AccessD] First real stumble with using VB.Net over VB Message-ID: Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. From jwcolby at colbyconsulting.com Thu Apr 14 07:47:23 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 08:47:23 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <4DA6ECDB.2020702@colbyconsulting.com> LOL. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. Whatever. Why doesn't he do that to start with? Class public fields exist for a reason. http://www.codinghorror.com/blog/2006/08/properties-vs-public-variables.html Read down through the comments. Like everything else programming, there are very opinionated people on both sides of the isle. But notice that *referencing* code breakage is very real. Kind of like natural vs surrogate keys, you can get away with either... until you can't! And when you can't you have created problems for yourself that you never would have had had you just "done it right" to start with. John W. Colby www.ColbyConsulting.com On 4/14/2011 6:27 AM, Gustav Brock wrote: > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39>>> > > I understand that you are a lazy programmer .. > > From kismert at gmail.com Thu Apr 14 10:17:32 2011 From: kismert at gmail.com (Kenneth Ismert) Date: Thu, 14 Apr 2011 10:17:32 -0500 Subject: [AccessD] Libraries and Frameworks [Was: AccessD Digest, Vol 98, Issue 7] Message-ID: Speaking of Unit-testing, I bumped into this: http://cobra-language.com/ Cobra is a .NET/Mono language, with language constructs that directly support: * Contracts * Unit-testing * Lambdas and closures * Doc strings * Mixins and extensions Familiar .NET features like Generics are there, and it plays nice with C# and VB.NET, too. It offers the clean syntax and convenience of Ruby or Python, but provides strong compile-time checking, and compiled performance. -Ken From accessd at shaw.ca Thu Apr 14 11:38:24 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 09:38:24 -0700 Subject: [AccessD] New Language In-Reply-To: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> Message-ID: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 12:16:41 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 10:16:41 -0700 Subject: [AccessD] New Language In-Reply-To: <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> References: <20110413215538.86c3debdd1c3983866efe200e2feb95f.4b7cf8e400.wbe@email18.secureserver.net> <9EB33DBA2E574150BC5255EA8A4EA895@creativesystemdesigns.com> Message-ID: Noah recommends starting with Java. Says LUA data types are confusing and Java is more structured and object oriented. Debugging is harder in LUA as well. I'll see if I can post a video of the competition they did at the regionals. I have it - just have to figure out how and where to post. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 9:38 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] New Language Well of course you should be bragging...if you weren't you wouldn't be his father...it goes with the territory...it is your responsibility. It sure sounds like Noah is a chip off the old motherboard as the saying goes. But of course being his Dad you must post pictures and with explanations of the coding and how it works etc. One day, who knows, Noah may be able to keep his Mom and Dad in the lifestyle they have so aspired to. ;-) Good kid...send along my congratulations. LUA looks like a very interesting language, completely open source, written by two professors with PHDs in computer science and a researcher with a doctorate in mathematics; all from Brazil. The site where the language can be downloaded would be http://www.lua.org/ Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of rockysmolin at bchacc.com Sent: Wednesday, April 13, 2011 9:56 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language Noah is 14 and started a few years back - now he's the programmer for the robotics team that won the regional competition and we're going to St. Louis in 2 weeks for the national competition (OK now you're just braggin' Smolin, cut to the chase) He knows a bunch of languages now and is a linux geek. I think they have no trouble learning the syntax of a language. What I taught him was technique - our bag o' tips and tricks, how to use variable names that mean something, how to comment code out of self defense, arrays, structuring your program with basic building blocks of functions and subs, stuff like that. And I'd give you son a simple task to complete - I never learned anything in programming that I didn't have to, that is, I could never force myself to learn something without an application. And a language that fits the application. Noah does a lot with LUA. Java and C might be better for him. But I don't think that matters too much as we know the skills from one language transfer to other langauges. But what would be cool is if he could learn enough Access to start on some simple maintenance tasks for you - modify a form or a report, add a field, stuff like that. Eventually he works into a paying job. :) ROcky Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, April 11, 2011 11:27 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] New Language My 10 year old son is independently and without prompting asking dad to teach him how to program a computer. :) It appears that he has decided that what dad does is pretty cool. Anyway, I think I will look at this with Robbie. I think I will also start teaching him Access. IMHO, Access is a pretty easy to use programming environment, with the debug window to just execute code, buttons to press to cause code to run, and text boxes (unbound) to enter data in for things like a simple "add two numbers" first project. Does anyone want to share "teaching the kids" stories? John W. Colby www.ColbyConsulting.com On 3/25/2011 5:41 PM, Stuart McLachlan wrote: > For all you people who are looking at moving away from Acces who want > something easy to use and are wedded to the .Net world, MS have just the thing for you: > > http://msdn.microsoft.com/en-us/beginner/ff384126.aspx > > :-) > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 14 13:01:00 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:01:00 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C0B7.9070509@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: Wow... a little snarky today, are we? Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, both were considered properties... and that isn't me 'protesting till the cows come home', it's how it is. If it's not, if you can show me some documentation that refers to 'Public SomeVariable As String' as being a FIELD in VB 6, I will gladly apologize and bow to your superior knowledge. ;) As for the lazy programmer comment..... who's the one that uses the 'canned' bound format? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:39 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, > Both create a 'property' called SomeValue. No they don't! A field is *not* a property. A field stores data. A property is code that (may or may not) get / set a field. Setting a field public makes it emulate a property which retrieves that field but the two are not the same thing. A property may or may not even reference data. A property may simply return a hard coded value. property get SomeValue() as int SomeValue = 1/3 end property You may protest till the cows come home that is not what *you* call a property, but none the less it is a property. Private int MyValue property Get myValue() as int return myValue end property MyValue is a field not a property. It stores an integer. myValue is a property, it gets but does not allow the external world to set, MyValue. Entirely different. I understand that you are a lazy programmer, we have had this discussion before. Your claim was IIRC that exposing your fields as public was much less work than making them private and exposing them via properties, and properties were pretty much useless. You fell into the trap of thinking of them as the same thing. Properties are very valuable constructs and exist for a reason. John W. Colby www.ColbyConsulting.com On 4/13/2011 6:22 PM, Drew Wutka wrote: > Figured I'd post this here, for those that may be tinkering or thinking > about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:03:01 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:03:01 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA6C198.7060305@colbyconsulting.com> References: <4DA6C198.7060305@colbyconsulting.com> Message-ID: Man, did I piss in your wheaties or something? Programming style, safety of my code? Wow, you like kicking dirt.... be careful there buddy.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 4:43 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB > Does it affect anything other than Reflection? Your programming style? ;) The safety of your code? ;);) Side effects down the road when you need to modify the field on the way in / out? ;););) John W. Colby www.ColbyConsulting.com On 4/13/2011 11:49 PM, Drew Wutka wrote: > Does it affect anything other than Reflection? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Wednesday, April 13, 2011 6:06 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Yep, that confuses everyone until you get used to it. > > Charlotte Foust > > On Wed, Apr 13, 2011 at 3:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or thinking >> about tinkering with .Net. >> >> >> >> In VB, one of the 'limitations' that was kind of annoying was >> dynamically referring to the 'properties' of a class module. >> >> >> >> For example, if I wanted the column name from a recordset, I could do >> this: >> >> >> >> Msgbox rs.Fields.Item(0).Name >> >> >> >> But, what if I wanted to get it programmatically, .Name is hard coded: >> >> >> >> Msgbox rs.Fields.Item(0).Properties("BASECOLUMNNAME") >> >> >> >> That would allow me to put a variable in the properties 'property', to >> retrieve a value dynamically. >> >> >> >> However, with a standard class module, in VB6/VBA, the only way, I could >> find, to do this, was to put in extra code into a class module to create >> a 'Properties' Property. In fact, I had written an Add-on in VB6 that >> did this for me (created a properties property). Put a LOT of extra >> code into your module though. >> >> >> >> In VB.Net, there is a built in capability to do this with the Reflection >> Library. So here is what I stumbled on. I was all excited to use the >> Reflection library on a particalur class where I needed to dynamically >> list, set, and get properties of a class I built..... >> >> >> >> The catch... >> >> >> >> In VB: >> >> >> >> Public SomeValue as String >> >> - And - >> >> Property Get SomeValue() as string >> >> SomeValue=strTemp >> >> End Property >> >> >> >> Both create a 'property' called SomeValue. >> >> >> >> In VB.Net >> >> Public SomeValue as String >> >> Public Property SomeValue() as String >> >> Get >> >> Return strTemp >> >> End Get >> >> Let (value) >> >> strTemp=value >> >> End Let >> >> End Property >> >> >> >> In the first line, SomeValue is considered a FIELD, not a property. The >> SomeValue defined with Get/Let statements...THAT'S a PROPERTY. >> >> >> >> Go figure. Drove me nuts, couldn't figure out why I wasn't getting at >> all of my properties...until I figured out that some were properties >> some were "FIELDS". >> >> >> >> LOL. >> >> >> >> Of course, there will probably be a dozen people that already knew >> that...I'm so late to the game with .Net >> >> >> >> Drew >> >> >> The information contained in this transmission is intended only for the person or entity >> to which it is addressed and may contain II-VI Proprietary and/or II-VI Business >> Sensitive material. If you are not the intended recipient, please contact the sender >> immediately and destroy the material in its entirety, whether electronic or hard copy. >> You are notified that any review, retransmission, copying, disclosure, dissemination, >> or other use of, or taking of any action in reliance upon this information by persons >> or entities other than the intended recipient is prohibited. >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:04:19 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:04:19 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: No, I hand code the properties... I encapsulate my data tables in classes that handle the data the way I want it handled. Directly linking tables to user 'visible' controls is the lazy and dangerous way to do things.... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, April 14, 2011 5:27 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John Aren't we all? At least constantly aiming to be more efficient. That's why Drew will right-click the field, select Refactor, Encapsulate Field .., and get done with it. /gustav >>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> I understand that you are a lazy programmer .. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From charlotte.foust at gmail.com Thu Apr 14 13:16:22 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Thu, 14 Apr 2011 11:16:22 -0700 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Thu Apr 14 13:20:38 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Thu, 14 Apr 2011 13:20:38 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From DWUTKA at Marlow.com Thu Apr 14 13:55:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:55:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: Message-ID: Nah, this is like two geeks arguing over who is faster, Superman or the Flash. Just break out the popcorn. ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous way > to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, Encapsulate > Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Thu Apr 14 13:57:09 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 13:57:09 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> References: <49A286ABF515E94A8505CD14DEB721700DCFE183@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: And we can send them to camp JWC, to be trained by the Fuhrer himself! 'You call that code?' 'It's sloppy, lazy!' 'Wrap that simple class field in 100 lines of code!' 'Drop and give me 300 lines of error handling! On the double!' ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rusty Hammond Sent: Thursday, April 14, 2011 1:21 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB I can't wait until we get all the kids programming then get them setup on AccessD ;-) Rusty -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, April 14, 2011 1:16 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Oh, boy! Break out the fire extinguishers everyone, here we go again!! Charlotte Foust On Thu, Apr 14, 2011 at 11:04 AM, Drew Wutka wrote: > No, I hand code the properties... ?I encapsulate my data tables in > classes that handle the data the way I want it handled. ?Directly > linking tables to user 'visible' controls is the lazy and dangerous > way to do things.... > > > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav > Brock > Sent: Thursday, April 14, 2011 5:27 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Hi John > > Aren't we all? At least constantly aiming to be more efficient. > That's why Drew will right-click the field, select Refactor, > Encapsulate Field .., and get done with it. > > /gustav > > >>>> jwcolby at colbyconsulting.com 14-04-2011 11:39 >>> > > I understand that you are a lazy programmer .. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com The information contained in > this transmission is intended only for the person or entity to which > it is addressed and may contain II-VI Proprietary and/or II-VI > Business Sensitive material. If you are not the intended recipient, > please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 14 14:26:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Apr 2011 15:26:37 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> Message-ID: <4DA74A6D.7000706@colbyconsulting.com> LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. From DWUTKA at Marlow.com Thu Apr 14 14:43:23 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 14:43:23 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA74A6D.7000706@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: Well VBA is a subset of VB 6. Can you show me any documentation where it defines a Public statement as setting a 'field' to a class, versus Property statement setting a property, in VBA? When in the IDE, if you have Public MyValue or Property Get MyOther value, both will show up with the same 'property' icon in the IDE. No declaration that 'MyValue' (in this case) is a 'field' in the Object browser. In .Net, it DOES have a different icon in the IDE. Fields and Properties are given completely different icons in autosensing drop downs. It makes a clear distinction. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 14, 2011 2:27 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB LOL. Snarky? I like it. I never really did VB6 so i can't discuss that. In VBA a field and a property are not the same, and in .Net they are not the same so i assume the same for VB6. "Considered a property" by who? One says "property" in the definition line and the other says public varname. I certainly wouldn't consider them both properties. ;) John W. Colby www.ColbyConsulting.com On 4/14/2011 2:01 PM, Drew Wutka wrote: > Wow... a little snarky today, are we? > > Actually was describing a DIFFERENCE between VB 6 and VB.Net. In VB 6, > both were considered properties... and that isn't me 'protesting till > the cows come home', it's how it is. If it's not, if you can show me > some documentation that refers to 'Public SomeVariable As String' as > being a FIELD in VB 6, I will gladly apologize and bow to your superior > knowledge. ;) > > As for the lazy programmer comment..... who's the one that uses the > 'canned' bound format? > > > > Drew > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 14, 2011 4:39 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > > Both create a 'property' called SomeValue. > > No they don't! A field is *not* a property. > > A field stores data. > > A property is code that (may or may not) get / set a field. Setting a > field public makes it emulate > a property which retrieves that field but the two are not the same > thing. > > > A property may or may not even reference data. A property may simply > return a hard coded value. > > property get SomeValue() as int > SomeValue = 1/3 > end property > > You may protest till the cows come home that is not what *you* call a > property, but none the less it > is a property. > > Private int MyValue > > property Get myValue() as int > return myValue > end property > > MyValue is a field not a property. It stores an integer. > > myValue is a property, it gets but does not allow the external world to > set, MyValue. > > Entirely different. > > I understand that you are a lazy programmer, we have had this discussion > before. Your claim was > IIRC that exposing your fields as public was much less work than making > them private and exposing > them via properties, and properties were pretty much useless. You fell > into the trap of thinking of > them as the same thing. Properties are very valuable constructs and > exist for a reason. > > John W. Colby > www.ColbyConsulting.com > > On 4/13/2011 6:22 PM, Drew Wutka wrote: >> Figured I'd post this here, for those that may be tinkering or > thinking >> about tinkering with .Net. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 15:04:47 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 13:04:47 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky From DWUTKA at Marlow.com Thu Apr 14 15:20:08 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 14 Apr 2011 15:20:08 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 14 16:20:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:20:26 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <03E535F8605A444BA1A55E3B9B4D1058@HAL9005> Client found these links: http://en.kioskea.net/forum/affich-26059-rename-file-with-datetime-appended- to-filenam http://www.computing.net/answers/dos/can-a-batch-file-get-a-files-datetime-s tamp/318.html Reminds me of how much stuff we used to do with batch files. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 14, 2011 1:20 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Not sure about xcopy, but robocopy has that kind of ability. Robocopy used to be only available the extra resources CD you had to buy separately, but it's included in Windows 7 now. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 16:35:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 14:35:49 -0700 Subject: [AccessD] 2010 Version Message-ID: Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From garykjos at gmail.com Thu Apr 14 16:43:15 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 16:43:15 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From BradM at blackforestltd.com Thu Apr 14 16:43:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Thu, 14 Apr 2011 16:43:22 -0500 Subject: [AccessD] Add Date/Time Stamp to xcopy target References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From accessd at shaw.ca Thu Apr 14 16:44:28 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Apr 2011 14:44:28 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <07230D1FF5AD4611A350B33814B094C6@HAL9005> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Thu Apr 14 16:54:25 2011 From: df.waters at comcast.net (Dan Waters) Date: Thu, 14 Apr 2011 16:54:25 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <003f01cbfaee$85bd3080$91379180$@comcast.net> Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Thu Apr 14 16:55:14 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 14 Apr 2011 14:55:14 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rockysmolin at bchacc.com Thu Apr 14 17:47:34 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:47:34 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:19 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> Message-ID: Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Rocky, I am sure that there are many ways to do this. Here is the technique that I have been using for a couple years with no problems. Brad ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ; This script uses a free Open Source tool called AutoHotKey www.autohotkey.com ; ; This script copies a file to a new file that has a date-time stamp in the file name ; ; Here is an example file name that was created with this script ; ; C:\MyFile_Date_2011-04-14_Time_16-27-01.txt ; ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ FormatTime, Date_String,, yyyy-MM-dd ;;; Format a string called Date_String FormatTime, Time_String,, HH-mm-ss ;;; Format a string called Time_String Date_Time_String = Date_%Date_String%_Time_%Time_String% ;;; Build a string called Date_Time_String Filecopy, C:\MyFile.txt, C:\MyFile_%Date_Time_String%.txt ;;; Copy the file to a new file with Date Time in Name ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:48:45 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:48:45 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> Message-ID: <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Thanks. Will forward. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Thursday, April 14, 2011 2:44 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 1:05 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp to xcopy target Dear List: Client wants to do regular backup to his EHD using Windows Scheduler. He's almost there but has a question: The following in a batch file seems to work for backing up DocketWorks: xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" Do you know if there is some way to append a date time stamp to it so it does not always overwrite the previous backup? Anyone know? TIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:50:18 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:50:18 -0700 Subject: [AccessD] 2010 Version In-Reply-To: <003f01cbfaee$85bd3080$91379180$@comcast.net> References: <003f01cbfaee$85bd3080$91379180$@comcast.net> Message-ID: <0A5CEF40B05C4D5D9E0F77A5CAAAAB5E@HAL9005> Good thinkin'. Covers me for the rest of my life. Or the product 's life. Of course, that's assuming that DoCmd.ShowToolbar "Ribbon", acToolbarNo works so well and is so bulletproof that MS will feel compelled to replace it with something else we'll have to learn. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Thursday, April 14, 2011 2:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version Hi Rocky, Perhaps just checking >= 12 would be sufficient? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 14, 2011 4:36 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] 2010 Version Dear List: In my code I test for Access 2007 and turn off the ribbon if it's 2007 using: If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo If I want to check for 2010, what version number should I use? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 14 17:51:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 14 Apr 2011 15:51:26 -0700 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <20E088CEE08447F1BEB51DD59AB3EAE9@HAL9005> Dunno. If it happened more than three weeks ago, it's gone from my cache. But, law of averages says, I got it from this list. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 14, 2011 2:55 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version That's some cool code, Rocky. Where'd you get it ;P Actually, you can probably try: If Application.Version >= 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo On Thu, Apr 14, 2011 at 2:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Thu Apr 14 17:59:01 2011 From: garykjos at gmail.com (Gary Kjos) Date: Thu, 14 Apr 2011 17:59:01 -0500 Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From Darryl.Collins at iag.com.au Thu Apr 14 19:26:56 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:26:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150027.p3F0R3lU012257@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ hahaha, reminds me of the logic when you are using code to write from Access to Excel. Used to be 5.0 (has been for years - ie Excel 5.0;HDR=YES;IMEX=2;DATABASE=etc...). Now XL2007+ is being used you have use Excel 8.0 or it fails. Now neither of those numbers align with the XL versions being used. And what happened to 6 & 7? Logically you would think, "ok change it to 6". I am not really asking, I am sure if I Google it hard enough I could find out for myself. It is just one of those things that trip you up when you least expected it and the obvious answer is the wrong one. :) fun stuff. Just having a cheap and quiet little rant over here... cheers Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, 15 April 2011 8:48 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] 2010 Version They took off a year? (Whatever happened to Preparations A through G?) R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Thursday, April 14, 2011 2:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version 14 is the magic number http://en.wikipedia.org/wiki/Microsoft_Access GK On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin wrote: > Dear List: > > In my code I test for Access 2007 and turn off the ribbon if it's 2007 > using: > > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", > acToolbarNo > > If I want to check for 2010, what version number should I use? > > MTIA > > > Rocky Smolin > > Beach Access Software > > 858-259-4334 > > Skype: rocky.smolin > > www.e-z-mrp.com > > www.bchacc.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From Darryl.Collins at iag.com.au Thu Apr 14 19:27:55 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Fri, 15 Apr 2011 10:27:55 +1000 Subject: [AccessD] 2010 Version In-Reply-To: Message-ID: <201104150028.p3F0S1RN012807@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ and yet it was still cursed... Guess you cannot escape ya fate ;) -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos Sent: Friday, 15 April 2011 8:59 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] 2010 Version Skipped the perceived unlucky number 13 which should have been for 2007 version since nobody liked it. GK On Thu, Apr 14, 2011 at 5:47 PM, Rocky Smolin wrote: > They took off a year? ?(Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Thu Apr 14 22:40:24 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 15 Apr 2011 13:40:24 +1000 Subject: [AccessD] Add Date/Time Stamp to xcopy target In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DA7BE28.31054.5F4DF65@stuart.lexacorp.com.pg> Not file renaming :-( -- Stuart On 14 Apr 2011 at 15:20, Drew Wutka wrote: > Not sure about xcopy, but robocopy has that kind of ability. Robocopy > used to be only available the extra resources CD you had to buy > separately, but it's included in Windows 7 now. > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky > Smolin Sent: Thursday, April 14, 2011 3:05 PM To: 'Access Developers > discussion and problem solving' Subject: [AccessD] Add Date/Time Stamp > to xcopy target > > Dear List: > > Client wants to do regular backup to his EHD using Windows Scheduler. > He's almost there but has a question: > > The following in a batch file seems to work for backing up > DocketWorks: > > > > xcopy "W:\DWData.mdb" "C:\ProgramData\DocketWorks" > > > > Do you know if there is some way to append a date time stamp to it so > it does not always overwrite the previous backup? > > Anyone know? > > > > TIA > > > > Rocky > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > The information contained in this transmission is intended only for > the person or entity to which it is addressed and may contain II-VI > Proprietary and/or II-VI Business Sensitive material. If you are not > the intended recipient, please contact the sender immediately and > destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, > dissemination, or other use of, or taking of any action in reliance > upon this information by persons or entities other than the intended > recipient is prohibited. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Fri Apr 15 03:33:33 2011 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 15 Apr 2011 10:33:33 +0200 Subject: [AccessD] Add Date/Time Stamp to xcopy target Message-ID: Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim From jwcolby at colbyconsulting.com Fri Apr 15 07:43:58 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 08:43:58 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> Message-ID: <4DA83D8E.5020106@colbyconsulting.com> Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if you > have Public MyValue or Property Get MyOther value, both will show up > with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew From shamil at smsconsulting.spb.ru Fri Apr 15 09:26:41 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 18:26:41 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 10:05:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:05:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: LOL.... what a long winded way of saying 'No, it's not documented, it's my personal definition'. Your view here is based on a granular perspective of VB6 (remember, we are talking about VBA and VB6 here, there is a CLEAR defined difference between a Field and a Property in .Net). You are looking at the definition of a property from INSIDE the class. If you take a more bird's eye view of class a property is a value. A class is an object. Regardless of what each individual line of code within a class module says, a class is an object defined and structured to represent something. A Function is set of instructions that you start with a call. A Class is an object, that you create, mold, store, manipulate, etc. With this type of view, it is irrelevant as to whether a property is defined with a Public statement or a property statement, it is still a 'property' of a class. If you were to build a 'Rubber Ball' class, and gave it a Color property, from the outside world (to the class), the property is a value that can be set or retrieved (or one or the other). The outside world, to the class, doesn't care how it is defined. .Net makes a distinction, in documentation and intellisense. But Property is a keyword and Field is not. But back to VBA and VB6, let's go even more granular then your view here. What is the machine code difference between: Public MyValue as string And Property Get MyValue() as String MyValue=strValue End Property Property Let MyValue(strEnter as String) strValue=strEnter End Property ??? Do you think that thep code, when this is compiled, is doing anything different? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 7:44 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Fri Apr 15 10:08:21 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 10:08:21 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com><4DA83D8E.5020106@colbyconsulting.com> Message-ID: Bingo, you said it better though... thanks! Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Friday, April 15, 2011 9:27 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] First real stumble with using VB.Net over VB Hi John -- Public class modules variables are implemented in VB6 and VBA the same way as properties IOW they have the same programmatic interface from VB6/VBA (and COM) internals point of view. - this is what Drew has been telling about here... Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 16:44 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, I can't show you documentation but what I can do is show you that a property is a function of sorts. It has an entry point on the stack, it accepts a parameter, it returns a value. It has a keyword in the VB language. It can run any amount of code inside of the "function", and do anything that is legal for a function to do including dimensioning, reading and writing other variables, running loops, doing if then / select case etc., reading and writing to the disk, downloading files from the internet, formatting your hard disk... you name it. A property is a function. It happens to be targeted to wrapping variables and exposing them to the outside world but that is not all it can do. A property does not *define* the variable, that is done in the dimension statement. A property does not "own" the variable that it wraps, it is simply *returning* the variable. A property does not have any data storage area on the heap unless it happens to dimension its own variables inside of the property, and even then (except for strings and statics) most variables inside of functions are stored on the stack. A variable, whether global or private is nothing more than a reserved area of memory on the heap sized to accept a specific data type. A variable is not a property, as you can now plainly see from the explanation above of what a property is and what a variable is. How can you possibly expect them to be or work the same. They are different things entirely. The fact that the IDE displays the same icon is unfortunate (for you) because it causes you to have false expectations. Stop arguing about it and accept the reality. I didn't make the language, I just look at what things are and use them appropriately. John W. Colby www.ColbyConsulting.com On 4/14/2011 3:43 PM, Drew Wutka wrote: > Well VBA is a subset of VB 6. Can you show me any documentation where > it defines a Public statement as setting a 'field' to a class, versus > Property statement setting a property, in VBA? When in the IDE, if > you have Public MyValue or Property Get MyOther value, both will show > up with the same 'property' icon in the IDE. No declaration that 'MyValue' > (in this case) is a 'field' in the Object browser. > > In .Net, it DOES have a different icon in the IDE. Fields and > Properties are given completely different icons in autosensing drop > downs. It makes a clear distinction. > > Drew -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jedi at charm.net Fri Apr 15 11:10:26 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 15 Apr 2011 12:10:26 -0400 (EDT) Subject: [AccessD] 2010 Version In-Reply-To: References: Message-ID: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> You forgot Preparation H. Mike > They took off a year? (Whatever happened to Preparations A through G?) > > R > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos > Sent: Thursday, April 14, 2011 2:43 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] 2010 Version > > 14 is the magic number > > http://en.wikipedia.org/wiki/Microsoft_Access > > GK > > On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin > wrote: >> Dear List: >> >> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >> using: >> >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >> acToolbarNo >> >> If I want to check for 2010, what version number should I use? >> >> MTIA >> >> >> Rocky Smolin >> >> Beach Access Software >> >> 858-259-4334 >> >> Skype: rocky.smolin >> >> www.e-z-mrp.com >> >> www.bchacc.com >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > Gary Kjos > garykjos at gmail.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Fri Apr 15 14:26:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 15:26:20 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA89BDC.4020409@colbyconsulting.com> So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com On 4/15/2011 10:26 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Public class modules variables are implemented in VB6 and VBA the same way > as properties IOW they have the same programmatic interface from VB6/VBA > (and COM) internals point of view. - this is what Drew has been telling > about here... > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 15 ?????? 2011 ?. 16:44 > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a property > is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns a > value. It has a keyword in the VB language. It can run any amount of code > inside of the "function", and do anything that is legal for a function to do > including dimensioning, reading and writing other variables, running loops, > doing if then / select case etc., reading and writing to the disk, > downloading files from the internet, formatting your hard disk... you name > it. > > A property is a function. It happens to be targeted to wrapping variables > and exposing them to the outside world but that is not all it can do. A > property does not *define* the variable, that is done in the dimension > statement. A property does not "own" the variable that it wraps, it is > simply > *returning* the variable. A property does not have any data storage area on > the heap unless it happens to dimension its own variables inside of the > property, and even then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved area > of memory on the heap sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a property is and what a variable is. How can you > possibly expect them to be or work the same. They are different things > entirely. The fact that the IDE displays the same icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the language, I > just look at what things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > > On 4/14/2011 3:43 PM, Drew Wutka wrote: >> Well VBA is a subset of VB 6. Can you show me any documentation where >> it defines a Public statement as setting a 'field' to a class, versus >> Property statement setting a property, in VBA? When in the IDE, if >> you have Public MyValue or Property Get MyOther value, both will show >> up with the same 'property' icon in the IDE. No declaration that > 'MyValue' >> (in this case) is a 'field' in the Object browser. >> >> In .Net, it DOES have a different icon in the IDE. Fields and >> Properties are given completely different icons in autosensing drop >> downs. It makes a clear distinction. >> >> Drew > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From shamil at smsconsulting.spb.ru Fri Apr 15 14:54:31 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 15 Apr 2011 23:54:31 +0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <3870F1BDA6774925B9CD59D1B66F5C3F@nant> Hi John -- <<< Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not >>> But they are the same from *technical* (VBA/VB6/COM) point of view - that is what Drew is telling... IOW: they are looking the same for outer world. Drew doesn't care about their internal implementation or high level concepts... Nobody argues here when one or another coding style/approach should be used or that one is better than another one because of ... OA: They are the same from *technical* point of view/perspective of VBA/VB6/COM. Try the following VBA/VB6 code: ------------- cut here ----- ' class MyClass Public MyTestVar As String Private m_myTestVar2 As String Property Get MyTestVar2() As String MyTestVar2 = m_myTestVar2 End Property Property Let MyTestVar2(ByVal v As String) m_myTestVar2 = v End Property ------------- cut here ----- ' standard module - MyTestModule Public Sub MyTest() Dim c As MyClass Set c = New MyClass Dim result As String CallByName c, "MyTestVar", VbLet, "MyTestValue" result = CallByName(c, "MyTestVar", VbGet) Debug.Print "Result from public variable = " + result CallByName c, "MyTestVar2", VbLet, "MyTestValue2" result = CallByName(c, "MyTestVar2", VbGet) Debug.Print "Result from public variable2 = " + result End Sub ------------- cut here ----- Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 15 ?????? 2011 ?. 23:26 To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com From DWUTKA at Marlow.com Fri Apr 15 15:11:48 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 15:11:48 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA89BDC.4020409@colbyconsulting.com> Message-ID: Boy John, you don't read anything I wrote. The entire point was about a difference between .Net and VB6/VBA. No point in explaining further, your soapbox is above the level I care to engage at. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 2:26 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB So what you are saying (and I have no reason to disbelieve this) is that a public variable is a private variable wrapped in an invisible property call. If that is truly the case (and they are identical) then why does he see value / property differences? And everything that I said below stands. A variable (field when placed in a class) is a structure on the heap (apparently then wrapped in something to return the value to make it public), whereas a property is a keyword and a real function which can contain other stuff and does not contain any storage of it's own. I defy you to show me a variable running code to wipe your disk, but I can do so with a property. They are *not* the same thing. The fact that a public class variable "kinda sorta" emulates a private variable with a property wrapper does not make it a private variable with a real property returning the value. I truly don't give a rat's patuty if you or Drew wants to call a public variable a property. Apparently Drew desperately wants to do so - reason unknown. As I am not a VB6 person I have no vested interest either way, I am just pointing out the quite obvious problem with trying to apply the same name to two objects that perform quite differently and have quite different capabilities. I use properties and I often times have code in them which performs calculations or tests. I have never managed to do that with a variable of any kind. I have had properties which did not wrap a variable at all. A property (keyword / function) does not have any specific storage assigned to it unless you do so, intentionally, with more code. A variable ALWAYS has storage assigned on the stack / heap. Call both whatever you want, just please do not attempt to tell me that they are the same thing, they clearly are not. I will continue to call variables in a class a field and I will continue to call properties (keyword / function) a property. Everybody except Drew will understand me. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Fri Apr 15 15:18:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 16:18:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8A816.9000705@colbyconsulting.com> Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com On 4/15/2011 11:05 AM, Drew Wutka wrote: > LOL.... what a long winded way of saying 'No, it's not documented, it's > my personal definition'. > > Your view here is based on a granular perspective of VB6 (remember, we > are talking about VBA and VB6 here, there is a CLEAR defined difference > between a Field and a Property in .Net). You are looking at the > definition of a property from INSIDE the class. If you take a more > bird's eye view of class a property is a value. A class is an object. > Regardless of what each individual line of code within a class module > says, a class is an object defined and structured to represent > something. A Function is set of instructions that you start with a > call. A Class is an object, that you create, mold, store, manipulate, > etc. > > With this type of view, it is irrelevant as to whether a property is > defined with a Public statement or a property statement, it is still a > 'property' of a class. If you were to build a 'Rubber Ball' class, and > gave it a Color property, from the outside world (to the class), the > property is a value that can be set or retrieved (or one or the other). > The outside world, to the class, doesn't care how it is defined. > > .Net makes a distinction, in documentation and intellisense. But > Property is a keyword and Field is not. > > But back to VBA and VB6, let's go even more granular then your view > here. > > What is the machine code difference between: > > Public MyValue as string > > And > > Property Get MyValue() as String > MyValue=strValue > End Property > Property Let MyValue(strEnter as String) > strValue=strEnter > End Property > > ??? Do you think that thep code, when this is compiled, is doing > anything different? > > Drew > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 7:44 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > I can't show you documentation but what I can do is show you that a > property is a function of sorts. > It has an entry point on the stack, it accepts a parameter, it returns > a value. It has a keyword > in the VB language. It can run any amount of code inside of the > "function", and do anything that is > legal for a function to do including dimensioning, reading and writing > other variables, running > loops, doing if then / select case etc., reading and writing to the > disk, downloading files from the > internet, formatting your hard disk... you name it. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the > outside world but that is not all it can do. A property does not > *define* the variable, that is > done in the dimension statement. A property does not "own" the variable > that it wraps, it is simply > *returning* the variable. A property does not have any data storage > area on the heap unless it > happens to dimension its own variables inside of the property, and even > then (except for strings and > statics) most variables inside of functions are stored on the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap > sized to accept a specific data type. > > A variable is not a property, as you can now plainly see from the > explanation above of what a > property is and what a variable is. How can you possibly expect them to > be or work the same. They > are different things entirely. The fact that the IDE displays the same > icon is unfortunate (for > you) because it causes you to have false expectations. > > Stop arguing about it and accept the reality. I didn't make the > language, I just look at what > things are and use them appropriately. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From rockysmolin at bchacc.com Fri Apr 15 15:30:27 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 15 Apr 2011 13:30:27 -0700 Subject: [AccessD] Add Date/Time Stamp to xcopy target + New Language In-Reply-To: References: Message-ID: <9DC7EA07277745B39387C0607ACA09F4@HAL9005> John: I gave the task to Noah - he knows batch files. Told him $25. He's learned a bit more about batch files a lot more about testing, communicating with the user, and reworking based on finding out 'what they really want'. Between that, the $15 he got for recycling bottles, and his allowance, he's having a really good day. :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 15, 2011 1:34 AM To: accessd at databaseadvisors.com; accessd at shaw.ca Subject: Re: [AccessD] Add Date/Time Stamp to xcopy target Hi Jim Ping for wait? That's clever. I haven't seen that before, but why not. /gustav >>> accessd at shaw.ca 14-04-11 23:44 >>> I have a chuck of code that actually creates a new directory, using the current date and then copies the information into into and the system runs this batach file every and has been running for years...It is only limited by the size of the backup drive. :: The complete data backup @echo off set dt=none for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set dt=%%k%%i%%j md c:\backups\%dt% cd c:\backups\%dt% echo Create Master Backup xcopy s: c: /y /q echo Update completed... ping -n 10 127.0.0.1 >NUL exit HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Apr 15 16:09:34 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 15 Apr 2011 16:09:34 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: Actually John, now that you've come down a bit on your soapbox, I will try to clarify for you. As a VB/VBA programmer, nothing I ever read about VB referred to 'Public SomeValue as string' as a FIELD. In fact, it was always referred to it as a PROPERTY of a class object. I have ASKED if you have any supporting documentation, like some Microsoft white paper, or something I should have read when becoming proficient in VB(6/VBA), where I would have learned that the correct term for 'Public SomeValue As SomeType' in a VB/VBA class module was FIELD. I can show you PLENTY of documentation where the reverse is the case. http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual Basic Concepts / Customizing Form Classes' Straight out of the MSDN, when talking about Class modules in VB6. It refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public Comment As String' as 'click on it to play back its Comment PROPERTY'. Or how about: http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual Basic Concepts / Class Module Step by Step'. You won't find the WORD 'field' on that page, and it refers to 'Public Name As String' AS A PROPERTY. Straight from the designers of VB 6's mouth, JWC. Now admittedly, I'm only bringing MSDN articles into the fray. I'm not taking your approach, that you've been programming since you built THE FIRST Antikythera mechanism, so what you say is how it is. To begin with, you are absolutely, 100% incorrect in stating that there is ANY difference in performance OR FUNCTIONALITY between: Public MyValue as String And Dim strMyValue as string Property Get MyValue() As String MyValue=strMyValue End Property Property Let MyValue(strEnter As String) strMyValue=strEnter End Property The only difference above is that one uses 1 line of code, the other uses 7 lines of code, in the source code. That is it. When you express what else you can do with Get/Let statements, you are going OUTSIDE the scope of declaring what a BASIC property is. Yes, you can put error handling into the statements above, but that changes the strictest definition of a 'SIMPLE' property. You can add extra arguments, logic, processes, etc. All going OUTSIDE of the definition of a 'simple property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 liner property, and converting it until actual Get and Let statements (or Set) for more functionality down the road. In .Net, there IS a problem, because if you are using Reflection, the Field is now a Property (in .Net terms), so it will be in a different collection in Reflection. Back to my original point, to this thread, I have been using .Net for about a year now, since I was out of the development world for a while. I have only recently had a reason to use Reflection, which I stumbled on, because as a VB 6 Programmer, there WAS no distinction between property declaration types like there is in .Net. I am not complaining that there is a difference, in fact, it is quite handy to have two separate Reflection collections to use. I was simply stating that it was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or are just crossing the bridge into the .Net world. Like saying that there is no more Variant variable type. Would you like to give us a tirade about how Variant types never truly existed, and how I personally will never understand that concept? Seriously John, you need to read more than a few lines of my posts. A lot of what you have said makes you sound like an a$$, not as a skilled professional. My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 3:19 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Drew, What is clear is that you are using the definition of a property as "a unit of information about" which absolutely one of many English language (and programming) definitions of property. You have already told us (as have I) that a public field and a property (keyword / function) behave differently. The problem is yours not mine. I understand and use your definition in the same way you do. I do not expect a public field to behave in the same way that a property (keyword / function) does because they are fundamentally different things. Personally I do not call a public field a property, I call it a public field (in programmer speak), though of course it is a property in English language speak. You no longer expect them to behave the same because you have discovered that they are fundamentally different things. Where is the argument? Everyone now understands that you want to (and will probably) call public fields properties and moan that they behave differently. To which I respond - NSS. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From stuart at lexacorp.com.pg Fri Apr 15 17:33:59 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:33:59 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA83D8E.5020106@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com> Message-ID: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Sorry, I can't agree with you there. A METHOD is a function. A PROPERTY is the external name given to a variable which is encapsulated in the class. i.e. for all intents and purposes outside of the object, it IS the variable. "PROPERTY SET" and "PROPERTY GET" are methods. The fact that you can also perform other actions when you SET a variable is irrelevant. You should be doing what it is saying and setting the value of the variable. When you GET it, you should be retrieving the value of the variable. Wiile it is possible to create SET/GET functions for a property so that GET doesn't return what is SET, it is a gross abuse of the whole Object concept. > > A property is a function. It happens to be targeted to wrapping > variables and exposing them to the outside world but that is not all > it can do. A property does not *define* the variable, that is done in > the dimension statement. A property does not "own" the variable that > it wraps, it is simply *returning* the variable. A property does not > have any data storage area on the heap unless it happens to dimension > its own variables inside of the property, and even then (except for > strings and statics) most variables inside of functions are stored on > the stack. > > A variable, whether global or private is nothing more than a reserved > area of memory on the heap sized to accept a specific data type. > From jwcolby at colbyconsulting.com Fri Apr 15 17:37:30 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 18:37:30 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8C8AA.6000102@colbyconsulting.com> >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > From stuart at lexacorp.com.pg Fri Apr 15 17:38:02 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:38:02 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA89BDC.4020409@colbyconsulting.com> References: , , <4DA89BDC.4020409@colbyconsulting.com> Message-ID: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > From stuart at lexacorp.com.pg Fri Apr 15 17:48:25 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 08:48:25 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8A816.9000705@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com> Message-ID: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> The problem as I see it is that "Public fields" are an abomination. Because Java has then, .Net has to as well :-( You should not be able to accept any "properties" of an object other than through GET/SET processes. -- Stuart On 15 Apr 2011 at 16:18, jwcolby wrote: > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" which absolutely one of many English > language (and programming) definitions of property. > > You have already told us (as have I) that a public field and a > property (keyword / function) behave differently. > > The problem is yours not mine. I understand and use your definition > in the same way you do. I do not expect a public field to behave in > the same way that a property (keyword / function) does because they > are fundamentally different things. Personally I do not call a public > field a property, I call it a public field (in programmer speak), > though of course it is a property in English language speak. > > You no longer expect them to behave the same because you have > discovered that they are fundamentally different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and moan that they behave differently. To > which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > From jwcolby at colbyconsulting.com Fri Apr 15 18:28:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:28:47 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> References: , , <4DA83D8E.5020106@colbyconsulting.com> <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> Message-ID: <4DA8D4AF.8050107@colbyconsulting.com> >> A PROPERTY is the external name given to a variable which is encapsulated in the class. LOL, absolutely and unequivocally not true. It is the name of some data value associated with or encapsulated by the class but it is simply *not* always and necessarily a variable. Nor is it an invalid use of a property if it is not a wrapped variable! There are properties that do not even reference a variable at all and they are perfectly valid uses of property. I can take three booleans and return a true of all are true (and I do exactly that in one of my properties). It is a property (English definition) that the class is stopped when three child classes are all stopped. The child objects use threads and write to a status control on a form. I cannot (don't want to) close the form until they are all stopped - their threads are no longer running. The form asks the manager if it is stopped when I try to close the form. It does so by checking the boolean stopped property of the manager. The boolean stopped property (get) asks the child objects if they are stopped and returns a true if all three are true else returns a false. It is not wrapping a variable, you can't set the stop variable, there isn't one. It is a valid property however. I can take 16 booleans and "translate them" into an integer value from 0 to 16 if that is what I need to do. A property (English) is a data value, but it is not necessarily a stored value and in fact it is quite often a calculated value. The fact that you personally say that is bad practice doesn't impress me. If I use the property to calculate a state (data item) of the class that is a property (English) of the class the same as your stored value is. I understand perfectly well that a property is not a function (or method) but it has more properties (English) of a function than a variable - public or otherwise. I used "function with quotes at the start of the thread to clearly denote that a property was not a function. However a property (keyword) is a call. It pushes the current address pointer on the stack. A property set (or let) pushes the value on the stack. Inside of the property other lines of code can and do run. A property does not inherently have any storage. They can do anything that is logical for a property to do. When it returns it's value (if a get) is placed on the stack and it unwinds the stack. Sounds much more "function" than a dimensioned variable. Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > Sorry, I can't agree with you there. > > A METHOD is a function. > > A PROPERTY is the external name given to a variable which is encapsulated in the class. > i.e. for all intents and purposes outside of the object, it IS the variable. > > "PROPERTY SET" and "PROPERTY GET" are methods. > > The fact that you can also perform other actions when you SET a variable is irrelevant. You > should be doing what it is saying and setting the value of the variable. When you GET it, you > should be retrieving the value of the variable. > > Wiile it is possible to create SET/GET functions for a property so that GET doesn't return > what is SET, it is a gross abuse of the whole Object concept. From jwcolby at colbyconsulting.com Fri Apr 15 18:29:09 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:09 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: <4DA8D4C5.8000902@colbyconsulting.com> Nonsense. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:38 PM, Stuart McLachlan wrote: > That is a gross abuse of the whole Object paradigm. > > On 15 Apr 2011 at 15:26, jwcolby wrote: > >> I have had properties which did not wrap a variable at all. >> > > From jwcolby at colbyconsulting.com Fri Apr 15 18:29:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 19:29:50 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> References: , , <4DA8A816.9000705@colbyconsulting.com> <4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> Message-ID: <4DA8D4EE.80503@colbyconsulting.com> Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > From davidmcafee at gmail.com Fri Apr 15 18:35:38 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 15 Apr 2011 16:35:38 -0700 Subject: [AccessD] is this date affected? Message-ID: I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From vbacreations at gmail.com Fri Apr 15 19:15:04 2011 From: vbacreations at gmail.com (William Benson) Date: Fri, 15 Apr 2011 20:15:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> Message-ID: Dumb question maybe... but have you tested that code in anything earlier than 2007?? I would think that the intrinsic constant is not recognized.... maybe compatibility mode handles...? On Apr 15, 2011 11:11 AM, "Michael Bahr" wrote: > You forgot Preparation H. > > Mike > >> They took off a year? (Whatever happened to Preparations A through G?) >> >> R >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gary Kjos >> Sent: Thursday, April 14, 2011 2:43 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] 2010 Version >> >> 14 is the magic number >> >> http://en.wikipedia.org/wiki/Microsoft_Access >> >> GK >> >> On Thu, Apr 14, 2011 at 4:35 PM, Rocky Smolin >> wrote: >>> Dear List: >>> >>> In my code I test for Access 2007 and turn off the ribbon if it's 2007 >>> using: >>> >>> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", >>> acToolbarNo >>> >>> If I want to check for 2010, what version number should I use? >>> >>> MTIA >>> >>> >>> Rocky Smolin >>> >>> Beach Access Software >>> >>> 858-259-4334 >>> >>> Skype: rocky.smolin >>> >>> www.e-z-mrp.com >>> >>> www.bchacc.com >>> >>> >>> >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> >> -- >> Gary Kjos >> garykjos at gmail.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 15 19:15:20 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:15:20 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. There, that's fixed it :-) -- Stuart On 15 Apr 2011 at 19:28, jwcolby wrote: > >> A PROPERTY is the external name given to a variable which is > encapsulated in the class. > > > LOL, absolutely and unequivocally not true. It is the name of some > data value associated with or encapsulated by the class but it is > simply *not* always and necessarily a variable. Nor is it an invalid > use of a property if it is not a wrapped variable! > > There are properties that do not even reference a variable at all and > they are perfectly valid uses of property. I can take three booleans > and return a true of all are true (and I do exactly that in one of my > properties). It is a property (English definition) that the class is > stopped when three child classes are all stopped. The child objects > use threads and write to a status control on a form. I cannot (don't > want to) close the form until they are all stopped - their threads are > no longer running. > > The form asks the manager if it is stopped when I try to close the > form. It does so by checking the boolean stopped property of the > manager. The boolean stopped property (get) asks the child objects if > they are stopped and returns a true if all three are true else returns > a false. > > It is not wrapping a variable, you can't set the stop variable, there > isn't one. It is a valid property however. > > I can take 16 booleans and "translate them" into an integer value from > 0 to 16 if that is what I need to do. A property (English) is a data > value, but it is not necessarily a stored value and in fact it is > quite often a calculated value. The fact that you personally say that > is bad practice doesn't impress me. If I use the property to > calculate a state (data item) of the class that is a property > (English) of the class the same as your stored value is. > > I understand perfectly well that a property is not a function (or > method) but it has more properties (English) of a function than a > variable - public or otherwise. I used "function with quotes at the > start of the thread to clearly denote that a property was not a > function. > > However a property (keyword) is a call. It pushes the current address > pointer on the stack. A property set (or let) pushes the value on the > stack. Inside of the property other lines of code can and do run. A > property does not inherently have any storage. They can do anything > that is logical for a property to do. > > When it returns it's value (if a get) is placed on the stack and it > unwinds the stack. > > Sounds much more "function" than a dimensioned variable. > > Drew mentioned my "soap box". I do not have a soap box, I am simply > insisting that we acknowledge the facts. I have no idea what goes on > in VB6 because I do not use it. However I have used a class or two > (or three maybe?) in Access so I do understand VBA. Obviously Drew is > a better (and wittier) programmer than I but let's attempt to > understand (and discuss so others can understand) what these things > are, what they do and when we are using an English definition and when > we are using a keyword, and when we are just using a vague kinda sorta > definition. > > And when we are using an object. A property is also often an object > in OO environments. > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 6:33 PM, Stuart McLachlan wrote: > > Sorry, I can't agree with you there. > > > > A METHOD is a function. > > > > A PROPERTY is the external name given to a variable which is > > encapsulated in the class. i.e. for all intents and purposes outside > > of the object, it IS the variable. > > > > "PROPERTY SET" and "PROPERTY GET" are methods. > > > > The fact that you can also perform other actions when you SET a > > variable is irrelevant. You should be doing what it is saying and > > setting the value of the variable. When you GET it, you should be > > retrieving the value of the variable. > > > > Wiile it is possible to create SET/GET functions for a property so > > that GET doesn't return what is SET, it is a gross abuse of the > > whole Object concept. > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 15 19:50:56 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 10:50:56 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net>, Message-ID: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Application.Version has been around for a long time. That code certainly works in A2K3. It does nothing. because Application.Version = 11. I use it for frequently for mdbs that are runnning in a mixed environment (A2K3 and A2007). On 15 Apr 2011 at 20:15, William Benson wrote: > Dumb question maybe... but have you tested that code in anything > earlier than 2007?? I would think that the intrinsic constant is not > recognized.... maybe compatibility mode handles...? ... > If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo From jwcolby at colbyconsulting.com Fri Apr 15 21:47:06 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 15 Apr 2011 22:47:06 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> References: , <4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg>, <4DA8D4AF.8050107@colbyconsulting.com> <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg> Message-ID: <4DA9032A.1060304@colbyconsulting.com> > OK. A property is the the external name given to the state of one or more variables ( scalar or object) encapsulated within the class.. Why do you insist on tying it to at least one variable? It isn't. I have a flag class (in C#). When that class instantiates, the constructor is fed a table, field and PK of a specific record and promptly loads the contents of that field into a variable. The variable may be a date (when an event occurred) or an integer (one means that process occurred, a zero means that process has not occurred). That class has a boolean which can be read or set. If it is set true, the property sets the variable "behind the scene" to either now() or 1 depending on the kind of flag it is. Additionally the property set causes a function to execute which dynamically constructs a sql statement and writes the date or integer into SQL Server. When you read the variable it returns the value associated with that flag, which is really a field in SQL server. So the property is boolean, but the actual variable read / written can be either a date or an integer. The property causes a fair bit of code to run which "interprets" something and returns a true / false. In fact if I so desired I could make the "variable" the actual data in the field in the specific record in SQL Server. This property exposes the boolean through a property (keyword) and that property is exposed to internal code of the parent object so that the parent object can read / write flags from SQL Server in a logical and consistent manner. I could, if I so desired, cause the property to read a serial port and return a value on a strain gauge, or the temperature of a sensor in a machine, or a frequency of a phase lock loop, or a value of an Analog to digital converter or the value of 2/3 rounded to 4 decimal places... In the end all you can really say about a property (get) is that it returns a unit of data. You may or may not be able to set the value. To call a register in a DToA a variable is a bit of a stretch, but if you insist that's fine. But the value of 2/3? No variables involved there. A property get returns a value, a property let accepts a value and does something with it. Storing it? Not necessarily. It may just feed it off to a machine somewhere which does something with the value. It could fire a stepper motor, or set a voltage in a Digital to Analog converter, or it could pull in a relay and spray water all over your computer. By the way that is a write only property which I lovingly call HoseTheTwitsdown. ;) It is a property of the Colbyizer class which has many different properties to allow me to do everything from HoseTheTwitsDown to BoottheTwitsOutTheDoorAt20000Feet. Don't make me use the more extreme properties. :) John W. Colby www.ColbyConsulting.com On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > OK. A property is the the external name given to the state of one or more variables ( scalar > or object) encapsulated within the class.. > > There, that's fixed it :-) > From stuart at lexacorp.com.pg Fri Apr 15 23:20:36 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 14:20:36 +1000 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA9032A.1060304@colbyconsulting.com> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> Message-ID: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Sorry, I can't accept that; A write-only property is the local equivalent of this: http://www.supersimplestorageservice.com/ If you can't get a meaningful value from it, then it is not a property - it is a method ( and I don't mean a return value indicating success or failure of the SET) HoseTheTwits Down is a Method. -- Stuart On 15 Apr 2011 at 22:47, jwcolby wrote: > A property get returns a value, a property let accepts a value and > does something with it. Storing it? Not necessarily. It may just > feed it off to a machine somewhere which does something with the > value. It could fire a stepper motor, or set a voltage in a Digital > to Analog converter, or it could pull in a relay and spray water all > over your computer. By the way that is a write only property which I > lovingly call HoseTheTwitsdown. > > ;) > > It is a property of the Colbyizer class which has many different > properties to allow me to do everything from HoseTheTwitsDown to > BoottheTwitsOutTheDoorAt20000Feet. > > Don't make me use the more extreme properties. > > :) > > John W. Colby > www.ColbyConsulting.com > > On 4/15/2011 8:15 PM, Stuart McLachlan wrote: > > OK. A property is the the external name given to the state of one > > or more variables ( scalar or object) encapsulated within the > > class.. > > > > There, that's fixed it :-) > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From vbacreations at gmail.com Fri Apr 15 23:59:04 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 00:59:04 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> References: <4580.24.35.19.37.1302883826.squirrel@mail.expedient.net> <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> Message-ID: This is quite a surprise. This implies that the code compiles even though vba for access 2003 ought to have no idea what that constant is. Thus compiler is ignoring the code on the "Then" part of the statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" wrote: > Application.Version has been around for a long time. That code certainly works in A2K3. It > does nothing. because Application.Version = 11. I use it for frequently for mdbs that are > runnning in a mixed environment (A2K3 and A2007). > > > On 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question maybe... but have you tested that code in anything >> earlier than 2007?? I would think that the intrinsic constant is not >> recognized.... maybe compatibility mode handles...? > > ... >> If Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 16 01:59:33 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 16 Apr 2011 16:59:33 +1000 Subject: [AccessD] 2010 Version In-Reply-To: References: , <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg>, Message-ID: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is a toolbar called "Ribbon". That constant is only evaluated at runtime if the Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. -- Stuart On 16 Apr 2011 at 0:59, William Benson wrote: > This is quite a surprise. This implies that the code compiles even > though vba for access 2003 ought to have no idea what that constant > is. Thus compiler is ignoring the code on the "Then" part of the > statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" > wrote: > Application.Version has been around > for a long time. That code certainly works in A2K3. It > does nothing. > because Application.Version = 11. I use it for frequently for mdbs > that are > runnning in a mixed environment (A2K3 and A2007). > > > On > 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question > maybe... but have you tested that code in anything >> earlier than > 2007?? I would think that the intrinsic constant is not >> > recognized.... maybe compatibility mode handles...? > > ... >> If > Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > Website: > http://www.databaseadvisors.com -- AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd Website: > http://www.databaseadvisors.com > From vbacreations at gmail.com Sat Apr 16 05:51:23 2011 From: vbacreations at gmail.com (William Benson) Date: Sat, 16 Apr 2011 06:51:23 -0400 Subject: [AccessD] 2010 Version In-Reply-To: <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> References: <4DA8E7F0.28971.A801490@stuart.lexacorp.com.pg> <4DA93E55.2207.BD18F51@stuart.lexacorp.com.pg> Message-ID: Great, thanks! On Apr 16, 2011 3:02 AM, "Stuart McLachlan" wrote: > Docmd.ShowToolbar has also been around for a long time too. The only thing that hasn't is > a toolbar called "Ribbon". That constant is only evaluated at runtime if the > Docmd.ShowToolbar is invoked by the If condition. Not a problem for the compiler. > > -- > Stuart > > > On 16 Apr 2011 at 0:59, William Benson wrote: > >> This is quite a surprise. This implies that the code compiles even >> though vba for access 2003 ought to have no idea what that constant >> is. Thus compiler is ignoring the code on the "Then" part of the >> statement. On Apr 15, 2011 8:52 PM, "Stuart McLachlan" >> wrote: > Application.Version has been around >> for a long time. That code certainly works in A2K3. It > does nothing. >> because Application.Version = 11. I use it for frequently for mdbs >> that are > runnning in a mixed environment (A2K3 and A2007). > > > On >> 15 Apr 2011 at 20:15, William Benson wrote: > >> Dumb question >> maybe... but have you tested that code in anything >> earlier than >> 2007?? I would think that the intrinsic constant is not >> >> recognized.... maybe compatibility mode handles...? > > ... >> If >> Application.Version = 12 Then DoCmd.ShowToolbar "Ribbon", acToolbarNo >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > Website: >> http://www.databaseadvisors.com -- AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd Website: >> http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 16 10:59:22 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 16 Apr 2011 17:59:22 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From rockysmolin at bchacc.com Sat Apr 16 12:14:10 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 16 Apr 2011 10:14:10 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: <130733C3468C4FEB89AC6671E8846036@HAL9005> There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 16 12:51:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 16 Apr 2011 13:51:16 -0400 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> References: , <4DA8DF98.15483.A5F7DFB@stuart.lexacorp.com.pg>, <4DA9032A.1060304@colbyconsulting.com> <4DA91914.20363.B400CE6@stuart.lexacorp.com.pg> Message-ID: <4DA9D714.8060503@colbyconsulting.com> Stuart, C# of course. http://msdn.microsoft.com/en-us/library/w86s7x04%28v=vs.80%29.aspx Unlike fields, properties are not classified as variables. Therefore, it is not possible to pass a property as a ref (C# Reference) or out (C# Reference) parameter. Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields. >>> from Stack Overflow: >>> One use for a write-only property is to support setter dependency injection. Let's say I had a class: public class WhizbangService { public WhizbangProvider Provider { set; private get; } } The WhizbangProvider is not intended to be accessed by the outside world. I'd never want to interact with service.Provider, it's too complex. I need a class like WhizbangService to act as a facade. Yet with the setter, I can do something like this: service.Provider = new FireworksShow(); service.Start(); And the service starts a fireworks display. Or maybe you'd rather see a water and light show: service.Stop(); service.Provider = new FountainDisplay(new StringOfLights(), 20, UnitOfTime.Seconds); service.Start(); Expand your mind. Sit in the sun, close your eyes, contemplate your belly button. And yes, HoseTheTwitsDown actually is a method - which I was fantasizing about using... ;) John W. Colby www.ColbyConsulting.com On 4/16/2011 12:20 AM, Stuart McLachlan wrote: > Sorry, I can't accept that; A write-only property is the local equivalent of this: > http://www.supersimplestorageservice.com/ > > If you can't get a meaningful value from it, then it is not a property - it is a method ( and I > don't mean a return value indicating success or failure of the SET) > > HoseTheTwits Down is a Method. > From DWUTKA at Marlow.com Sat Apr 16 16:36:37 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:36:37 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8AA.6000102@colbyconsulting.com> References: <4DA6C0B7.9070509@colbyconsulting.com> <4DA74A6D.7000706@colbyconsulting.com> <4DA83D8E.5020106@colbyconsulting.com> <4DA8A816.9000705@colbyconsulting.com> <4DA8C8AA.6000102@colbyconsulting.com> Message-ID: Finally, we agree on something. Glad you finally came to your wits... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB >My post had nothing to do with who is a better programmer , because there's no question I am the better one.... ;) Well of course you are. And wittier as well. John W. Colby www.ColbyConsulting.com On 4/15/2011 5:09 PM, Drew Wutka wrote: > Actually John, now that you've come down a bit on your soapbox, I will > try to clarify for you. > > As a VB/VBA programmer, nothing I ever read about VB referred to 'Public > SomeValue as string' as a FIELD. In fact, it was always referred to it > as a PROPERTY of a class object. > > I have ASKED if you have any supporting documentation, like some > Microsoft white paper, or something I should have read when becoming > proficient in VB(6/VBA), where I would have learned that the correct > term for 'Public SomeValue As SomeType' in a VB/VBA class module was > FIELD. > > I can show you PLENTY of documentation where the reverse is the case. > > http://msdn.microsoft.com/en-us/library/aa262343(v=vs.60).aspx 'Visual > Basic Concepts / Customizing Form Classes' > > Straight out of the MSDN, when talking about Class modules in VB6. It > refers to PROPERTIES, METHODS AND EVENTS. It DIRECTLY refers to 'Public > Comment As String' as 'click on it to play back its Comment PROPERTY'. > > Or how about: > > http://msdn.microsoft.com/en-us/library/aa240810(v=VS.60).aspx 'Visual > Basic Concepts / Class Module Step by Step'. You won't find the WORD > 'field' on that page, and it refers to 'Public Name As String' AS A > PROPERTY. Straight from the designers of VB 6's mouth, JWC. > > Now admittedly, I'm only bringing MSDN articles into the fray. I'm not > taking your approach, that you've been programming since you built THE > FIRST Antikythera mechanism, so what you say is how it is. > > To begin with, you are absolutely, 100% incorrect in stating that there > is ANY difference in performance OR FUNCTIONALITY between: > > Public MyValue as String > > And > > Dim strMyValue as string > Property Get MyValue() As String > MyValue=strMyValue > End Property > Property Let MyValue(strEnter As String) > strMyValue=strEnter > End Property > > The only difference above is that one uses 1 line of code, the other > uses 7 lines of code, in the source code. That is it. When you express > what else you can do with Get/Let statements, you are going OUTSIDE the > scope of declaring what a BASIC property is. Yes, you can put error > handling into the statements above, but that changes the strictest > definition of a 'SIMPLE' property. You can add extra arguments, logic, > processes, etc. All going OUTSIDE of the definition of a 'simple > property'. And in VB 6, there is ABSOLUTELY no problem with taking a 1 > liner property, and converting it until actual Get and Let statements > (or Set) for more functionality down the road. In .Net, there IS a > problem, because if you are using Reflection, the Field is now a > Property (in .Net terms), so it will be in a different collection in > Reflection. > > Back to my original point, to this thread, I have been using .Net for > about a year now, since I was out of the development world for a while. > I have only recently had a reason to use Reflection, which I stumbled > on, because as a VB 6 Programmer, there WAS no distinction between > property declaration types like there is in .Net. I am not complaining > that there is a difference, in fact, it is quite handy to have two > separate Reflection collections to use. I was simply stating that it > was a DIFFERENCE between VB6 and VB.Net, for those that haven't yet, or > are just crossing the bridge into the .Net world. Like saying that > there is no more Variant variable type. Would you like to give us a > tirade about how Variant types never truly existed, and how I personally > will never understand that concept? > > Seriously John, you need to read more than a few lines of my posts. A > lot of what you have said makes you sound like an a$$, not as a skilled > professional. My post had nothing to do with who is a better programmer > , because there's no question I am the better > one.... ;) > > Drew > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 15, 2011 3:19 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] First real stumble with using VB.Net over VB > > Drew, > > What is clear is that you are using the definition of a property as "a > unit of information about" > which absolutely one of many English language (and programming) > definitions of property. > > You have already told us (as have I) that a public field and a property > (keyword / function) behave > differently. > > The problem is yours not mine. I understand and use your definition in > the same way you do. I do > not expect a public field to behave in the same way that a property > (keyword / function) does > because they are fundamentally different things. Personally I do not > call a public field a > property, I call it a public field (in programmer speak), though of > course it is a property in > English language speak. > > You no longer expect them to behave the same because you have discovered > that they are fundamentally > different things. > > Where is the argument? > > Everyone now understands that you want to (and will probably) call > public fields properties and > moan that they behave differently. To which I respond - NSS. > > John W. Colby > www.ColbyConsulting.com > The information contained in this transmission is intended only for the person or entity > to which it is addressed and may contain II-VI Proprietary and/or II-VI Business > Sensitive material. If you are not the intended recipient, please contact the sender > immediately and destroy the material in its entirety, whether electronic or hard copy. > You are notified that any review, retransmission, copying, disclosure, dissemination, > or other use of, or taking of any action in reliance upon this information by persons > or entities other than the intended recipient is prohibited. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:39:03 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:39:03 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> References: , , <4DA89BDC.4020409@colbyconsulting.com> <4DA8C8CA.29002.A0669AF@stuart.lexacorp.com.pg> Message-ID: Actually, I have to disagree with you Stuart, a property doesn't necessarily have to wrap a variable. It could wrap a constant. It could wrap a value that is not directly related to a variable, say it could represent some 'condition'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Friday, April 15, 2011 5:38 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB That is a gross abuse of the whole Object paradigm. On 15 Apr 2011 at 15:26, jwcolby wrote: > I have had properties which did not wrap a variable at all. > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:41:44 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:41:44 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4AF.8050107@colbyconsulting.com> References: , , <4DA83D8E.5020106@colbyconsulting.com><4DA8C7D7.29187.A02B510@stuart.lexacorp.com.pg> <4DA8D4AF.8050107@colbyconsulting.com> Message-ID: Yes, and if you were referring to a property as a field, in VBA, you were using incorrect terminology in that environment. ;) Drew Drew mentioned my "soap box". I do not have a soap box, I am simply insisting that we acknowledge the facts. I have no idea what goes on in VB6 because I do not use it. However I have used a class or two (or three maybe?) in Access so I do understand VBA. Obviously Drew is a better (and wittier) programmer than I but let's attempt to understand (and discuss so others can understand) what these things are, what they do and when we are using an English definition and when we are using a keyword, and when we are just using a vague kinda sorta definition. And when we are using an object. A property is also often an object in OO environments. John W. Colby www.ColbyConsulting.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From DWUTKA at Marlow.com Sat Apr 16 16:42:50 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 16 Apr 2011 16:42:50 -0500 Subject: [AccessD] First real stumble with using VB.Net over VB In-Reply-To: <4DA8D4EE.80503@colbyconsulting.com> References: , , <4DA8A816.9000705@colbyconsulting.com><4DA8CB39.23353.A0FEAB0@stuart.lexacorp.com.pg> <4DA8D4EE.80503@colbyconsulting.com> Message-ID: That's like saying that it would be a good thing if there was no way to make a form 'bound' in some way to data automatically.... ;) Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 15, 2011 6:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] First real stumble with using VB.Net over VB Personally, I think this would be a good thing. John W. Colby www.ColbyConsulting.com On 4/15/2011 6:48 PM, Stuart McLachlan wrote: > The problem as I see it is that "Public fields" are an abomination. > > Because Java has then, .Net has to as well :-( > > You should not be able to accept any "properties" of an object other than through GET/SET > processes. > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From adtp at airtelmail.in Sat Apr 16 22:57:47 2011 From: adtp at airtelmail.in (A.D. Tejpal) Date: Sun, 17 Apr 2011 09:27:47 +0530 Subject: [AccessD] is this date affected? References: <130733C3468C4FEB89AC6671E8846036@HAL9005> Message-ID: <00475C102A0F4440809644E445155921@personal4a8ede> David, Another alternative could be considered. You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: IsAffected = ((Dt2 - Dt1) Mod 14 = 0) If the condition is to be checked in an If / End If block, the syntax could be as follows: If (Dt2 - Dt1) Mod 14 = 0 Then Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Rocky Smolin To: 'Access Developers discussion and problem solving' Sent: Saturday, April 16, 2011 22:44 Subject: Re: [AccessD] is this date affected? There's a Weekday function in VBA that you pass a date to and it returns a number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Saturday, April 16, 2011 8:59 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] is this date affected? Hi David You can build a collection of the dates using a loop and DateAdd. Then look up your date in this collection. /gustav >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> I was wondering if anyone already has some code or Jet SQL to determine if a date is affected? Such as Every other Saturday for the next x Saturdays starting 4/16/2011 (2011.04.16 ;) ) Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) I was going to write a function, but I was wondering I am re-inventing the wheel, or if there is some built in too to do so. Thanks, David From davidmcafee at gmail.com Mon Apr 18 12:52:44 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 10:52:44 -0700 Subject: [AccessD] is this date affected? In-Reply-To: <00475C102A0F4440809644E445155921@personal4a8ede> References: <130733C3468C4FEB89AC6671E8846036@HAL9005> <00475C102A0F4440809644E445155921@personal4a8ede> Message-ID: Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal > ------------ > > ----- Original Message ----- > From: Rocky Smolin > To: 'Access Developers discussion and problem solving' > Sent: Saturday, April 16, 2011 22:44 > Subject: Re: [AccessD] is this date affected? > > > There's a Weekday function in VBA that you pass a date to and it returns a > number from 1 to 7 - Sunday=1, 7=Saturday. Might be helpful? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Saturday, April 16, 2011 8:59 AM > To: accessd at databaseadvisors.com > Subject: Re: [AccessD] is this date affected? > > Hi David > > You can build a collection of the dates using a loop and DateAdd. > Then look up your date in this collection. > > /gustav > > > >>> davidmcafee at gmail.com 16-04-2011 01:35 >>> > I was wondering if anyone already has some code or Jet SQL to determine if > a > date is affected? > > Such as Every other Saturday for the next x Saturdays starting 4/16/2011 > (2011.04.16 ;) ) > > Is 4/30/2011 one of those saturdays? (Yes) Is May 7th? (no) > > I was going to write a function, but I was wondering I am re-inventing the > wheel, or if there is some built in too to do so. > > Thanks, > David > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Mon Apr 18 13:11:51 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 18 Apr 2011 20:11:51 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". /gustav >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> Thanks AD, that's exactly what I was looking for! I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > David, > > Another alternative could be considered. > > You wish to ascertain whether date Dt2 falls on one of the alternate > Saturdays starting from Dt1 which is a Saturday. > > If the test is to be reflected via a Boolean variable IsAffected, the > following could be tried: > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > If the condition is to be checked in an If / End If block, the syntax > could be as follows: > > If (Dt2 - Dt1) Mod 14 = 0 Then > > Best wishes, > A.D. Tejpal From davidmcafee at gmail.com Mon Apr 18 15:01:32 2011 From: davidmcafee at gmail.com (David McAfee) Date: Mon, 18 Apr 2011 13:01:32 -0700 Subject: [AccessD] is this date affected? In-Reply-To: References: Message-ID: Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the > next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had > to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate > > Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the > > following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax > > could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Tue Apr 19 04:57:50 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Apr 2011 11:57:50 +0200 Subject: [AccessD] is this date affected? Message-ID: Hi David Not exactly. That will loosen the condition to satisfy the question: "such as Every other Saturday before x weeks after 4/16/2011". For example, 2011-03-19 will be accepted, and these values will be as well: StartingSat = #2011/04/17# NumOfSats = 5 SiQ = #2011/05/15# Of course, you may have validated SiQ to be larger than StartingSat as well as StartingSat to be a Saturday prior to calling your easy expression, but how can we know? Also, the DateAdd formula could be reduced to: DateAdd("ww", NumOfSats, StartingSat) /gustav >>> davidmcafee at gmail.com 18-04-2011 22:01 >>> Yes, but I can check if Saturday in Question (SiQ) is less than: IF SiQ < DateAdd("d",(7 * NumOfSats),StartingSat) THEN Is Affected = ((SiQ - StartingSat) Mod 14 = 0) ELSE IsAffected = False END IF Or even easier: ? IIF(SiQ wrote: > Hi David > > Easier, yes, but it doesn't answer "such as Every other Saturday for the next x Saturdays starting 4/16/2011". > > /gustav > > > >>> davidmcafee at gmail.com 18-04-2011 19:52 >>> > Thanks AD, that's exactly what I was looking for! > > I was thinking of doing something like Gustav suggested, but knew there had to be an easier way. > > > > On Sat, Apr 16, 2011 at 8:57 PM, A.D. Tejpal wrote: > > > David, > > > > Another alternative could be considered. > > > > You wish to ascertain whether date Dt2 falls on one of the alternate Saturdays starting from Dt1 which is a Saturday. > > > > If the test is to be reflected via a Boolean variable IsAffected, the following could be tried: > > > > IsAffected = ((Dt2 - Dt1) Mod 14 = 0) > > > > If the condition is to be checked in an If / End If block, the syntax could be as follows: > > > > If (Dt2 - Dt1) Mod 14 = 0 Then > > > > Best wishes, > > A.D. Tejpal From jwcolby at colbyconsulting.com Tue Apr 19 13:26:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 19 Apr 2011 14:26:18 -0400 Subject: [AccessD] Exact reports are such a pita Message-ID: <4DADD3CA.7010106@colbyconsulting.com> I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com From df.waters at comcast.net Tue Apr 19 13:32:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 13:32:06 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <004301cbfec0$16c2eb40$4448c1c0$@comcast.net> I think I would just build a string, using the values if I have them, underscores if I don't. If you're using Access 2002+, you can use the OpenArgs parameter when you open the report, if that would work out. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Tue Apr 19 13:33:54 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Tue, 19 Apr 2011 13:33:54 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Tue Apr 19 13:45:32 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 11:45:32 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From steve at datamanagementsolutions.biz Tue Apr 19 14:32:45 2011 From: steve at datamanagementsolutions.biz (Steve Schapel) Date: Wed, 20 Apr 2011 07:32:45 +1200 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> References: <4DADD3CA.7010106@colbyconsulting.com> <035B5C3760B7417FBA5C24B287F4F1FE@HAL9005> Message-ID: <9728D49895B043959AFD82816DBD3DBF@stevelaptop> I agree. I don't think the idea of a temp table is over the top. That's how I would do it. Regards Steve -----Original Message----- From: Rocky Smolin Sent: Wednesday, April 20, 2011 6:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Exact reports are such a pita Personally I find temp tables to be quick, convenient, effective and the easiest way to set up a complex report. I suppose you could set those fields up with an iif source that fills in the data if the data field is not null, or puts in the underscore, etc., if null. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 11:26 AM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? From john at winhaven.net Tue Apr 19 15:30:34 2011 From: john at winhaven.net (John Bartow) Date: Tue, 19 Apr 2011 15:30:34 -0500 Subject: [AccessD] Exact reports are such a pita In-Reply-To: References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: <00bf01cbfed0$a2f48e60$e8ddab20$@winhaven.net> That's how I handle "previously done on a form" reports with my apps. Makes the form look perfect and it relieves you of having to fudge around with data. I've honestly had to do this and then duplicate the report and remove the image background, and include a choice for the user to either insert preprinted forms or print the entire form (there was no discernable difference). Supposedly this was because the client didn't want to waste all of those preprinted forms they had. I did a follow up about a year later and the client had actually ordered more preprinted forms! Yes, you guessed it. It was a government job. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Tuesday, April 19, 2011 1:34 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Exact reports are such a pita Actually, one approach I have taken in this kind of scenario is to scan the original form, make it an image. Then just create a report with the image in the background, and size your controls inside the 'images' borders. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 19, 2011 1:26 PM To: Access Developers discussion and problem solving Subject: [AccessD] Exact reports are such a pita I need to build a report that looks as close as possible to a state form. This includes a couple of subforms which look like: 1) From:_____________ To:___________ 2) From:_____________ To:___________ 3) From:_____________ To:___________ And if I don't have a line 2 or line 3 I still need to fake it, put in the number and underline. IOW it should be indistinguishable from a copy of their form casually compared side by side. Can you say PITA. The only thing I can think of is to build a temp table, place the 1) 2) and 3) in three records (programmatically) and then fill in each record as needed. That seems rather over the top. Any suggestions for easy ways to fake this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 19 15:37:24 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 19 Apr 2011 13:37:24 -0700 Subject: [AccessD] Hide Form Title Bar Message-ID: Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com From df.waters at comcast.net Tue Apr 19 16:39:06 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 19 Apr 2011 16:39:06 -0500 Subject: [AccessD] OT: Windows Kinect SDK Beta Message-ID: <002401cbfeda$35f42730$a1dc7590$@comcast.net> If you combine this with XKCD, there's going to be a lot of trouble. I'm not saying anything more. Dan From ab-mi at post3.tele.dk Tue Apr 19 16:45:26 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Tue, 19 Apr 2011 23:45:26 +0200 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: Don't think you can eliminate the title bar on a sizable form. But you can eliminate the contents of the bar using these settings: Caption: ControlBox: No MinMaxButtons: None CloseButton: No Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af Rocky Smolin Sendt: 19. april 2011 22:37 Til: 'Access Developers discussion and problem solving' Emne: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Tue Apr 19 17:23:20 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Tue, 19 Apr 2011 17:23:20 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # References: <07230D1FF5AD4611A350B33814B094C6@HAL9005><74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad From charlotte.foust at gmail.com Tue Apr 19 20:15:41 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:15:41 -0700 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005> <74FC310B1D88455CA10C3BB4FC5CA02D@creativesystemdesigns.com> <0D72B2DDB97E4B1B9A7347107E7B5978@HAL9005> Message-ID: I'm not sure this is an Access issue. I seem to recall that the # sign has a specific meaning in passing data into and out of delimited text file. Maybe someone else can recall the specifics. You might be able to work around it by either using a double # in the export spec for the field name, or else export and then rename the field in the csv file using text IO code. Charlotte Foust On Tue, Apr 19, 2011 at 3:23 PM, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our testing) > and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't understand. > > Is there a way to force Access to not replace the "#" with a "." ?? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Tue Apr 19 20:23:15 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Tue, 19 Apr 2011 18:23:15 -0700 Subject: [AccessD] Exact reports are such a pita In-Reply-To: <4DADD3CA.7010106@colbyconsulting.com> References: <4DADD3CA.7010106@colbyconsulting.com> Message-ID: If you want to use a continuous subform, you could count the records you have and then add dummy records to fill out the count. You would want to either use a temp table or create a new recordset and add the dummy records to that, then dispose the recordset when done. Charlotte Foust On Tue, Apr 19, 2011 at 11:26 AM, jwcolby wrote: > I need to build a report that looks as close as possible to a state form. > ?This includes a couple of subforms which look like: > > 1) From:_____________ To:___________ > 2) From:_____________ To:___________ > 3) From:_____________ To:___________ > > And if I don't have a line 2 or line 3 I still need to fake it, put in the > number and underline. > > IOW it should be indistinguishable from a copy of their form casually > compared side by side. > > Can you say PITA. > > The only thing I can think of is to build a temp table, place the 1) 2) and > 3) in three records (programmatically) and then fill in each record as > needed. > > That seems rather over the top. ?Any suggestions for easy ways to fake this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Darryl.Collins at iag.com.au Tue Apr 19 20:26:03 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Wed, 20 Apr 2011 11:26:03 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: Message-ID: <201104200126.p3K1QAR6009307@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ Perhaps a cheap and easy solution that may work nicely is to use a valid placeholder during the export and creation of the CSV file instead of the "#". Maybe something like "Employee$" and then once the CSV is exported use code to perform a global search and replace on the .txt file where the "#" char is not going to be an issue. .replace ""Employee$", ""Employee#" or similar. hth a bit Regards Darryl. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Wednesday, 20 April 2011 8:23 AM To: Access Developers discussion and problem solving Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # All, We are just starting to use an Access 2007 application to feed data to another outside system via a CSV file. This outside system is very rigid and we need to use exact field names on the CSV file that we are creating. The catch is that one of the fields is call "Employee #". We set up an Export Specification (called Export-Query1 for our testing) and we are using the following command to do the export DoCmd.RunSavedImportExport "Export-Query1" When we run the application, everything works nicely, except the field named "Employee #" is somehow being renamed "Employee ." in the generated CSV file. We have run a number of tests and it looks like we have stumbled upon either a "bug" a "feature", or something that we just don't understand. Is there a way to force Access to not replace the "#" with a "." ? Thanks for your help, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From stuart at lexacorp.com.pg Tue Apr 19 22:40:09 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 13:40:09 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: <07230D1FF5AD4611A350B33814B094C6@HAL9005>, Message-ID: <4DAE5599.938.1FB46483@stuart.lexacorp.com.pg> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Apr 20 02:59:26 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 20 Apr 2011 09:59:26 +0200 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # Message-ID: Hi Brad Listen to Stuart. Once you have this set up you are in total control and will never look back. The same goes for importing text files. /gustav >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> The best solution is not to use the built in Access export routine. Roll your own and you can put anything you want in the file. Aircode: Function Export() as Long Dim rs as DAO.Recordset Dim ff as long ff = Freefile set rs = CurrentDB.Openrecordset("qryMyExport") ff = Freefile Open "myExportFile.csv" for Output as #ff Print #1,"First fieldname,Employee #,Third fieldname" While not rs.Eof Print #1 rs(0) & "," & rs(1) & "," & rs(2) rs.movenext Wend Close #ff End Function -- Stuart On 19 Apr 2011 at 17:23, Brad Marks wrote: > All, > > We are just starting to use an Access 2007 application to feed data to > another outside system via a CSV file. > > This outside system is very rigid and we need to use exact field names > on the CSV file that we are creating. > > The catch is that one of the fields is call "Employee #". > > We set up an Export Specification (called Export-Query1 for our > testing) and we are using the following command to do the export > > DoCmd.RunSavedImportExport "Export-Query1" > > When we run the application, everything works nicely, except the field > named "Employee #" is somehow being renamed "Employee ." in the > generated CSV file. > > We have run a number of tests and it looks like we have stumbled upon > either a "bug" a "feature", or something that we just don't > understand. > > Is there a way to force Access to not replace the "#" with a "." ? > > Thanks for your help, > > Brad From stuart at lexacorp.com.pg Wed Apr 20 04:53:45 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Apr 2011 19:53:45 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a # In-Reply-To: References: Message-ID: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Lambert.Heenan at chartisinsurance.com Wed Apr 20 09:46:23 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Wed, 20 Apr 2011 10:46:23 -0400 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 10:28:40 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 08:28:40 -0700 Subject: [AccessD] Search as you type Message-ID: I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug From charlotte.foust at gmail.com Wed Apr 20 11:01:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 09:01:06 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Try using a disconnected ADO recordset and apply a filter to return the limited recordset. That should make the search fast because the recordset is no longer connected to the back end. What are you planning to do if there are multiple results for the find? The user could actually edit the record if you require that and then you would have to reconnect the recordset and update the source. I have an old demo on roger's access site that was built in 2000 (AFAIR) that uses disconnected recordsets to load and update data. You might have a look at it and see if it gives you any ideas. Watch out for a wrap. http://www.rogersaccesslibrary.com/forum/foust-charlotte_forum14&SID=f27a794a-684c-f2495918-e4c25924-463bez2z.html Charlotte Foust On Wed, Apr 20, 2011 at 8:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 11:03:00 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 12:03:00 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: <4DAF03B4.3060501@colbyconsulting.com> In the onchanged event of the text box you can set a form timer to fire X ticks later. Every time the onchanged fires the timer is "reset" to be x ticks out. When the timer fires, reset the timer to not fire ( a value of 0 ticks I think) and then go do the search. Each tick is a millisecond so set it for 1000 to get a 1 second delay. Something like that. John W. Colby www.ColbyConsulting.com On 4/20/2011 11:28 AM, Doug Steele wrote: > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug From shamil at smsconsulting.spb.ru Wed Apr 20 11:14:14 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Wed, 20 Apr 2011 20:14:14 +0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Hi Doug -- I suppose you can try to use KeyDown event and run search only when {Enter} or any other special char(s) combination is pressed. Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then MsgBox (txtSearch.Text) ' suppress if needed => KeyCode = 0 End If End Sub Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: 20 ?????? 2011 ?. 19:29 To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Wed Apr 20 11:21:46 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Wed, 20 Apr 2011 09:21:46 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: Message-ID: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Wed Apr 20 12:17:48 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Wed, 20 Apr 2011 13:17:48 -0400 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Doug, How many records will they be searching against roughly? You can do a reasonable incremental search character by character with DAO by using a seek on an index (which is the fastest method for finding a match), but that tops out at about 50,000 records depending on the speed of the network and PC. Might also want to consider searching on a snapshot. Using a snapshot, the data will be cached locally in a temp file. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 11:29 AM To: Access Developers discussion and problem solving Subject: [AccessD] Search as you type I've built a form with a live search box so that a client can enter any text to search (on one field only) and the form redisplays with the matching records. My first attempt is to use the 'OnChanged' event in the search text box and re-filter the form using a filter "Name like '*xxxx*'. This works well enough on my local machine, but on the client's network there is an annoying pause after each character is typed. My ideas on speeding this up are: 1. Only re-filter when the typing pauses for, say, half a second. Usually a search is done by entering a few characters quickly, like 'Bill', then waiting to see the results. I can't quite figure out how to do this, though. 2. Use ADO for the form recordset, to avoid network traffic. Any suggestions? Thanks, Doug -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dbdoug at gmail.com Wed Apr 20 13:28:18 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 11:28:18 -0700 Subject: [AccessD] Search as you type In-Reply-To: References: Message-ID: Thanks for the responses. I'll do some experimenting and report back. Jim, the recordset is fairly small (500 or so records) but is based on about 15 large tables. The form isn't editable, so I guess a snapshot should work. Doug On Wed, Apr 20, 2011 at 10:17 AM, Jim Dettman wrote: > Doug, > > ?How many records will they be searching against roughly? > > ?You can do a reasonable incremental search character by character with DAO > by using a seek on an index (which is the fastest method for finding a > match), but that tops out at about 50,000 records depending on the speed of > the network and PC. > > ?Might also want to consider searching on a snapshot. ?Using a snapshot, > the data will be cached locally in a temp file. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele > Sent: Wednesday, April 20, 2011 11:29 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Search as you type > > I've built a form with a live search box so that a client can enter > any text to search (on one field only) and the form redisplays with > the matching records. ?My first attempt is to use the 'OnChanged' > event in the search text box and re-filter the form using a filter > "Name like '*xxxx*'. ?This works well enough on my local machine, but > on the client's network there is an annoying pause after each > character is typed. ?My ideas on speeding this up are: > > 1. Only re-filter when the typing pauses for, say, half a second. > Usually a search is done by entering a few characters quickly, like > 'Bill', then waiting to see the results. ?I can't quite figure out how > to do this, though. > 2. Use ADO for the form recordset, to avoid network traffic. > > Any suggestions? > > Thanks, > Doug > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 15:39:02 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 16:39:02 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working Message-ID: <4DAF4466.7010506@colbyconsulting.com> I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the move but it isn't working. Has anyone ever seen this and a fix? -- John W. Colby www.ColbyConsulting.com From BradM at blackforestltd.com Wed Apr 20 15:49:22 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 15:49:22 -0500 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # References: <4DAEAD29.9318.210A6F81@stuart.lexacorp.com.pg> Message-ID: All, Thanks for the advice and insights. I am planning to experiment with the ideas posted. I like the sounds of the "roll your own" export (I am a product of the 1960s :-) I have never used Access to tweak a flat file, so that also is something that sounds interesting, at least to have in the bag-of-tricks. (If someone has a simple example that they are willing to share, I would appreciate it). Thanks again, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # Hi Brad, Listen to Gustav ;-) Especially for import. You willl find all sorts of CSV file formats. The biggest problem is the inconsistent use of "quotes". Sometime all dates and strings are quoted, sometimes they are only quoted if they contain a comma, sometimes you will get numbers quoted because they are formatted to include commas and others which are not because they don't include commas, sometimes you will get embedded real quotes represented as double quotes. You can get all of these variations in a single file. The built in Import function can't handle many of them. What I do is import the line, strip the quotes and convert it into Tab delimited strings without extraneous quotes. Function ConvertLine(strIn As String) As String 'Converts CSV(either quoted or non-quoted text) to TAB delimited Dim inquotes As Boolean Dim strC As String Dim x As Long 'Change real delimiter commas to Tabs 'ie those that aren't inside quotes For x = 1 To Len(strIn) strC = Mid$(strIn, x, 1) If strC = "," And Not inquotes Then Mid$(strIn, x, 1) = Chr$(9) End If If strC = """" Then inquotes = Not inquotes End If Next ' there may be real quotes escaped as "paired" quotes ' so change them temporarily to a non print character strln = Replace(strln,"""""",chr$(1)) 'get rid of all the remaining quotes strln = Replace(strIn, """", "") 're-instate the escaped quotes ConvertLine = Replace(strln,Chr$(1),"""") End Function Then I split the record using ... Line Input #ff strInputLine strData() = Split(Convertline(strInputLine),Chr$(9)) ... Once you have done that, you can convert the strings to other data types as required. -- Stuart On 20 Apr 2011 at 9:59, Gustav Brock wrote: > Hi Brad > > Listen to Stuart. > Once you have this set up you are in total control and will never look > back. The same goes for importing text files. > > /gustav > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > The best solution is not to use the built in Access export routine. > Roll your own and you can put anything you want in the file. > > Aircode: > > Function Export() as Long > Dim rs as DAO.Recordset > Dim ff as long > ff = Freefile > set rs = CurrentDB.Openrecordset("qryMyExport") > ff = Freefile > Open "myExportFile.csv" for Output as #ff > Print #1,"First fieldname,Employee #,Third fieldname" > While not rs.Eof > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > rs.movenext > Wend > Close #ff > End Function > > -- > Stuart > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > All, > > > > We are just starting to use an Access 2007 application to feed data > > to another outside system via a CSV file. > > > > This outside system is very rigid and we need to use exact field > > names on the CSV file that we are creating. > > > > The catch is that one of the fields is call "Employee #". > > > > We set up an Export Specification (called Export-Query1 for our > > testing) and we are using the following command to do the export > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > When we run the application, everything works nicely, except the > > field named "Employee #" is somehow being renamed "Employee ." in > > the generated CSV file. > > > > We have run a number of tests and it looks like we have stumbled > > upon either a "bug" a "feature", or something that we just don't > > understand. > > > > Is there a way to force Access to not replace the "#" with a "." ? > > > > Thanks for your help, > > > > Brad > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 15:58:31 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 13:58:31 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: ADO or DAO recordset? Charlotte Foust On Wed, Apr 20, 2011 at 1:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. ?The bookmark is the > accepted way of doing the move but it isn't working. > > Has anyone ever seen this and a fix? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Apr 20 16:02:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 20 Apr 2011 17:02:36 -0400 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF4466.7010506@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> Message-ID: <4DAF49EC.7070606@colbyconsulting.com> Never mind. PBKAC! John W. Colby www.ColbyConsulting.com On 4/20/2011 4:39 PM, jwcolby wrote: > I am trying to lookup and move to a record in a form. The bookmark is the accepted way of doing the > move but it isn't working. > > Has anyone ever seen this and a fix? > From dbdoug at gmail.com Wed Apr 20 16:05:34 2011 From: dbdoug at gmail.com (Doug Steele) Date: Wed, 20 Apr 2011 14:05:34 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: <4DAF49EC.7070606@colbyconsulting.com> References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Wed Apr 20 16:07:42 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Wed, 20 Apr 2011 16:07:42 -0500 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working References: <4DAF4466.7010506@colbyconsulting.com><4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem Between Keyboard and Chair ? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Wednesday, April 20, 2011 4:06 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Me.Bookmark = rst.Bookmark not working OK, I'll bite - what is PBKAC? Doug On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: > Never mind. PBKAC! > > John W. Colby > www.ColbyConsulting.com > > On 4/20/2011 4:39 PM, jwcolby wrote: >> >> I am trying to lookup and move to a record in a form. The bookmark is the >> accepted way of doing the >> move but it isn't working. >> >> Has anyone ever seen this and a fix? >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From charlotte.foust at gmail.com Wed Apr 20 16:08:06 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Wed, 20 Apr 2011 14:08:06 -0700 Subject: [AccessD] Me.Bookmark = rst.Bookmark not working In-Reply-To: References: <4DAF4466.7010506@colbyconsulting.com> <4DAF49EC.7070606@colbyconsulting.com> Message-ID: Problem (exists) Between Keyboard And Chair Charlotte Foust On Wed, Apr 20, 2011 at 2:05 PM, Doug Steele wrote: > OK, I'll bite - what is PBKAC? > Doug > > On Wed, Apr 20, 2011 at 2:02 PM, jwcolby wrote: >> Never mind. PBKAC! >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/20/2011 4:39 PM, jwcolby wrote: >>> >>> I am trying to lookup and move to a record in a form. The bookmark is the >>> accepted way of doing the >>> move but it isn't working. >>> >>> Has anyone ever seen this and a fix? >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Wed Apr 20 16:37:35 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 21 Apr 2011 07:37:35 +1000 Subject: [AccessD] Problem Exporting to a CSV file with a Column Namethat has a # In-Reply-To: References: , Message-ID: <4DAF521F.5986.238ED302@stuart.lexacorp.com.pg> One useful "flat file tweak" is when you are supplied with a Unix file that has LF as line terminators instead of CRLF. You need to convert such files before you can read them in with Line Input. Here's a simple function to read the whole file into memory and change LFs to CRLFs. It works fine as long as the export file doesn't exceed about 2 billion characters, which is the limit of a single string length. :-) There are lots of other things you can do in a similar vein. You could for instance parse the file into an array of lines instead using strMyArray() = Split(strTemp,Chr$(10)) Function UnixToDosFile(filename) As Long Dim fileroot As String Dim fileext As String Dim newfile As String Dim ff As Long Dim flen As Long Dim strTemp As String 'Create a name for the output file fileext = Right$(filename, Len(filename) - InStrRev(filename, ".")) fileroot = Left$(filename, InStrRev(filename, ".") - 1) newfile = fileroot & "-DOS." & fileext 'Get a file handle ff = FreeFile 'Load complete Unix file into memory Open filename For Binary As #ff flen = LOF(ff) ' how big is the file strTemp = Space$(flen) 'make our buffer the same size. Get #ff, , strTemp 'get the file into memory Close #ff 'Replace LF with CRLF strTemp = Replace(strTemp, Chr$(10), Chr$(13) & Chr$(10)) 'Save new file Open newfile For Binary As #ff Put #ff, , strTemp Close #ff End Function -- Stuart On 20 Apr 2011 at 15:49, Brad Marks wrote: > All, > > Thanks for the advice and insights. > > I am planning to experiment with the ideas posted. > > I like the sounds of the "roll your own" export (I am a product of the > 1960s :-) > > I have never used Access to tweak a flat file, so that also is > something that sounds interesting, at least to have in the > bag-of-tricks. (If someone has a simple example that they are willing > to share, I would appreciate it). > > Thanks again, > Brad > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, April 20, 2011 4:54 AM To: Access > Developers discussion and problem solving Subject: Re: [AccessD] > Problem Exporting to a CSV file with a Column Namethat has a # > > Hi Brad, > > Listen to Gustav ;-) > > Especially for import. You willl find all sorts of CSV file formats. > The biggest problem is the inconsistent use of "quotes". Sometime all > dates and strings are quoted, sometimes they are only quoted if they > contain a comma, sometimes you will get numbers quoted because they > are formatted to include commas and others which are not because they > don't include commas, sometimes you will get embedded real quotes > represented as double quotes. You can get all of these variations in > a single file. The built in Import function can't handle many of > them. > > What I do is import the line, strip the quotes and convert it into Tab > delimited strings without extraneous quotes. > > Function ConvertLine(strIn As String) As String > 'Converts CSV(either quoted or non-quoted text) to TAB delimited > Dim inquotes As Boolean Dim strC As String Dim x As Long > > 'Change real delimiter commas to Tabs > 'ie those that aren't inside quotes > For x = 1 To Len(strIn) > strC = Mid$(strIn, x, 1) > If strC = "," And Not inquotes Then > Mid$(strIn, x, 1) = Chr$(9) > End If > If strC = """" Then > inquotes = Not inquotes > End If > Next > > ' there may be real quotes escaped as "paired" quotes > ' so change them temporarily to a non print character > strln = Replace(strln,"""""",chr$(1)) > > 'get rid of all the remaining quotes > strln = Replace(strIn, """", "") > > 're-instate the escaped quotes > ConvertLine = Replace(strln,Chr$(1),"""") > End Function > > Then I split the record using > ... > Line Input #ff strInputLine > strData() = Split(Convertline(strInputLine),Chr$(9)) > ... > > Once you have done that, you can convert the strings to other data > types as required. > > -- > Stuart > > On 20 Apr 2011 at 9:59, Gustav Brock wrote: > > > Hi Brad > > > > Listen to Stuart. > > Once you have this set up you are in total control and will never > > look back. The same goes for importing text files. > > > > /gustav > > > > > > >>> stuart at lexacorp.com.pg 20-04-2011 05:40 >>> > > The best solution is not to use the built in Access export routine. > > Roll your own and you can put anything you want in the file. > > > > Aircode: > > > > Function Export() as Long > > Dim rs as DAO.Recordset > > Dim ff as long > > ff = Freefile > > set rs = CurrentDB.Openrecordset("qryMyExport") > > ff = Freefile > > Open "myExportFile.csv" for Output as #ff > > Print #1,"First fieldname,Employee #,Third fieldname" > > While not rs.Eof > > Print #1 rs(0) & "," & rs(1) & "," & rs(2) > > rs.movenext > > Wend > > Close #ff > > End Function > > > > -- > > Stuart > > > > On 19 Apr 2011 at 17:23, Brad Marks wrote: > > > > > All, > > > > > > We are just starting to use an Access 2007 application to feed > > > data to another outside system via a CSV file. > > > > > > This outside system is very rigid and we need to use exact field > > > names on the CSV file that we are creating. > > > > > > The catch is that one of the fields is call "Employee #". > > > > > > We set up an Export Specification (called Export-Query1 for our > > > testing) and we are using the following command to do the export > > > > > > DoCmd.RunSavedImportExport "Export-Query1" > > > > > > When we run the application, everything works nicely, except the > > > field named "Employee #" is somehow being renamed "Employee ." in > > > the generated CSV file. > > > > > > We have run a number of tests and it looks like we have stumbled > > > upon either a "bug" a "feature", or something that we just don't > > > understand. > > > > > > Is there a way to force Access to not replace the "#" with a "." > > > ? > > > > > > Thanks for your help, > > > > > > Brad > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From dbdoug at gmail.com Thu Apr 21 10:33:09 2011 From: dbdoug at gmail.com (Doug Steele) Date: Thu, 21 Apr 2011 08:33:09 -0700 Subject: [AccessD] Search as you type (note to JC) Message-ID: John, the timer logic you suggested for the search box worked like a charm. It makes the search much smoother to use. I'm still going experiment with ADO for this when I have a bit of time. Doug From DWUTKA at Marlow.com Thu Apr 21 10:33:51 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 10:33:51 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:22:40 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:22:40 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Thu Apr 21 11:28:37 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:28:37 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <2F55242637C64867956F4EF369D6E259@HAL9005> Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:30:28 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:30:28 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Thu Apr 21 11:39:20 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Thu, 21 Apr 2011 09:39:20 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> Message-ID: <64BB5603B8E945EC97F03BBD8B503D18@HAL9005> Yep. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:30 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar No problem. Was this for that 'always on top' form? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:23 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: Worked perfectly. Thank you. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From DWUTKA at Marlow.com Thu Apr 21 11:50:38 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Thu, 21 Apr 2011 11:50:38 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <2F55242637C64867956F4EF369D6E259@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005> <2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Thu Apr 21 12:26:38 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 21 Apr 2011 13:26:38 -0400 Subject: [AccessD] Search as you type (note to JC) In-Reply-To: References: Message-ID: <4DB068CE.9040408@colbyconsulting.com> > John, the timer logic you suggested for the search box worked like a charm. Its nice to occasionally get one right. :) Long ago I built a system to take a list and populate it with the matches to the characters being typed into a text box. I sized the list to just a single line and positioned it butted up to the bottom of the text box. As the user typed the first character into the text box, the logic "opened" the list by causing the size to change to some value (a few inches). Then I populated the list with "like CharactersTypedIn*". When the user tabbed out (onExit of the text box) the top value in the list was pulled into the text box and the list pulled back up to a single line. It worked just like a combo box basically. John W. Colby www.ColbyConsulting.com On 4/21/2011 11:33 AM, Doug Steele wrote: > John, the timer logic you suggested for the search box worked like a > charm. It makes the search much smoother to use. > > I'm still going experiment with ADO for this when I have a bit of time. > > Doug From accessd at shaw.ca Thu Apr 21 13:17:13 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 21 Apr 2011 11:17:13 -0700 Subject: [AccessD] Slightly off topic In-Reply-To: <4DB068CE.9040408@colbyconsulting.com> References: <4DB068CE.9040408@colbyconsulting.com> Message-ID: Hi All: Does anyone know of a little routine that will open a DVD drive and then re-close it. I have some remote processes that have this requirement. MTIA Jim From jwcolby at colbyconsulting.com Fri Apr 22 07:44:50 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 08:44:50 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: <4DB17842.4020604@colbyconsulting.com> I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com From michael at mattysconsulting.com Fri Apr 22 08:06:23 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 09:06:23 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB17842.4020604@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Hi John, I've just finished a similar project for downloading all pdf and xls from a site and the iron is still hot. I know its volunteer - just send the relevant access info to my address and I'll get your pics for you. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 8:45 AM To: Access Developers discussion and problem solving Subject: [AccessD] How do I Grab the picture from the web page I am using the Microsoft web control to navigate to web pages and parse out information for my inmate checkout program. Part of the information is a picture that I have to click on to view. I am a visual kinda guy so it would be really nice if I could get the picture and store it locally so that I could see the picture of the guy without having to go click on that link every time as I scroll through the records. The first question is, can I click buttons in the web page using this web control? The following is what I assume to be button code:
Back To Search Results

The second question is, how can I extract the picture. The following is what I assume to be the picture control.
Sorry for all of the extra "stuff" but not being a web kinda guy I don't really know what is necessary and what is fluff. I manage to grab the "tables" collection and iterate through the tables looking inside each for specific stuff to pull data out into my application. What I don't know is whether I can add another of these web page controls and feed it just a specific part of the whole to get the picture, or whether I can click a button, or how to g about getting this picture. Can anyone help me with this? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From BradM at blackforestltd.com Fri Apr 22 08:31:15 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 08:31:15 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad From jwcolby at colbyconsulting.com Fri Apr 22 08:34:49 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 09:34:49 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4DB183F9.90006@colbyconsulting.com> Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading > all pdf and xls from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info > to my address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From rockysmolin at bchacc.com Fri Apr 22 08:44:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 06:44:36 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Fri Apr 22 08:48:18 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 22 Apr 2011 08:48:18 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <4db18725.06c7640a.18cc.75b7@mx.google.com> Brad, I'm with you. Although after ten years working with Access, I still get confused between ADO and DAO. As a matter of preference, maybe because I don't understand the issues, I routinely use DAO anytime I need to create a TableDef or anything else that needs to connect to a database, etc. Maybe someone on this list can give us definitions of the two and give examples where one is better than the other. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 8:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 09:09:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 10:09:05 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <4db18725.06c7640a.18cc.75b7@mx.google.com> References: <4DB17842.4020604@colbyconsulting.com> <4db18725.06c7640a.18cc.75b7@mx.google.com> Message-ID: <4DB18C01.3000202@colbyconsulting.com> DAO is the object model for the the Access database object. DAO knows about things like *Microsoft ACCESS* databases, tables, fields, properties, queries, forms, reports and so forth. IOW *anything* that is an object in Access is manipulated using DAO. You can modify the tabledef object with DAO I believe. DAO knows nothing about *anything* other than objects inside of an Access database container. ADO is an object model for manipulating very specific objects related to *data* and will work with any data store which has an ADO provider - which includes SQL Server, Access, MySQL, etc. It knows about the command object, datasets, tables, columns, relationships and the like. It is possible to change a table with SQL. There are keywords for adding and dropping columns, the data type for the column, adding indexes and the like. You can execute SQL using the ADO command object. That is different from doing so directly with ADO. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:48 AM, jm.hwsn wrote: > Brad, > I'm with you. Although after ten years working with Access, I still get > confused between ADO and DAO. > As a matter of preference, maybe because I don't understand the issues, I > routinely use DAO anytime I need to create a TableDef or anything else that > needs to connect to a database, etc. > > Maybe someone on this list can give us definitions of the two and give > examples where one is better than the other. > > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 8:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > From michael at mattysconsulting.com Fri Apr 22 09:40:42 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 10:40:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> John, OK, I think the best way to approach this is for you to visit http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp It took me an hour or two to get the right elements for my project and then lots more to loop through the relevant tables, rows, childnodes, and cells to get the right info. Basically, you want the href of the image and then it's a simple binary save object to file, thus http://www.devx.com/vb2themax/Tip/18441 Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 9:35 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Michael, Thanks. The web page I navigate to is as follows: http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa ge=1 I literally replace the offenderID with the ID (called an OPUS number) of the inmate I am viewing or obtaining the record for. What you are viewing if you go to this link is an actual record of some inmate. Open this web page to view the html behind. Notice that the picture is obscured, with a "click to show photo" which I assume is actually a button? It is not that I need to get one or even several photos. I need the *code* to do it from VBA, and I need to learn how it is done so I can do it again by myself. I would prefer to actually retrieve the photo to a file stored on disk, however I also want to learn how to click buttons (and enter data). The following is the actual search website. http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view I don't need it for this project because I can do a simple replace of the OPUS ID in that first string, but it would be good (for another project) to know how I insert data into the controls and click the search button, how to click the Clear Selection button etc. I currently use an ActiveX control inserted into a subform to retrieve pages, get the table collection etc. The web control is found by clicking the ellipsis in the toolbox bar in form design and going down until you find the Microsoft Web Browser control. I have found code in Google to do this other ways but this is the way I have managed to get working. I wrote a class "wrapper" with methods that I call to parse out the data. It is ugly but they apparently did not program the web site in a "nice" manner, tables just have one big long string etc. the following is the code that I use to poke through the dozens of tables they use. Again, there might be an easier way but this is how I got it working. Function mSearchTable(wbbWebsite As Object) Dim varTables As Variant Dim varTable As Variant Dim strOffenderInfo As String Dim strMostRecent As String Set varTables = wbbWebsite.Document.All().tags("table") Set varTables = wbbWebsite.Document.All.tags("TABLE") For Each varTable In varTables Dim strInnerText As String strInnerText = varTable.innerText 'Use the innerText to see if this is the table we want. 'Debug.Print varTable.innerText If (InStr(strInnerText, "Offender Information")) And (Not mblnOffenderInfoFound) Then strOffenderInfo = strInnerText mParseInfoOffender strInnerText Else If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not mblnMostRecentInfoFound) Then strMostRecent = strInnerText mParseMostRecent strMostRecent End If End If Next varTable End Function So what I need is not a fish, but to learn *how* to fish. Any assistance gratefully accepted. John W. Colby www.ColbyConsulting.com On 4/22/2011 9:06 AM, Michael Mattys wrote: > Hi John, > > I've just finished a similar project for downloading all pdf and xls > from a site and the iron is still hot. > > I know its volunteer - just send the relevant access info to my > address and I'll get your pics for you. > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 09:42:48 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 09:42:48 -0500 Subject: [AccessD] Trouble using Split command Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> I am trying to use the split command on the following string " 0.000 243.729 - 61.495 -" I have a dim statements as follows Dim LineText As String Dim Test() As String The split statement is as follows Test = Split(LineText)(0) No matter how I dim Test() I get an error message of Run Time Error 13 Type Mismatch This seems like it should be real simple but I am obviously missing something. Thanks. Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From phpons at gmail.com Fri Apr 22 09:57:35 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 16:57:35 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From phpons at gmail.com Fri Apr 22 10:04:58 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 17:04:58 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:06:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:06:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C9C@houex1.kindermorgan.com> Still generates the same error of Type Mismatch -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 9:58 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Dim Test() As Variant Philippe 2011/4/22 Kaup, Chester > I am trying to use the split command on the following string > > " 0.000 243.729 - > 61.495 -" > > I have a dim statements as follows > Dim LineText As String > Dim Test() As String > > The split statement is as follows > Test = Split(LineText)(0) > > No matter how I dim Test() I get an error message of > Run Time Error 13 > Type Mismatch > > This seems like it should be real simple but I am obviously missing > something. > > Thanks. > > > > > Chester Kaup > Engineering Technician > Kinder Morgan CO2 Company, LLP > Office (432) 688-3797 > FAX (432) 688-3799 > > > No trees were killed in the sending of this message. However a large number > of electrons were terribly inconvenienced. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From charlotte.foust at gmail.com Fri Apr 22 10:12:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:12:20 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:18:05 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:18:05 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > From charlotte.foust at gmail.com Fri Apr 22 10:35:20 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:35:20 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Yes, it is possible to change a table (not a tabledef, please note) with ADO, but you have to use the ADOX library, and the process is different. ADOX is the library that lets you create and edit tables using ADO. The 2010 help files aren't very helpful when it comes to ADOX, I've noticed. However, the MSDN files are better. Take a look at http://support.microsoft.com/kb/291264/fr to see about manipulating tables and links in ADOX. Charlotte Foust On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks wrote: > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef > with VBA code so that we can change the path to an Excel file on the > fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I > have not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jackandpat.d at gmail.com Fri Apr 22 10:44:52 2011 From: jackandpat.d at gmail.com (jack drawbridge) Date: Fri, 22 Apr 2011 11:44:52 -0400 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: Here's a link to some ADO examples and tips by Allen Browne. http://allenbrowne.com/func-adox.html Specific to Modify table is http://allenbrowne.com/func-adox.html#ModifyTableAdox On Fri, Apr 22, 2011 at 11:35 AM, Charlotte Foust wrote: > Yes, it is possible to change a table (not a tabledef, please note) > with ADO, but you have to use the ADOX library, and the process is > different. ADOX is the library that lets you create and edit tables > using ADO. The 2010 help files aren't very helpful when it comes to > ADOX, I've noticed. However, the MSDN files are better. Take a look > at http://support.microsoft.com/kb/291264/fr to see about manipulating > tables and links in ADOX. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 6:31 AM, Brad Marks > wrote: > > All, > > > > We have an existing Access 2007 application that uses ADO. > > > > We now want to enhance this application to be able to change a TableDef > > with VBA code so that we can change the path to an Excel file on the > > fly. > > > > Is it possible to change TableDefs with ADO? > > > > I have seen many examples of how to change TableDefs with DAO, but I > > have not yet discovered an example of how to do this with ADO. > > > > I am fairly new to the world of Access and I am still trying to wrap my > > little brain around the "ADO vs DAO" debate. > > > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > > > Thanks, > > Brad > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 10:48:15 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:48:15 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. Correct me if I am wrong. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 10:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Better! Public Sub test() 'I have a dim statements as follows Dim LineText As String Dim test As Variant ' no parenthesis for the name of the variable LineText = " 0.000 243.729 - 61.495 -" 'The split statement should be as follows test = Split(LineText, "0") ' the split separator must be within the () of the split function End Sub Philippe 2011/4/22 philippe pons > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > I am trying to use the split command on the following string >> >> " 0.000 243.729 - >> 61.495 -" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large >> number of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:50:18 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:50:18 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB7@houex1.kindermorgan.com> The (0) is to put the first element of the array into the variable Test -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:12 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command What is the (0) for? You have to declare the variable as a variant because the value returned from Split is an array. Charlotte Foust On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > >> I am trying to use the split command on the following string >> >> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >> ? 61.495 ? ? ? ? ? ? ?-" >> >> I have a dim statements as follows >> Dim LineText As String >> Dim Test() As String >> >> The split statement is as follows >> Test = Split(LineText)(0) >> >> No matter how I dim Test() I get an error message of >> Run Time Error 13 >> Type Mismatch >> >> This seems like it should be real simple but I am obviously missing >> something. >> >> Thanks. >> >> >> >> >> Chester Kaup >> Engineering Technician >> Kinder Morgan CO2 Company, LLP >> Office (432) 688-3797 >> FAX (432) 688-3799 >> >> >> No trees were killed in the sending of this message. However a large number >> of electrons were terribly inconvenienced. >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 10:51:38 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 10:51:38 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB8@houex1.kindermorgan.com> The - is part of the string that is being read from a text file using a lineinput statement. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:18 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command You're telling it to use "0" as the delimiter, which obviously isn't correct. If you want to use a 0 for the binary compare, you need to add the missing commas to get it in the right bucket. What is the "-" in there for? Charlotte Foust On Fri, Apr 22, 2011 at 8:12 AM, Charlotte Foust wrote: > What is the (0) for? ?You have to declare the variable as a variant > because the value returned from Split is an array. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 7:57 AM, philippe pons wrote: >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >>> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large number >>> of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 10:53:08 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 11:53:08 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1A464.3090708@colbyconsulting.com> OK, thanks for that! John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From charlotte.foust at gmail.com Fri Apr 22 10:55:46 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 08:55:46 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From davidmcafee at gmail.com Fri Apr 22 11:01:18 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 09:01:18 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: This is how I use it: 'Opening ARgs = "ReturnForm|ReturnField" Dim arrX As Variant If Nz(Me.OpenArgs, "") <> "" Then arrX = Split(Me.OpenArgs, "|") strReturnForm = arrX(0) strReturnField = arrX(1) End If On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester < Chester_Kaup at kindermorgan.com> wrote: > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the > first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a large > >> number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From Chester_Kaup at kindermorgan.com Fri Apr 22 11:08:53 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 11:08:53 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> I tried changing the dim statement to Dim Test as Variant I then did Test = Split(LineText) Test2=Test(0) Both variables test and test2 are empty I ran a LEN test on the variable LineText and got 98 I am puzzled. Thanks for everyone's help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, April 22, 2011 10:56 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command I see. You're trying to manipulate the resultant array before assigning it to the variant variable. I don't think that will work, even though it seems like it should. I suspect you're going to have to assign the result to a variant and then use the 0 element of the variant array to get what you want. I'd suggest you try that. However, given the structure of the string you're working with, I suspect you'll find that the resultant array has a whole bunch of elements containing spaces. Try it the long way and see what you get. You may be surprised by what is in element 0. Charlotte Foust On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester wrote: > My understanding is that the result of the split statement is a one dimensional array. Thus the Dim test() as Variant > The Test = Split(LineText)(0) statement is meant to put the contents of the first array element into the variable Test. > Correct me if I am wrong. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > Sent: Friday, April 22, 2011 10:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > Better! > > Public Sub test() > ? ?'I have a dim statements as follows > ? ?Dim LineText As String > ? ?Dim test As Variant ' no parenthesis for the name of the variable > ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 > 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" > ? ?'The split statement should be as follows > ? ?test = Split(LineText, "0") ' the split separator must be within the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > >> Dim Test() As Variant >> >> Philippe >> >> 2011/4/22 Kaup, Chester >> >> I am trying to use the split command on the following string >>> >>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? - >>> ? ? 61.495 ? ? ? ? ? ? ?-" >>> >>> I have a dim statements as follows >>> Dim LineText As String >>> Dim Test() As String >>> >>> The split statement is as follows >>> Test = Split(LineText)(0) >>> >>> No matter how I dim Test() I get an error message of >>> Run Time Error 13 >>> Type Mismatch >>> >>> This seems like it should be real simple but I am obviously missing >>> something. >>> >>> Thanks. >>> >>> >>> >>> >>> Chester Kaup >>> Engineering Technician >>> Kinder Morgan CO2 Company, LLP >>> Office (432) 688-3797 >>> FAX (432) 688-3799 >>> >>> >>> No trees were killed in the sending of this message. However a large >>> number of electrons were terribly inconvenienced. >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From phpons at gmail.com Fri Apr 22 11:32:32 2011 From: phpons at gmail.com (philippe pons) Date: Fri, 22 Apr 2011 18:32:32 +0200 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From BradM at blackforestltd.com Fri Apr 22 11:50:14 2011 From: BradM at blackforestltd.com (Brad Marks) Date: Fri, 22 Apr 2011 11:50:14 -0500 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? References: <4DB17842.4020604@colbyconsulting.com> Message-ID: All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From jedi at charm.net Fri Apr 22 12:25:08 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:25:08 -0400 (EDT) Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB183F9.90006@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> Message-ID: <2419.24.35.19.37.1303493108.squirrel@mail.expedient.net> John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or > obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page > to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn > how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first > string, but it would be good (for another project) to know how I insert > data into the controls and > click the search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table > collection etc. The web control is found by clicking the ellipsis in the > toolbox bar in form design > and going down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I > have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they > apparently did not program the web site in a "nice" manner, tables just > have one big long string > etc. the following is the code that I use to poke through the dozens of > tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading >> all pdf and xls from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info >> to my address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jedi at charm.net Fri Apr 22 12:33:43 2011 From: jedi at charm.net (Michael Bahr) Date: Fri, 22 Apr 2011 13:33:43 -0400 (EDT) Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <2432.24.35.19.37.1303493623.squirrel@mail.expedient.net> Chester, if you are still having trouble consider using the debugger. Stop on the line Test = Split(LineText) and view the contents of LineText to make sure there is something there. If there is a valid string then view the properties of Split(LineText), there should be a bunch. You may need to place them in the Inspection window. Goodluck, Mike... > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: >> My understanding is that the result of the split statement is a one >> dimensional array. Thus the Dim test() as Variant >> The Test = Split(LineText)(0) statement is meant to put the contents of >> the first array element into the variable Test. >> Correct me if I am wrong. >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons >> Sent: Friday, April 22, 2011 10:05 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Trouble using Split command >> >> Better! >> >> Public Sub test() >> ? ?'I have a dim statements as follows >> ? ?Dim LineText As String >> ? ?Dim test As Variant ' no parenthesis for the name of the variable >> ? ?LineText = " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 >> 243.729 ? ? ? ? ? ? - ? ? ? 61.495 ? ? ? ? ? ? ?-" >> ? ?'The split statement should be as follows >> ? ?test = Split(LineText, "0") ' the split separator must be within the >> () >> of the split function >> End Sub >> Philippe >> 2011/4/22 philippe pons >> >>> Dim Test() As Variant >>> >>> Philippe >>> >>> 2011/4/22 Kaup, Chester >>> >>> I am trying to use the split command on the following string >>>> >>>> " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0.000 ? ? ? ? ? ?243.729 ? ? ? ? ? ? >>>> - >>>> ? ? 61.495 ? ? ? ? ? ? ?-" >>>> >>>> I have a dim statements as follows >>>> Dim LineText As String >>>> Dim Test() As String >>>> >>>> The split statement is as follows >>>> Test = Split(LineText)(0) >>>> >>>> No matter how I dim Test() I get an error message of >>>> Run Time Error 13 >>>> Type Mismatch >>>> >>>> This seems like it should be real simple but I am obviously missing >>>> something. >>>> >>>> Thanks. >>>> >>>> >>>> >>>> >>>> Chester Kaup >>>> Engineering Technician >>>> Kinder Morgan CO2 Company, LLP >>>> Office (432) 688-3797 >>>> FAX (432) 688-3799 >>>> >>>> >>>> No trees were killed in the sending of this message. However a large >>>> number of electrons were terribly inconvenienced. >>>> >>>> >>>> -- >>>> AccessD mailing list >>>> AccessD at databaseadvisors.com >>>> http://databaseadvisors.com/mailman/listinfo/accessd >>>> Website: http://www.databaseadvisors.com >>>> >>> >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 12:43:28 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 13:43:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page Message-ID: Whoa. Well, you may be right ... however, I think one can actuate the link like this: Dim ITM as HTMLLINKELEMENT Set ITM = Doc.Links(ThatLink) ITM.Click The picture will then be visible. That may not be enough, though. Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Bahr Sent: Friday, April 22, 2011 1:25 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page John, this is Javascript. Look at the source code for that page and search for onClick. This onClick event runs the method javascript:unobscure(...) which displays the picture. The actual link appears to be "hidden" and only the method knows the actual filename. One of the arguments for the method is offenderID=1119894 where this may be referenced in a database to produce the image. My guess is that you would need someone on the inside :-)) to grab the picture. Mike... > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1119894&searchOffenderId=1119894&listurl=pagelistoffendersearchre > sults&listpage=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I > need to learn how it is done so I can do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter > data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the > data. It is ugly but they apparently did not program the web site in > a "nice" manner, tables just have one big long string etc. the > following is the code that I use to poke through the dozens of tables > they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Fri Apr 22 13:05:24 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Fri, 22 Apr 2011 13:05:24 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Thanks for everyone's help and suggestions. I wanted to get out just the 5 data elements. Obviously I need a different plan. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons Sent: Friday, April 22, 2011 11:33 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command If you use the split function without the 2nd parameter, then space is the delimiter. so Test = Split(LineText) will return an array with something like 78 elements. The first element Test(0) holds an empty string. To get this first element, you can write: Test2=Split(LineText)(0). with Test2 a string variable. But all this is to get an empty string? Philippe 2011/4/22 Kaup, Chester > I tried changing the dim statement to > Dim Test as Variant > > I then did > Test = Split(LineText) > Test2=Test(0) > > Both variables test and test2 are empty > I ran a LEN test on the variable LineText and got 98 > > I am puzzled. Thanks for everyone's help. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust > Sent: Friday, April 22, 2011 10:56 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Trouble using Split command > > I see. You're trying to manipulate the resultant array before > assigning it to the variant variable. I don't think that will work, > even though it seems like it should. I suspect you're going to have > to assign the result to a variant and then use the 0 element of the > variant array to get what you want. I'd suggest you try that. > However, given the structure of the string you're working with, I > suspect you'll find that the resultant array has a whole bunch of > elements containing spaces. Try it the long way and see what you get. > You may be surprised by what is in element 0. > > Charlotte Foust > > On Fri, Apr 22, 2011 at 8:48 AM, Kaup, Chester > wrote: > > My understanding is that the result of the split statement is a one > dimensional array. Thus the Dim test() as Variant > > The Test = Split(LineText)(0) statement is meant to put the contents of > the first array element into the variable Test. > > Correct me if I am wrong. > > > > -----Original Message----- > > From: accessd-bounces at databaseadvisors.com [mailto: > accessd-bounces at databaseadvisors.com] On Behalf Of philippe pons > > Sent: Friday, April 22, 2011 10:05 AM > > To: Access Developers discussion and problem solving > > Subject: Re: [AccessD] Trouble using Split command > > > > Better! > > > > Public Sub test() > > 'I have a dim statements as follows > > Dim LineText As String > > Dim test As Variant ' no parenthesis for the name of the variable > > LineText = " 0.000 > > 243.729 - 61.495 -" > > 'The split statement should be as follows > > test = Split(LineText, "0") ' the split separator must be within the > () > > of the split function > > End Sub > > Philippe > > 2011/4/22 philippe pons > > > >> Dim Test() As Variant > >> > >> Philippe > >> > >> 2011/4/22 Kaup, Chester > >> > >> I am trying to use the split command on the following string > >>> > >>> " 0.000 243.729 - > >>> 61.495 -" > >>> > >>> I have a dim statements as follows > >>> Dim LineText As String > >>> Dim Test() As String > >>> > >>> The split statement is as follows > >>> Test = Split(LineText)(0) > >>> > >>> No matter how I dim Test() I get an error message of > >>> Run Time Error 13 > >>> Type Mismatch > >>> > >>> This seems like it should be real simple but I am obviously missing > >>> something. > >>> > >>> Thanks. > >>> > >>> > >>> > >>> > >>> Chester Kaup > >>> Engineering Technician > >>> Kinder Morgan CO2 Company, LLP > >>> Office (432) 688-3797 > >>> FAX (432) 688-3799 > >>> > >>> > >>> No trees were killed in the sending of this message. However a large > >>> number of electrons were terribly inconvenienced. > >>> > >>> > >>> -- > >>> AccessD mailing list > >>> AccessD at databaseadvisors.com > >>> http://databaseadvisors.com/mailman/listinfo/accessd > >>> Website: http://www.databaseadvisors.com > >>> > >> > >> > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 22 13:13:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 14:13:42 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> Message-ID: <4DB1C556.70804@colbyconsulting.com> Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Fri Apr 22 13:55:36 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Fri, 22 Apr 2011 14:55:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: John, Please elaborate on what is meant by early binding, since the control can be placed on a form and it shows all properties and methods in the Object Browser? Or did you mean late binding? Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 2:14 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project and > then lots more to loop through the relevant tables, rows, childnodes, > and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offend > erID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults& > listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) > of the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of > some inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" > which I assume is actually a button? > > It is not that I need to get one or even several photos. I need the > *code* to do it from VBA, and I need to learn how it is done so I can > do it again by myself. > > I would prefer to actually retrieve the photo to a file stored on > disk, however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of > the OPUS ID in that first string, but it would be good (for another > project) to know how I insert data into the controls and click the > search button, how to click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by > clicking the ellipsis in the toolbox bar in form design and going > down until you find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way > I have managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is > the code that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) > And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 14:00:19 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 12:00:19 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> Message-ID: <8147EC9653BF4537B0067252FF8940A7@HAL9005> IIRC if you define all the DOA and ADO objects explicitly they'll play well together. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 9:50 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All - Thanks for the help/advice/insights ... Brad ~~~~~~~~~~~ Rocky, In the situation that I am dealing with, the Excel file is a "Linked Table". This works fine. Now we want to be able to change the Path to this Linked Table with VBA code. I have this working using DAO, but I have some concern about using both DAO and ADO in the same application. It appears that using both DAO and ADO is Okay, but I am not 100% sure. Thanks, Brad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:45 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? What kind of change do you want to make? Wouldn't the path to the Excel file be stored as data in a text field in the table? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks Sent: Friday, April 22, 2011 6:31 AM To: Access Developers discussion and problem solving Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? All, We have an existing Access 2007 application that uses ADO. We now want to enhance this application to be able to change a TableDef with VBA code so that we can change the path to an Excel file on the fly. Is it possible to change TableDefs with ADO? I have seen many examples of how to change TableDefs with DAO, but I have not yet discovered an example of how to do this with ADO. I am fairly new to the world of Access and I am still trying to wrap my little brain around the "ADO vs DAO" debate. Is it Okay to mix both ADO and DAO in a single Access 2007 application? Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From davidmcafee at gmail.com Fri Apr 22 15:05:08 2011 From: davidmcafee at gmail.com (David McAfee) Date: Fri, 22 Apr 2011 13:05:08 -0700 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > From rockysmolin at bchacc.com Fri Apr 22 16:40:00 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:40:00 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Fri Apr 22 16:41:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 14:41:22 -0700 Subject: [AccessD] Hide Form Title Bar References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <6864E3DD26DE4AB1A32DA74295F92233@HAL9005> Actually, I just noticed that there's a tiny sliver of bar at the top that lets you drag the form. Why do they DO THAT??!!! Rocky -----Original Message----- From: Rocky Smolin [mailto:rockysmolin at bchacc.com] Sent: Friday, April 22, 2011 2:40 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , Message-ID: <4DB1FB8D.3278.2DF4AAA1@stuart.lexacorp.com.pg> No, even worse. I repeat - Variants are an abomination A comparison of your two examples shows why this is so. -- Stuart On 22 Apr 2011 at 17:04, philippe pons wrote: > Better! > > Public Sub test() > 'I have a dim statements as follows > Dim LineText As String > Dim test As Variant ' no parenthesis for the name of the variable > LineText = " 0.000 > 243.729 - 61.495 -" > 'The split statement should be as follows > test = Split(LineText, "0") ' the split separator must be within > the () > of the split function > End Sub > Philippe > 2011/4/22 philippe pons > > > Dim Test() As Variant > > > > Philippe > > > > 2011/4/22 Kaup, Chester > > > > I am trying to use the split command on the following string > >> > >> " 0.000 243.729 > >> - > >> 61.495 -" > >> > >> I have a dim statements as follows > >> Dim LineText As String > >> Dim Test() As String > >> > >> The split statement is as follows > >> Test = Split(LineText)(0) > >> > >> No matter how I dim Test() I get an error message of > >> Run Time Error 13 > >> Type Mismatch > >> > >> This seems like it should be real simple but I am obviously missing > >> something. > >> > >> Thanks. > >> > >> > >> > >> > >> Chester Kaup > >> Engineering Technician > >> Kinder Morgan CO2 Company, LLP > >> Office (432) 688-3797 > >> FAX (432) 688-3799 > >> > >> > >> No trees were killed in the sending of this message. However a > >> large number of electrons were terribly inconvenienced. > >> > >> > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > >> > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:05:01 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:05:01 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, Message-ID: <4DB1FB8D.7908.2DF4AA15@stuart.lexacorp.com.pg> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" The Split() function returns a String array. So Dim Test() as Stinrg is correct. -- Stuart On 22 Apr 2011 at 16:57, philippe pons wrote: > Dim Test() As Variant > > Philippe > > 2011/4/22 Kaup, Chester > > > I am trying to use the split command on the following string > > > > " 0.000 243.729 > > - > > 61.495 -" > > > > I have a dim statements as follows > > Dim LineText As String > > Dim Test() As String > > > > The split statement is as follows > > Test = Split(LineText)(0) > > > > No matter how I dim Test() I get an error message of > > Run Time Error 13 > > Type Mismatch > > > > This seems like it should be real simple but I am obviously missing > > something. > > > > Thanks. > > > > > > > > > > Chester Kaup > > Engineering Technician > > Kinder Morgan CO2 Company, LLP > > Office (432) 688-3797 > > FAX (432) 688-3799 > > > > > > No trees were killed in the sending of this message. However a large > > number of electrons were terribly inconvenienced. > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Fri Apr 22 17:14:32 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 23 Apr 2011 08:14:32 +1000 Subject: [AccessD] Trouble using Split command In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com>, , <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <4DB1FDC8.23134.2DFD5E85@stuart.lexacorp.com.pg> Why didn't you say so :-) Dim LineText as string Dim Elements() as string DIm x as long LineText = " 0.000 243.729 - 61.495 - " 'Reduce multiple spaces to singles While instr(Linetext," ") > 0 LineText = Replace(LineText," "," ") Wend 'Get the data Elements() = Split(LineText," ") 'Do something with the data For x = 1 to UBound(Elements()) debug.print Elements(x) Next On 22 Apr 2011 at 13:05, Kaup, Chester wrote: > Thanks for everyone's help and suggestions. I wanted to get out just > the 5 data elements. Obviously I need a different plan. > From jwcolby at colbyconsulting.com Fri Apr 22 17:40:36 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 22 Apr 2011 18:40:36 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com><9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB203E4.6000305@colbyconsulting.com> In order to pass the object to a class or method of a module any way other than "as object" you need to know what it is. IOW As textbox, as combobox etc. If you pass it "as object" then intellisense no longer works inside of the method or class. "As object" is late binding. In order te sink events in a class you have to ue early binding. Dim WithEvents XYZ as SomeObjType. John W. Colby www.ColbyConsulting.com On 4/22/2011 2:55 PM, Michael Mattys wrote: > John, > > Please elaborate on what is meant by early binding, > since the control can be placed on a form and it shows > all properties and methods in the Object Browser? > Or did you mean late binding? > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com From charlotte.foust at gmail.com Fri Apr 22 17:48:27 2011 From: charlotte.foust at gmail.com (Charlotte Foust) Date: Fri, 22 Apr 2011 15:48:27 -0700 Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? In-Reply-To: <8147EC9653BF4537B0067252FF8940A7@HAL9005> References: <4DB17842.4020604@colbyconsulting.com> <8147EC9653BF4537B0067252FF8940A7@HAL9005> Message-ID: You can use both, if you declare them specifically, but don't try to mix them because ADO calls don't work on a DAO object! Charlotte Foust On Fri, Apr 22, 2011 at 12:00 PM, Rocky Smolin wrote: > IIRC if you define all the DOA and ADO objects explicitly they'll play well > together. > > Rocky > > > -----Original Message----- > From: accOessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 9:50 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All - Thanks for the help/advice/insights ... Brad > > ~~~~~~~~~~~ > > Rocky, > > In the situation that I am dealing with, the Excel file is a "Linked Table". > > This works fine. > > Now we want to be able to change the Path to this Linked Table with VBA > code. > > I have this working using DAO, but I have some concern about using both DAO > and ADO in the same application. > > It appears that using both DAO and ADO is Okay, but I am not 100% sure. > > Thanks, > Brad > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin > Sent: Friday, April 22, 2011 8:45 AM > To: 'Access Developers discussion and problem solving' > Subject: Re: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > What kind of change do you want to make? ?Wouldn't the path to the Excel > file be stored as data in a text field in the table? > > Rocky > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, April 22, 2011 6:31 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Using ADO to change a TableDef? Mixing ADO and DAO? > > All, > > We have an existing Access 2007 application that uses ADO. > > We now want to enhance this application to be able to change a TableDef with > VBA code so that we can change the path to an Excel file on the fly. > > Is it possible to change TableDefs with ADO? > > I have seen many examples of how to change TableDefs with DAO, but I have > not yet discovered an example of how to do this with ADO. > > I am fairly new to the world of Access and I am still trying to wrap my > little brain around the "ADO vs DAO" debate. > > Is it Okay to mix both ADO and DAO in a single Access 2007 application? > > Thanks, > Brad > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > This message has been scanned for viruses and dangerous content by > MailScanner, and is believed to be clean. > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From DWUTKA at Marlow.com Fri Apr 22 19:42:41 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 22 Apr 2011 19:42:41 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From rockysmolin at bchacc.com Fri Apr 22 20:03:02 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Fri, 22 Apr 2011 18:03:02 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> Message-ID: <171D63778466419685EA3C5EE9C24CB0@HAL9005> On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From gustav at cactus.dk Sat Apr 23 06:37:51 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 23 Apr 2011 13:37:51 +0200 Subject: [AccessD] Trouble using Split command Message-ID: Hi Stuart Let me guess: Stuart loves programming VBScript! /gustav >>> stuart at lexacorp.com.pg 23-04-2011 00:05:01 >>> NO! Repeat after me, seven times... "Variants are an abomination. They are rarely required and must be used with caution" From dhb at flsi.com Sat Apr 23 07:20:00 2011 From: dhb at flsi.com (Darrell Burns) Date: Sat, 23 Apr 2011 05:20:00 -0700 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases Message-ID: <032a01cc01b0$c4a1c630$4de55290$@com> Howdy. First-time on AccessD. I've tried all the other forums and can't get an answer to this one. I have a FE A2007 app linked to a BE A2007 database. There's a master form with 6 tabs. Each tab contains a subform that's bound to a query. Plus I open recordsets on the the BE tables to fetch stuff for the form. You can drill down from any subform to a detailed form by double-clicking a data field. I started getting the above error message after opening 2 or 3 of these forms, so I created a form handler method that shuts down the calling form and closes all the DB connections before opening the target form. I'm still getting that error. I've gone thru my code and diligently set all DBs to nothing at the end of each sub, but I can't seem to lick the problem. Suggestions from other forums have been to unbind the tables from the subforms. I buy that, but the question I can't get an answer to is how can I monitor how many connections I have open at one time so I can diagnose the problem? I feel like I'm debugging in the dark. Please turn on the light for me. Thanx, Darrell From jwcolby at colbyconsulting.com Sat Apr 23 08:13:11 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:13:11 -0400 Subject: [AccessD] Trouble using Split command In-Reply-To: References: Message-ID: <4DB2D067.20705@colbyconsulting.com> LOL. The reality is that variants are a specialized tool used for specific situations. There are things that you cannot accomplish without them but if you know what the data type you need is, you should use that type rather than a variant. John W. Colby www.ColbyConsulting.com On 4/23/2011 7:37 AM, Gustav Brock wrote: > Hi Stuart > > Let me guess: Stuart loves programming VBScript! > > /gustav > > >>>> stuart at lexacorp.com.pg 23-04-2011 00:05:01>>> > NO! > > Repeat after me, seven times... > > "Variants are an abomination. They are rarely required and must be used with caution" > > > From DWUTKA at Marlow.com Sat Apr 23 08:16:32 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 08:16:32 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: <171D63778466419685EA3C5EE9C24CB0@HAL9005> References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005> <171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From jwcolby at colbyconsulting.com Sat Apr 23 08:51:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 09:51:18 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB2D956.50309@colbyconsulting.com> Darrell, This is one of those misleading error messages. Every single open query or or table uses a "database". This means every combo box (uses a query to display the data), bound form, bound report, open recordset and so forth. The usual villain is a bound form with bound subforms with dozens of combo boxes open. I investigated this extensively a few years ago and what I discovered is that Access has some magic number which is the maximum number of recordsets available to the application. It seems that the number was somewhere around 1800. Every time you opened a query (combo, report, sub-report etc) the number available dropped. When you got low enough (and "low enough was not zero) you started getting this error. There is no fix, this is a "by design" limitation. You work around it by using JIT subforms and the like to minimize the number of objects using queries. BTW, you can discover for yourself what this number is fairly easily but there is no place (that I could discover) that you could go to see how many were left. The following code is not pretty but it does the job. In my case I am getting only 408 recordsets. I could swear the number was much higher. this is against linked SQL Server databases so maybe that has something to do with it. If we could get a bunch of people to run the code and report back their numbers that would help us to see better. Function rstOpen(db As DAO.Database, intTheLimit As Integer) As DAO.Recordset Dim rst As DAO.Recordset On Error Resume Next Set rst = db.OpenRecordset("SELECT * from tblLocation", dbOpenSnapshot, dbSeeChanges) If Err Then MsgBox intTheLimit & " is the max number of recordsets you can open" Else Set rstOpen = rst End If End Function Function TestTheLimit() Dim db As DAO.Database Dim col As Collection Dim intTheLimit As Integer Set db = CurrentDb Set col = New Collection On Error Resume Next While True intTheLimit = intTheLimit + 1 col.Add rstOpen(db, intTheLimit) Debug.Print intTheLimit DoEvents Wend End Function John W. Colby www.ColbyConsulting.com On 4/23/2011 8:20 AM, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master form > with 6 tabs. Each tab contains a subform that's bound to a query. Plus I > open recordsets on the the BE tables to fetch stuff for the form. You can > drill down from any subform to a detailed form by double-clicking a data > field. I started getting the above error message after opening 2 or 3 of > these forms, so I created a form handler method that shuts down the calling > form and closes all the DB connections before opening the target form. I'm > still getting that error. I've gone thru my code and diligently set all DBs > to nothing at the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how can I > monitor how many connections I have open at one time so I can diagnose the > problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > From accessd at shaw.ca Sat Apr 23 09:18:30 2011 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 23 Apr 2011 07:18:30 -0700 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: <4DB1C556.70804@colbyconsulting.com> References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: Hi John: It is done via a process call screen-scraping and it can only be done using webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 22, 2011 11:14 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How do I Grab the picture from the web page Has anyone here ever figured out how to early bind the WebBrowser activeX object? John W. Colby www.ColbyConsulting.com On 4/22/2011 10:40 AM, Michael Mattys wrote: > John, > > OK, I think the best way to approach this is for you to visit > http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp > > It took me an hour or two to get the right elements for my project > and then lots more to loop through the relevant tables, rows, > childnodes, and cells to get the right info. > > Basically, you want the href of the image and then it's a simple > binary save object to file, thus > > http://www.devx.com/vb2themax/Tip/18441 > > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 9:35 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Michael, > > Thanks. The web page I navigate to is as follows: > > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa > ge=1 > > I literally replace the offenderID with the ID (called an OPUS number) of > the inmate I am viewing or obtaining the record for. > > What you are viewing if you go to this link is an actual record of some > inmate. Open this web page to view the html behind. > > Notice that the picture is obscured, with a "click to show photo" which I > assume is actually a button? > > It is not that I need to get one or even several photos. I need the *code* > to do it from VBA, and I need to learn how it is done so I can do it again > by myself. > > I would prefer to actually retrieve the photo to a file stored on disk, > however I also want to learn how to click buttons (and enter data). > > The following is the actual search website. > > http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view > > I don't need it for this project because I can do a simple replace of the > OPUS ID in that first string, but it would be good (for another project) to > know how I insert data into the controls and click the search button, how to > click the Clear Selection button etc. > > I currently use an ActiveX control inserted into a subform to retrieve > pages, get the table collection etc. The web control is found by clicking > the ellipsis in the toolbox bar in form design and going down until you > find the Microsoft Web Browser control. > > I have found code in Google to do this other ways but this is the way I have > managed to get working. > I wrote a class "wrapper" with methods that I call to parse out the data. > It is ugly but they apparently did not program the web site in a "nice" > manner, tables just have one big long string etc. the following is the code > that I use to poke through the dozens of tables they use. > > Again, there might be an easier way but this is how I got it working. > > Function mSearchTable(wbbWebsite As Object) > > Dim varTables As Variant > Dim varTable As Variant > > Dim strOffenderInfo As String > Dim strMostRecent As String > > > Set varTables = wbbWebsite.Document.All().tags("table") > Set varTables = wbbWebsite.Document.All.tags("TABLE") > For Each varTable In varTables > > Dim strInnerText As String > strInnerText = varTable.innerText > 'Use the innerText to see if this is the table we want. > 'Debug.Print varTable.innerText > > If (InStr(strInnerText, "Offender Information")) And (Not > mblnOffenderInfoFound) Then > strOffenderInfo = strInnerText > mParseInfoOffender strInnerText > Else > If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And (Not > mblnMostRecentInfoFound) Then > strMostRecent = strInnerText > mParseMostRecent strMostRecent > End If > > End If > Next varTable > > End Function > > So what I need is not a fish, but to learn *how* to fish. > > Any assistance gratefully accepted. > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 9:06 AM, Michael Mattys wrote: >> Hi John, >> >> I've just finished a similar project for downloading all pdf and xls >> from a site and the iron is still hot. >> >> I know its volunteer - just send the relevant access info to my >> address and I'll get your pics for you. >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 09:25:26 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 07:25:26 -0700 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Apr 23 10:10:28 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 11:10:28 -0400 Subject: [AccessD] How do I Grab the picture from the web page In-Reply-To: References: <4DB17842.4020604@colbyconsulting.com> <4DB183F9.90006@colbyconsulting.com> <9DED5E74E3B841C794E4D860BF2AAD28@Gateway> <4DB1C556.70804@colbyconsulting.com> Message-ID: <4DB2EBE4.7060009@colbyconsulting.com> > ...and that is a whole different subject/environment/topic. ASP.Net would be your best all around solution. Uh... this kind of thing needs to be done many different places. It is rarely about "pick your tool to do this", rather "this app uses X tool, how do I do it there". This app uses Access / VBA. How do I do it there? Telling me to go off and rewrite my app in some other tool so that I can use that tool to do one tiny piece is... draconian. It turns out that there is an IE object which knows how to do most of this kind of thing, and can be automated from VBA. It is really a matter of studying that long enough to figure it out. John W. Colby www.ColbyConsulting.com On 4/23/2011 10:18 AM, Jim Lawrence wrote: > Hi John: > > It is done via a process call screen-scraping and it can only be done using > webbased programs like PHP, Java, ASP, ASP.Net, JavaScript etc... > > ...and that is a whole different subject/environment/topic. ASP.Net would be > your best all around solution. > > Jim > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 22, 2011 11:14 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] How do I Grab the picture from the web page > > Has anyone here ever figured out how to early bind the WebBrowser activeX > object? > > John W. Colby > www.ColbyConsulting.com > > On 4/22/2011 10:40 AM, Michael Mattys wrote: >> John, >> >> OK, I think the best way to approach this is for you to visit >> http://www.w3schools.com/HTMLDOM/dom_nodes_access.asp >> >> It took me an hour or two to get the right elements for my project >> and then lots more to loop through the relevant tables, rows, >> childnodes, and cells to get the right info. >> >> Basically, you want the href of the image and then it's a simple >> binary save object to file, thus >> >> http://www.devx.com/vb2themax/Tip/18441 >> >> >> Michael R Mattys >> Business Process Developers >> www.mattysconsulting.com >> >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Friday, April 22, 2011 9:35 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] How do I Grab the picture from the web page >> >> Michael, >> >> Thanks. The web page I navigate to is as follows: >> >> > http://webapps6.doc.state.nc.us/opi/viewoffender.do?method=view&offenderID=1 >> > 119894&searchOffenderId=1119894&listurl=pagelistoffendersearchresults&listpa >> ge=1 >> >> I literally replace the offenderID with the ID (called an OPUS number) of >> the inmate I am viewing or obtaining the record for. >> >> What you are viewing if you go to this link is an actual record of some >> inmate. Open this web page to view the html behind. >> >> Notice that the picture is obscured, with a "click to show photo" which I >> assume is actually a button? >> >> It is not that I need to get one or even several photos. I need the > *code* >> to do it from VBA, and I need to learn how it is done so I can do it again >> by myself. >> >> I would prefer to actually retrieve the photo to a file stored on disk, >> however I also want to learn how to click buttons (and enter data). >> >> The following is the actual search website. >> >> http://webapps6.doc.state.nc.us/opi/offendersearch.do?method=view >> >> I don't need it for this project because I can do a simple replace of the >> OPUS ID in that first string, but it would be good (for another project) > to >> know how I insert data into the controls and click the search button, how > to >> click the Clear Selection button etc. >> >> I currently use an ActiveX control inserted into a subform to retrieve >> pages, get the table collection etc. The web control is found by clicking >> the ellipsis in the toolbox bar in form design and going down until you >> find the Microsoft Web Browser control. >> >> I have found code in Google to do this other ways but this is the way I > have >> managed to get working. >> I wrote a class "wrapper" with methods that I call to parse out the > data. >> It is ugly but they apparently did not program the web site in a "nice" >> manner, tables just have one big long string etc. the following is the > code >> that I use to poke through the dozens of tables they use. >> >> Again, there might be an easier way but this is how I got it working. >> >> Function mSearchTable(wbbWebsite As Object) >> >> Dim varTables As Variant >> Dim varTable As Variant >> >> Dim strOffenderInfo As String >> Dim strMostRecent As String >> >> >> Set varTables = wbbWebsite.Document.All().tags("table") >> Set varTables = wbbWebsite.Document.All.tags("TABLE") >> For Each varTable In varTables >> >> Dim strInnerText As String >> strInnerText = varTable.innerText >> 'Use the innerText to see if this is the table we want. >> 'Debug.Print varTable.innerText >> >> If (InStr(strInnerText, "Offender Information")) And (Not >> mblnOffenderInfoFound) Then >> strOffenderInfo = strInnerText >> mParseInfoOffender strInnerText >> Else >> If (InStr(strInnerText, "Most Recent Incarceration Summary ")) And > (Not >> mblnMostRecentInfoFound) Then >> strMostRecent = strInnerText >> mParseMostRecent strMostRecent >> End If >> >> End If >> Next varTable >> >> End Function >> >> So what I need is not a fish, but to learn *how* to fish. >> >> Any assistance gratefully accepted. >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/22/2011 9:06 AM, Michael Mattys wrote: >>> Hi John, >>> >>> I've just finished a similar project for downloading all pdf and xls >>> from a site and the iron is still hot. >>> >>> I know its volunteer - just send the relevant access info to my >>> address and I'll get your pics for you. >>> >>> Michael R Mattys >>> Business Process Developers >>> www.mattysconsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> From rockysmolin at bchacc.com Sat Apr 23 10:26:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 08:26:16 -0700 Subject: [AccessD] Autocorrect Dialog Box Message-ID: Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky From jwcolby at colbyconsulting.com Sat Apr 23 11:06:45 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 12:06:45 -0400 Subject: [AccessD] SQL Server times link as str Message-ID: <4DB2F915.1070407@colbyconsulting.com> I am linking to tables with date / time fields in SQL Server. The field in Access says it is a date. This appears to be causing all kinds of issues. I cannot see any way to intercept the link and tell the wizard that a specific field is a specific data type. Is there any way to fix this? -- John W. Colby www.ColbyConsulting.com From rockysmolin at bchacc.com Sat Apr 23 11:12:08 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:12:08 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: Message-ID: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 11:16:44 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 09:16:44 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> Message-ID: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bill_patten at embarqmail.com Sat Apr 23 12:33:23 2011 From: bill_patten at embarqmail.com (Bill Patten) Date: Sat, 23 Apr 2011 10:33:23 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: <23DC8A0E4075438EA4854DCF671871EA@HAL9005> References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005> <23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Sat Apr 23 12:57:11 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Sat, 23 Apr 2011 10:57:11 -0700 Subject: [AccessD] Autocorrect Dialog Box In-Reply-To: References: <0046A35A2E074AA98F3C5D8B48911598@HAL9005><23DC8A0E4075438EA4854DCF671871EA@HAL9005> Message-ID: Bill: Not trying to set the autocorrect options but just trigger the dialog box so that the user can fiddle with it. Apparently, from what I've been able to find on the internets, it works in Excel - there's a constant for it in the Application.Dialogs object. But I can't find the equivalent for Access. Although, IME, anything you can do through the menus you can do through code. Since I can get that dialog box by clicking Tools-->AutoCorrectOptions in 2003 (there's a different sequence of course, in 2007) I'm thinking this has to be doable in code as well. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Patten Sent: Saturday, April 23, 2011 10:33 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box Rocky, Does it work the next time you open the app? Some property changes don't take effect while the app is open but do the next time it's opened. Of course if you have set the property back to false on application or form close you will never know. Bill -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 16:28:18 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:28:18 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB2F915.1070407@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com> Message-ID: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> What sort of issues? Is the SQL Server field a datetime or a smalldatetime? Using ODBC? What Client? AFAIK, Access doesn't have a "Date" field type, only a Date/Time -- Stuart On 23 Apr 2011 at 12:06, jwcolby wrote: > I am linking to tables with date / time fields in SQL Server. The > field in Access says it is a date. This appears to be causing all > kinds of issues. I cannot see any way to intercept the link and tell > the wizard that a specific field is a specific data type. Is there > any way to fix this? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From stuart at lexacorp.com.pg Sat Apr 23 16:55:17 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 07:55:17 +1000 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <032a01cc01b0$c4a1c630$4de55290$@com> References: <>, <032a01cc01b0$c4a1c630$4de55290$@com> Message-ID: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> >From everything that I have read, Access maintains TableIDs internally and the number currently used is not exposed in any way, so sadly it appears that the answer to your question is - You can't. -- Stuart On 23 Apr 2011 at 5:20, Darrell Burns wrote: > Howdy. First-time on AccessD. > > I've tried all the other forums and can't get an answer to this one. > > I have a FE A2007 app linked to a BE A2007 database. There's a master > form with 6 tabs. Each tab contains a subform that's bound to a query. > Plus I open recordsets on the the BE tables to fetch stuff for the > form. You can drill down from any subform to a detailed form by > double-clicking a data field. I started getting the above error > message after opening 2 or 3 of these forms, so I created a form > handler method that shuts down the calling form and closes all the DB > connections before opening the target form. I'm still getting that > error. I've gone thru my code and diligently set all DBs to nothing at > the end of each sub, but I can't seem to lick the problem. > > > > Suggestions from other forums have been to unbind the tables from the > subforms. I buy that, but the question I can't get an answer to is how > can I monitor how many connections I have open at one time so I can > diagnose the problem? I feel like I'm debugging in the dark. > > > > Please turn on the light for me. > > > > Thanx, > > Darrell > > > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 17:16:51 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 18:16:51 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com> <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg> Message-ID: <4DB34FD3.4050800@colbyconsulting.com> The SQL Server fields are time(0) and DateTime. It is picked up by Access as a string, IOW the field in design view of the linked table is a string. That probably happens because Access does not understand the miliseconds in the time, and AFAIK Access doesn't have a time field, only datetime. The issues are many but small, including weird displays of the values, necessity to convert to a date - cdate() - to do compares with other times (it converts to date just fine) and finally, I was trying to use the conditional display to color a date where it was <= date() + 180 (for example) and it just doesn't work, the colors do happen but there is no rhyme or reason to the colors. Things like that. So Access thinks it is a string, SQL Server thinks it is a date or time(0) and I am constantly fiddling with it to make it right. John W. Colby www.ColbyConsulting.com On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > What sort of issues? > > Is the SQL Server field a datetime or a smalldatetime? > Using ODBC? What Client? > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > From jimdettman at verizon.net Sat Apr 23 17:53:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Sat, 23 Apr 2011 18:53:33 -0400 Subject: [AccessD] Runtime error 3048 -- Cannot open anymore databases In-Reply-To: <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: 2048 is the table ID limit. While that sounds like a lot, every field reference carries a table I'd reference. Jim Sent from my iPhone On Apr 23, 2011, at 5:55 PM, "Stuart McLachlan" wrote: > From everything that I have read, Access maintains TableIDs internally and the number > currently used is not exposed in any way, so sadly it appears that the answer to your question > is - You can't. > > -- > Stuart > > On 23 Apr 2011 at 5:20, Darrell Burns wrote: > >> Howdy. First-time on AccessD. >> >> I've tried all the other forums and can't get an answer to this one. >> >> I have a FE A2007 app linked to a BE A2007 database. There's a master >> form with 6 tabs. Each tab contains a subform that's bound to a query. >> Plus I open recordsets on the the BE tables to fetch stuff for the >> form. You can drill down from any subform to a detailed form by >> double-clicking a data field. I started getting the above error >> message after opening 2 or 3 of these forms, so I created a form >> handler method that shuts down the calling form and closes all the DB >> connections before opening the target form. I'm still getting that >> error. I've gone thru my code and diligently set all DBs to nothing at >> the end of each sub, but I can't seem to lick the problem. >> >> >> >> Suggestions from other forums have been to unbind the tables from the >> subforms. I buy that, but the question I can't get an answer to is how >> can I monitor how many connections I have open at one time so I can >> diagnose the problem? I feel like I'm debugging in the dark. >> >> >> >> Please turn on the light for me. >> >> >> >> Thanx, >> >> Darrell >> >> >> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com From stuart at lexacorp.com.pg Sat Apr 23 18:05:22 2011 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2011 09:05:22 +1000 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB34FD3.4050800@colbyconsulting.com> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> Message-ID: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not DateTime2 (also new in 2008)? Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to "down-level clients" as strings, rather than as the numerics which are used to store them, so you will have to parse then back to compatible Access datatypes yourself. See http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom patibilityforDownlevelClients "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data types added in SQL Server 2008. The following table shows the type mapping between an up-level instance of SQL Server 2008 and down-level clients." -- Stuart On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. That probably happens because Access does not understand > the miliseconds in the time, and AFAIK Access doesn't have a time > field, only datetime. > > The issues are many but small, including weird displays of the values, > necessity to convert to a date - cdate() - to do compares with other > times (it converts to date just fine) and finally, I was trying to use > the conditional display to color a date where it was <= date() + 180 > (for example) and it just doesn't work, the colors do happen but there > is no rhyme or reason to the colors. > > Things like that. > > So Access thinks it is a string, SQL Server thinks it is a date or > time(0) and I am constantly fiddling with it to make it right. > > John W. Colby > www.ColbyConsulting.com > > On 4/23/2011 5:28 PM, Stuart McLachlan wrote: > > What sort of issues? > > > > Is the SQL Server field a datetime or a smalldatetime? > > Using ODBC? What Client? > > > > AFAIK, Access doesn't have a "Date" field type, only a Date/Time > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Sat Apr 23 18:11:42 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 23 Apr 2011 19:11:42 -0400 Subject: [AccessD] SQL Server times link as str In-Reply-To: <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> References: <4DB2F915.1070407@colbyconsulting.com>, <4DB34472.17182.32F966D9@stuart.lexacorp.com.pg>, <4DB34FD3.4050800@colbyconsulting.com> <4DB35B32.14377.335246BD@stuart.lexacorp.com.pg> Message-ID: <4DB35CAE.20209@colbyconsulting.com> Thanks Stuart. I kinda figured I was screwed! ;) John W. Colby www.ColbyConsulting.com On 4/23/2011 7:05 PM, Stuart McLachlan wrote: > Time() is a new type in SQL Server 2008. Are you sure the other field is DateTime and not > DateTime2 (also new in 2008)? > > Basically, you are screwed. MS in its wisdom decided to pass Time() and DateTime2 to > "down-level clients" as strings, rather than as the numerics which are used to store them, so > you will have to parse then back to compatible Access datatypes yourself. > > See > http://msdn.microsoft.com/en-us/library/ms180878%28v=SQL.100%29.aspx#BackwardCom > patibilityforDownlevelClients > > "Some down-level clients do not support the time, date, datetime2 and datetimeoffset data > types added in SQL Server 2008. The following table shows the type mapping between an > up-level instance of SQL Server 2008 and down-level clients." > From DWUTKA at Marlow.com Sat Apr 23 21:18:15 2011 From: DWUTKA at Marlow.com (Drew Wutka) Date: Sat, 23 Apr 2011 21:18:15 -0500 Subject: [AccessD] Hide Form Title Bar In-Reply-To: References: <30758B6C1BD34EFEAB03859EAEC3ECE1@HAL9005><2F55242637C64867956F4EF369D6E259@HAL9005><171D63778466419685EA3C5EE9C24CB0@HAL9005> Message-ID: Interesting. Not sure why 2007 would do anything different, but then again, it is 2007... LOL Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:25 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Yes, it does. And that helps. There are twenty five controls on the form, ten pairs of command button/labels and five other command buttons. So having the ability to drag by a label helps. On my 2008 machine, the form has the title bar showing when it opens. As soon as you resize the form by dragging and where on the border, the title bar gets minimized but doesn't go away. So you can still drag by the title bar. At the end of the day yesterday, the client reported that the latest version I sent him was not allowing him to drag at all. So Monday we're going to fire up Team Viewer and I'll see what's what on his machine, which is running 2007. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Saturday, April 23, 2011 6:17 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Do the labels let you drag the form if you put the code behind their mousedown events? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 8:03 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar On my 2007, you can't drag the form by clicking below the lowest control, as you can in 2003. But there's this little strip along the top of the form that's a different color than the other three sides and looks a bit like a squashed down title bar. I can drag by that. R -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, April 22, 2011 5:43 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar Odd, I actually tested it in 2007..... do you get an error message? Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Friday, April 22, 2011 4:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: So here's a complication - works perfectly in 2003, but not in 2007. Any idea why they broke it? :) Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 9:51 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I wouldn't say 'normal', but the code example is based on the 'Detail' Sections 'MouseDown' event. So if the only 'area' of the Details section is the spot below your controls, then that is the only area that would work with that event. You can put that code inside the mousedown event of each control that isn't currently reacting to a 'click', like the labels for elapsed time, and they will allow the same behavior. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Thursday, April 21, 2011 11:29 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Drew: It worked but here's an odd thing. The form consists of five small command buttons on the left . To the right of them are ten more command buttons and below each of the ten is a label that shows elapsed time. The form will drag only if the mouse is pressed below the lowest control on the form. Normal behavior? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Thursday, April 21, 2011 8:34 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar So here's how you fix that problem: 'Put the following in the declarations: Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Private Const WM_SYSCOMMAND = &H112 'Put the ReleaseCapture and SendMessage lines in the MouseDown even of your form's detail section as below Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End Sub Those two lines are going to make the 'detail' section act like a window's title bar in letting a using click and drag the window. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Wednesday, April 20, 2011 11:22 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Hide Form Title Bar Lambert: Thanks so much. That worked like a charm. Wish I could understand what was going on there. Only problem is that I now can't drag the form out of the way of what it's blocking and that might be a big problem for the user. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Wednesday, April 20, 2011 7:46 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Hide Form Title Bar I had a need for a form with no border at all, and Google helped me find the code. Regrettably I did not record where I got it, so I cannot credit the author, but a simple API call did the trick. In the form's module include this... Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = (-16) Private Const WS_BORDER = &H800000 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000 Private Const WS_DLGFRAME = &H400000 Private Const WS_THICKFRAME = &H40000 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_NOZORDER = &H4 Then, for my borderless for the form's Load event was... Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) SWP_NOSIZE Or SWP_NOZORDER End Sub By changing that load event to the following you wind up with a form with no title bar but with a sizable border (though it starts out with a height that includes the invisible title bar???). Private Sub Form_Load() Dim lStyle As Long lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) lStyle = lStyle And Not (WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX) Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) End Sub Be sure to set the form's border style to Sizable. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 19, 2011 4:37 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Hide Form Title Bar Dear List: I want to eliminate the form title bar on a pop up form but still need the border to be sizable. Is there a way to do this? MTIA Rocky Smolin Beach Access Software 858-259-4334 Skype: rocky.smolin www.e-z-mrp.com www.bchacc.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From gustav at cactus.dk Sun Apr 24 08:00:44 2011 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2011 15:00:44 +0200 Subject: [AccessD] SQL Server times link as str Message-ID: Hi John What to do in such cases is to create a straight select query - an interface query - for this table only. Select all fields that come through all right; the remaining offending fields you convert or manipulate as needed. Your date field you could probably convert with CDate (or CVDate if zero length strings appear). Now use this query as source whenever your application have to pull data from the linked table. Of course, if you need to write to the linked table you will need another query to interface in the other direction. /gustav On 23 Apr 2011 at 18:16, jwcolby wrote: > The SQL Server fields are time(0) and DateTime. It is picked up by > Access as a string, IOW the field in design view of the linked table > is a string. .. From Chester_Kaup at kindermorgan.com Mon Apr 25 07:09:42 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Mon, 25 Apr 2011 07:09:42 -0500 Subject: [AccessD] Trouble using Split command In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693C94@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CB6@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CC8@houex1.kindermorgan.com> <0B2BF8524B73A248A2F1B81BA751ED3C197D693CE8@houex1.kindermorgan.com> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693D8D@houex1.kindermorgan.com> Thanks for the piece of code. I am going to keep it. The data is delimitated by a variable number of spaces. What I ended up doing was reading through the line and replacing double spaces with single spaces until there were no more double spaces. The split commend then worked. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Friday, April 22, 2011 3:05 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Trouble using Split command Are the files truly delimited with a character? If not, and they are actually fixed length columns, you could read them in this manner: This is something I just wrote and tested: Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Private Sub cmdImport_Click() DoCmd.OpenQuery "qryDeletetblImport" Call ImportTextFile Me.sbfrmNewlyImportedRecords.Requery End Sub Sub ImportTextFile() Dim LineData As String Dim strCol1 As String ' Variable for Column 1 Dim strCol2 As String ' Variable for Column 2 Dim strCol3 As String ' Variable for Column 3 Dim strCol4 As String ' Variable for Column 4 Dim strCol5 As String ' Variable for Column 5 Dim db As Database Dim rsimport As Recordset Set db = CurrentDb Open Me.txtPath For Input As #1 ' Open the text file Set rsimport = db.OpenRecordset(" > > qryNewlyImportedRecords", dbOpenDynaset, dbSeeChanges) > > Do While Not EOF(1) > Line Input #1, LineData ' Read the whole line of data. > strCol1 = Trim(Left(LineData, 5)) 'assigns the first 5 characters to > the strCol1 variable > strCol2 = Trim(Mid(LineData, 6, 15)) 'assigns the next 15 characters to > the strCol2 variable > strCol3 = Trim(Mid(LineData, 21, 6)) 'assigns the next 6 characters to > the strCol3 variable > strCol4 = Trim(Mid(LineData, 27, 4)) 'assigns the next 4 characters to > the strCol4 variable > strCol5 = Trim(Mid(LineData, 31)) 'assigns the next remaining > characters to the strCol5 variable > > rsimport.AddNew > > rsimport!Remark = strCol1 > rsimport!Comment = strCol2 > rsimport!Color = strCol3 > rsimport!ContactName = strCol4 > rsimport!SomeNumber = CLng(IIf(strCol5 = "", 0, strCol5)) > > rsimport.Update > Loop > ' Close the data file. > Close #1 > rsimport.Close > Set rsimport = Nothing End Sub > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dhb at flsi.com Mon Apr 25 12:18:11 2011 From: dhb at flsi.com (Darrell Burns) Date: Mon, 25 Apr 2011 10:18:11 -0700 Subject: [AccessD] Tab control click event In-Reply-To: References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> Message-ID: <038701cc036c$c1856d40$449047c0$@com> Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB From rockysmolin at bchacc.com Mon Apr 25 12:58:36 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 10:58:36 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <><032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <40DAFC36A8754DC0B84338A405880D3A@HAL9005> Are you doing refresh or requery? If the refresh is because of a change on the previous page, can you refresh the data in the after update event of the control on the previous page that causes a change in the other pages? Then when the tab is clicked the data will already be refreshed. Or would that cause too much delay? Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 13:00:49 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 11:00:49 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box Message-ID: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From andy at minstersystems.co.uk Mon Apr 25 14:06:32 2011 From: andy at minstersystems.co.uk (Andy Lacey) Date: Mon, 25 Apr 2011 20:06:32 +0100 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> Message-ID: <49C5A426F1974C2EAFCE2421DC6CF9B1@MINSTER> Hi Darrell Wouldn't just an Echo False and an Echo True around the Requery do it for you? Andy -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: 25 April 2011 18:18 To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From dw-murphy at cox.net Mon Apr 25 15:53:30 2011 From: dw-murphy at cox.net (Doug Murphy) Date: Mon, 25 Apr 2011 13:53:30 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <038701cc036c$c1856d40$449047c0$@com> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> Message-ID: <000c01cc038a$e12db120$a3891360$@cox.net> Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Mon Apr 25 16:42:22 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Mon, 25 Apr 2011 14:42:22 -0700 Subject: [AccessD] Tab control click event In-Reply-To: <000c01cc038a$e12db120$a3891360$@cox.net> References: <> <032a01cc01b0$c4a1c630$4de55290$@com> <4DB34AC5.14044.33121AEB@stuart.lexacorp.com.pg> <038701cc036c$c1856d40$449047c0$@com> <000c01cc038a$e12db120$a3891360$@cox.net> Message-ID: <88183A49169647A0A40576475839C469@HAL9005> Come to think of it Doug, I did something like that on a tab form where I disappeared the tab and replaced it with a label, which looks nicer, you can format it, and has a Click event where you can do whatever and then set the focus to that page: Me.TabCtl140.Pages(1).SetFocus HTH Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy Sent: Monday, April 25, 2011 1:54 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Tab control click event Darrell, Why not use buttons to control the tab change and put the refresh code in the button on-click before you change the tab pages? Doug -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darrell Burns Sent: Monday, April 25, 2011 10:18 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tab control click event Howdy. I have a form with a tab control and multiple pages. I have to refresh the table bound to each page as it's clicked. I can do it with the Change event but then you see the table being deleted and refreshed and it looks clunky. What I'd like to do is capture the click or mouse-down event as the user selects a tab so I can do the refresh before the page changes. But none of seem to work. I've put a debug on both the click and mouse-down on the tab control, and on each page control, and I get nothing. Is there some other way of trapping the tab click before it changes? Thx, DB -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Darryl.Collins at iag.com.au Tue Apr 26 01:49:49 2011 From: Darryl.Collins at iag.com.au (Darryl Collins) Date: Tue, 26 Apr 2011 16:49:49 +1000 Subject: [AccessD] Karen's Powertools Message-ID: <201104260653.p3Q6rCr3016190@databaseadvisors.com> _______________________________________________________________________________________ Note: This e-mail is subject to the disclaimer contained at the bottom of this message. _______________________________________________________________________________________ I am sure a few of you have heard of or even user Karen's solutions. Got this today and maybe of interest for some of you. Very Sad '======== copied email follows =================== Dear Friends, I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. I know that Karen touched many of you with her kindness, wit, creativity and encouragement. She was a loving daughter, sister, aunt and friend. And she was a pretty darned good programmer, too. We are deeply grieving her loss. For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. We are also working to fill all CD orders that have been submitted or mailed. It is difficult to make business decisions while grieving. So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. Many of you have already written many kinds words of condolence and comfort. Please know that we greatly appreciate you. If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. You can learn more about them at www.DohnavurFellowship.org. All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. May God richly bless you, as He has all those who knew Karen. Bill Kenworthy Karen?s brother '============ end of copy ========= Regards Darryl _______________________________________________________________________________________ The information transmitted in this message and its attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete this e-mail and associated material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files, with the permission of the sender. This message has been scanned for viruses. _______________________________________________________________________________________ From jwcolby at colbyconsulting.com Tue Apr 26 07:46:37 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 08:46:37 -0400 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: <4DB6BEAD.1000507@colbyconsulting.com> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com From shamil at smsconsulting.spb.ru Tue Apr 26 08:08:45 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 26 Apr 2011 17:08:45 +0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Hi John -- Just importing everything into a new DB - wouldn't that be a solution to workaround the "bugger"? Is it MDE? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: 26 ?????? 2011 ?. 16:47 To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From garykjos at gmail.com Tue Apr 26 08:09:19 2011 From: garykjos at gmail.com (Gary Kjos) Date: Tue, 26 Apr 2011 08:09:19 -0500 Subject: [AccessD] Karen's Powertools In-Reply-To: <201104260653.p3Q6rCr3016190@databaseadvisors.com> References: <201104260653.p3Q6rCr3016190@databaseadvisors.com> Message-ID: Thanks for passing this sad news along Darryl. I have used some of Karen's tools over the years. GK On Tue, Apr 26, 2011 at 1:49 AM, Darryl Collins wrote: > > _______________________________________________________________________________________ > > Note: This e-mail is subject to the disclaimer contained at the bottom of this message. > _______________________________________________________________________________________ > > > > I am sure a few of you have heard of or even user Karen's solutions. ?Got this today and maybe of interest for some of you. ?Very Sad > > '======== copied email follows =================== > > Dear Friends, > > I suspect that many of you have noticed that the last issue of Karen?s Power Tools Newsletter was dated March 17, 2010, and you may have been anxiously awaiting another. ?It is with great sadness that I write to tell you of Karen?s death on April 12, 2011, after a long struggle with several debilitations, including diabetes. > > I know that Karen touched many of you with her kindness, wit, creativity and encouragement. ?She was a loving daughter, sister, aunt and friend. ?And she was a pretty darned good programmer, too. ?We are deeply grieving her loss. > > For now, Karen?s server is still running, the programs she has written can still be downloaded, and donations can still be made through the website. ?We are also working to fill all CD orders that have been submitted or mailed. ?It is difficult to make business decisions while grieving. ?So, at this point, I cannot say what will be the future of KarenWare.com, except to say that we will certainly continue Karen?s commitment to safeguard your privacy as shown at the Privacy link of KarenWare.com. > > Many of you have already written many kinds words of condolence and comfort. ?Please know that we greatly appreciate you. ?If you care to make a contribution in her honor, she was a long-time supporter of The Dohnavur Fellowship, a special children?s ministry in southern India. ?You can learn more about them at www.DohnavurFellowship.org. > > All we ask is that you remember her whenever you take the case off of your computer, contemplate removing entries from your Windows Registry, listen to Bob Wills or Riders in the Sky, or wave and say ?Hi!? to anyone on the ?net. > > May God richly bless you, as He has all those who knew Karen. > > Bill Kenworthy > Karen?s brother > > '============ end of copy ========= > > Regards > Darryl > _______________________________________________________________________________________ > > The information transmitted in this message and its attachments (if any) is intended > only for the person or entity to which it is addressed. > The message may contain confidential and/or privileged material. Any review, > retransmission, dissemination or other use of, or taking of any action in reliance > upon this information, by persons or entities other than the intended recipient is > prohibited. > > If you have received this in error, please contact the sender and delete this e-mail > and associated material from any computer. > > The intended recipient of this e-mail may only use, reproduce, disclose or distribute > the information contained in this e-mail and any attached files, with the permission > of the sender. > > This message has been scanned for viruses. > _______________________________________________________________________________________ > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Gary Kjos garykjos at gmail.com From rockysmolin at bchacc.com Tue Apr 26 08:24:53 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 06:24:53 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <1D0DAC4651364E11BC5253FF51FB991E@HAL9005> Data in temp tables? Otherwise although a PITA, binary search. Import half the objects, see what the size is after C/R. Import half the remaining, etc. Eventually, you'll find the culprit. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 5:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jimdettman at verizon.net Tue Apr 26 08:28:33 2011 From: jimdettman at verizon.net (Jim Dettman) Date: Tue, 26 Apr 2011 09:28:33 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: Create a new DB and import everything in. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 08:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Tue Apr 26 08:49:32 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Tue, 26 Apr 2011 08:49:32 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? From jwcolby at colbyconsulting.com Tue Apr 26 09:05:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:05:07 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <4DB6D113.3020906@colbyconsulting.com> Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution to > workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From rusty.hammond at cpiqpc.com Tue Apr 26 09:14:49 2011 From: rusty.hammond at cpiqpc.com (Rusty Hammond) Date: Tue, 26 Apr 2011 09:14:49 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6D113.3020906@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> Message-ID: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> What about a decompile then compact/repair? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:05 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE Yes, that is possible and it seems the "suggested solution". John W. Colby www.ColbyConsulting.com On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: > Hi John -- > > Just importing everything into a new DB - wouldn't that be a solution > to workaround the "bugger"? > Is it MDE? > > Thank you. > > -- > Shamil > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: 26 ?????? 2011 ?. 16:47 > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. ********************************************************************** From dbdoug at gmail.com Tue Apr 26 09:17:25 2011 From: dbdoug at gmail.com (Doug Steele) Date: Tue, 26 Apr 2011 07:17:25 -0700 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: Any embedded graphics? Doug On Tue, Apr 26, 2011 at 7:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Tue Apr 26 09:29:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 10:29:47 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> References: <4DB6BEAD.1000507@colbyconsulting.com> <4DB6D113.3020906@colbyconsulting.com> <49A286ABF515E94A8505CD14DEB721700DCFE1CB@CPIEMAIL-EVS1.CPIQPC.NET> Message-ID: <4DB6D6DB.4090509@colbyconsulting.com> I tried all of that, no help. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:14 AM, Rusty Hammond wrote: > What about a decompile then compact/repair? > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:05 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > Yes, that is possible and it seems the "suggested solution". > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 9:08 AM, Shamil Salakhetdinov wrote: >> Hi John -- >> >> Just importing everything into a new DB - wouldn't that be a solution >> to workaround the "bugger"? >> Is it MDE? >> >> Thank you. >> >> -- >> Shamil >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: 26 ?????? 2011 ?. 16:47 >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > ********************************************************************** > WARNING: All e-mail sent to and from this address will be received, > scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. > corporate e-mail system and is subject to archival, monitoring or review > by, and/or disclosure to, someone other than the recipient. > ********************************************************************** > From Gustav at cactus.dk Tue Apr 26 09:38:55 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 26 Apr 2011 16:38:55 +0200 Subject: [AccessD] Access 2003 - 50 meg FE Message-ID: Hi John Then I guess you are left with the save-as-text and load-from-text method on all objects. /gustav >>> jwcolby at colbyconsulting.com 26-04-2011 16:29 >>> I tried all of that, no help. From john at winhaven.net Tue Apr 26 09:41:55 2011 From: john at winhaven.net (John Bartow) Date: Tue, 26 Apr 2011 09:41:55 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6BEAD.1000507@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> Message-ID: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Even jpegs seem to increase the size far too much if one would accidently or otherwise paste a exe, dll, wmv or something into a form I'd imagine it would get huge. Check the forms and reports over and remove any ole objects or embedded images. Then decompile, compact, compile, compact. If that accomplishes nothing then I'd import it into a new db. Best of luck, John B BTW have you tried running Eatbloat on it? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 7:47 AM To: Access Developers discussion and problem solving Subject: [AccessD] Access 2003 - 50 meg FE I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 report, a handful of classes and modules. The bugger is 50 megs and won't shrink down when I compact / repair. It should probably be a couple of megs. Has anyone run across anything I should be looking at? -- John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 11:07:39 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 12:07:39 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004001cc0420$16bfe0c0$443fa240$@winhaven.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> Message-ID: <4DB6EDCB.1090202@colbyconsulting.com> >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in one > of the forms or report. Even jpegs seem to increase the size far too much if > one would accidently or otherwise paste a exe, dll, wmv or something into a > form I'd imagine it would get huge. Check the forms and reports over and > remove any ole objects or embedded images. Then decompile, compact, compile, > compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. It > should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From michael at mattysconsulting.com Tue Apr 26 11:47:20 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 12:47:20 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From df.waters at comcast.net Tue Apr 26 12:53:46 2011 From: df.waters at comcast.net (Dan Waters) Date: Tue, 26 Apr 2011 12:53:46 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB6EDCB.1090202@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> Message-ID: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> John, I made and have been testing an essentially one-click access utility which will do export to text and import from text of all the objects except tables. Do you want to try it? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 11:08 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE >>> First thing that comes to mind is an ole object - image or whatever in one of the forms or report. Hmm... I do have an activeX control for the IE object. John W. Colby www.ColbyConsulting.com On 4/26/2011 10:41 AM, John Bartow wrote: > First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. Even jpegs seem to increase the size far > too much if one would accidently or otherwise paste a exe, dll, wmv or > something into a form I'd imagine it would get huge. Check the forms > and reports over and remove any ole objects or embedded images. Then > decompile, compact, compile, compact. > > If that accomplishes nothing then I'd import it into a new db. > > Best of luck, > John B > > BTW have you tried running Eatbloat on it? > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 7:47 AM > To: Access Developers discussion and problem solving > Subject: [AccessD] Access 2003 - 50 meg FE > > I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 > report, a handful of classes and modules. > > The bugger is 50 megs and won't shrink down when I compact / repair. > It should probably be a couple of megs. > > Has anyone run across anything I should be looking at? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 13:01:16 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 11:01:16 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From michael at mattysconsulting.com Tue Apr 26 13:05:06 2011 From: michael at mattysconsulting.com (Michael Mattys) Date: Tue, 26 Apr 2011 14:05:06 -0400 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From rockysmolin at bchacc.com Tue Apr 26 15:41:30 2011 From: rockysmolin at bchacc.com (Rocky Smolin) Date: Tue, 26 Apr 2011 13:41:30 -0700 Subject: [AccessD] FW: Autocorrect Dialog Box In-Reply-To: References: <1313DCC4D4454E9B9F878E21A4C5198C@HAL9005> Message-ID: beautiful -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 11:05 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Hi Rocky, This is a favorite of mine http://www.accessruncommand.com/list/lista.htm Michael R Mattys Business Process Developers www.mattysconsulting.com 585-300-0181 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Tuesday, April 26, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Actually no, Mike. Thanks so much. Do you know where I might get a list of all those RunCommand commands? That might be real useful. Best, Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Tuesday, April 26, 2011 9:47 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] FW: Autocorrect Dialog Box Rocky, You've probably found this by now: DoCmd.RunCommand accmdAutoCorrect Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Monday, April 25, 2011 2:01 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] FW: Autocorrect Dialog Box Still looking for a solution to this one. Client suggests using SendKeys but I don't want to do that. Rocky -------------------------------------------------- From: "Rocky Smolin" Sent: Saturday, April 23, 2011 9:16 AM To: "'Access Developers discussion and problem solving'" Subject: Re: [AccessD] Autocorrect Dialog Box Application.AutoCorrect.DisplayAutoCorrectOptions = True Compiles but doesn't show the AUtoCorrect options dialog box. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 9:12 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Autocorrect Dialog Box This: Application.AutoCorrect.DisplayAutoCorrectOptions Doesn't work. Invalid use of property compiler error. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin Sent: Saturday, April 23, 2011 8:26 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Autocorrect Dialog Box Dear List: Does anyone know how to trigger the AutoCorrect Options dialog box from VBA? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Tue Apr 26 21:59:24 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 26 Apr 2011 22:59:24 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> Message-ID: <4DB7868C.4080705@colbyconsulting.com> sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility which > will do export to text and import from text of all the objects except > tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or whatever in > one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever in >> one of the forms or report. Even jpegs seem to increase the size far >> too much if one would accidently or otherwise paste a exe, dll, wmv or >> something into a form I'd imagine it would get huge. Check the forms >> and reports over and remove any ole objects or embedded images. Then >> decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, 1 >> report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jengross at gte.net Wed Apr 27 17:40:29 2011 From: jengross at gte.net (Jennifer Gross) Date: Wed, 27 Apr 2011 15:40:29 -0700 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <007b01cc052c$1d002370$1201a8c0@Schroeder> Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title? .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Apr 28 00:38:39 2011 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 28 Apr 2011 09:38:39 +0400 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: Hi Chester -- Your code works here well - MS Access/Office 2003. What code line does report Error 430 on your system? Thank you. -- Shamil -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: 26 ?????? 2011 ?. 17:50 To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 07:20:41 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 07:20:41 -0500 Subject: [AccessD] Copy recordset to excel spreadsheet In-Reply-To: <007b01cc052c$1d002370$1201a8c0@Schroeder> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <007b01cc052c$1d002370$1201a8c0@Schroeder> Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20412@houex1.kindermorgan.com> Thanks for the code example. I am going to keep it. Turns out the problem was I had to reregister DAO 3.6 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jennifer Gross Sent: Wednesday, April 27, 2011 5:40 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Copy recordset to excel spreadsheet Hi Chester, I do a lot of exporting to Excel and have for quite a while. I am not sure why, but maybe because of errors like you are seeing, I prefer to loop through the recordset and export as I go. Below is the basic code I use. Make sure Tools > References include the Excel library Jennifer Gross 805-480-1921 Public Sub ToExcel() On Error GoTo ErrorHandler Dim strErrMsg As String 'for Error Handling Dim X As Integer Dim objXL As Excel.Application Dim objWkb As Excel.Workbook Dim objSht As Excel.Worksheet Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim prm As DAO.Parameter Dim rsACData As DAO.Recordset Set db = CurrentDb Set qdf = db.QueryDefs("somequery") For Each prm In qdf.Parameters prm.Value = Eval(prm.Name) Next prm Set rsACData = qdf.OpenRecordset(dbOpenDynaset) 'export data to Excel If (Not rsACData.EOF) And (Not rsACData.BOF) Then If fIsAppRunning("Excel") Then Set objXL = GetObject(, "Excel.Application") Else Set objXL = CreateObject("Excel.Application") End If With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht .Cells(1, 1) = "Title" .Cells(2, 1) = "Another Title" .Cells(1, 1).Font.Bold = True .Cells(2, 1).Font.Bold = True .Cells(3, 1) = "Column Heading" .Cells(3, 2) = "Column Heading" .Cells(3, 3) = "Column Heading" .Cells(3, 4) = "Column Heading" .Cells(3, 5) = "Column Heading" .Cells(3, 6) = "Column Heading" .Cells(3, 7) = "Column Heading" .Rows(3).Font.Bold = True .Rows(3).WrapText = True .Columns(1).ColumnWidth = 10 .Columns(2).ColumnWidth = 15 .Columns(3).ColumnWidth = 10 .Columns(4).ColumnWidth = 30 .Columns(5).ColumnWidth = 10 .Columns(6).ColumnWidth = 10 .Columns(7).ColumnWidth = 10 X = 4 rsACData.MoveFirst Do Until rsACData.EOF .Cells(X, 1) = rsACData!SomeField .Cells(X, 2) = rsACData! SomeField .Cells(X, 3) = rsACData! SomeField .Cells(X, 4) = Format(rsACData! SomeDateField, "Short Date") .Cells(X, 5) = rsACData! SomeField .Cells(X, 6) = rsACData! SomeField .Cells(X, 7) = rsACData! "=B" & X & "+C" & X & "+E" & X & "+F" & X X = X + 1 rsACData.MoveNext Loop 'totals .Cells(X, 1) = "Totals" .Cells(X, 2) = "=Sum(B4:B" & X - 1 & ")" .Cells(X, 3) = "=Sum(C4:C" & X - 1 & ")" .Cells(X, 5) = "=Sum(E4:E" & X - 1 & ")" .Cells(X, 6) = "=Sum(F4:F" & X - 1 & ")" .Columns(5).NumberFormat = "#,##0.0_)" .Columns(6).NumberFormat = "$#,##0.00_);[Red] ($#,##0.00)" .PageSetup.PrintGridlines = True .PageSetup.Orientation = xlPortrait .PageSetup.PrintTitleRows = .Rows(2).Address objXL.Visible = True objXL.Cells(4, 1).Select objXL.ActiveWindow.FreezePanes = True End With End With Else MsgBox "No data", vbOKOnly + vbExclamation, "No data" End If ExitHere: qdf.Close rsACData.Close Set db = Nothing Set objSht = Nothing Set objWkb = Nothing Set objXL = Nothing DoCmd.Hourglass False DoCmd.SetWarnings True Exit Sub ErrorHandler: Select Case Err Case 91 'do nothing - object never opened Err.Clear Resume Next Case Else strErrMsg = "An error occurred in " & "ToExcel" & vbCrLf & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf & vbCrLf strErrMsg = strErrMsg & "Error Description: " & Err.Description MsgBox strErrMsg, vbInformation, "ToExcel" Resume ExitHere End Select End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester Sent: Tuesday, April 26, 2011 6:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Copy recordset to excel spreadsheet I am using the following code to copy a recordset to an excel spreadsheet. Just to be safe I check for missing references and found none.It generates an error Run time error 430 Class does not support Automation or does not support expected interface. What might I be doing wrong? Function CopytoSpreadsheet() Dim objXL As Object Dim xlWB As Object Dim xlWS As Object Dim rst As DAO.Recordset Dim fld As Field Dim strExcelFile As String Set objXL = CreateObject("Excel.Application") objXL.Visible = True Set xlWB = objXL.Workbooks.Add Set xlWS = xlWB.Worksheets(1) xlWS.Name = "Worksheet1" Set rst = CurrentDb.OpenRecordset("tbl DirectoryName") rst.MoveFirst xlWS.Range("A2").CopyFromRecordset rst xlWB.SaveAs "C:\files\Excel\SSTest.xls" rst.Close Set rst = Nothing End Function Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 ? -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Thu Apr 28 10:18:01 2011 From: bheygood at abestsystems.com (b heygood) Date: Thu, 28 Apr 2011 08:18:01 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: having a "ODBC - Call failed" message from A97 when running the code below. RTE is a long var. code generates no errors up to the last line. I can link to tables using the log on info and password successfully. any ideas?? 'populate the object variables Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, CONNECT_STR) conTest.QueryTimeout = 0 'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE From davidmcafee at gmail.com Thu Apr 28 11:04:07 2011 From: davidmcafee at gmail.com (David McAfee) Date: Thu, 28 Apr 2011 09:04:07 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) > DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From jm.hwsn at gmail.com Thu Apr 28 12:00:04 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 12:00:04 -0500 Subject: [AccessD] Field Level AES Encryption Message-ID: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim From Lambert.Heenan at chartisinsurance.com Thu Apr 28 12:35:53 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 13:35:53 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jm.hwsn at gmail.com Thu Apr 28 13:19:11 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Thu, 28 Apr 2011 13:19:11 -0500 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Lambert.Heenan at chartisinsurance.com Thu Apr 28 13:55:59 2011 From: Lambert.Heenan at chartisinsurance.com (Heenan, Lambert) Date: Thu, 28 Apr 2011 14:55:59 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4db9afa2.2dc6ec0a.3af3.5411@mx.google.com> Message-ID: Well that's different then. :-) Access 2007 huh? Still plodding along with A2003 here. No security at all really. :-) Thanks again for the information. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 2:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Field Level AES Encryption Access 2007 uses the MS Crytographic API which is RC4 encryption (40-bit key) and password key/hashing uses the SHA-1 algorithm. This could be upgraded 128 bit encryption using a registry modification on the programmer's machine. I understand that Access 2010 uses AES 128 bit encryption. According to Wayne Phillips (www.everythingaccess.com) the database password is not "...stored in the file, only brute-force password recovery is possible." His full discussion on A2007 is here: http://www.everythingaccess.com/tutorials.asp?ID=Changing-the-encryption-typ e-in-Access-2007 For most users this security level is adequate... I wouldn't use it for a system that stores secret level data, but then I don't think I would be working on them anyway. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Thursday, April 28, 2011 12:36 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Field Level AES Encryption Thank you for your review of this software. Very helpful. However there is a flaw in the modifications you have made. The storing of the password in our application. You are relying on Access encryption to protect that password. I do not actually know what type of encryption Access uses, but I suspect it might be weaker than AES. So you just built a back door. IMHO. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jm.hwsn Sent: Thursday, April 28, 2011 1:00 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Field Level AES Encryption I thought I would send this information to this group, especially since Philippe Pons asked the question about hiding information. I had a requirement to encrypt a single field within a database. This field contains the Social Security Number (SSN) of the users of the database. The SSN is used as an individual's password and by government standards MUST be encrypted. After much searching and testing different suggestions, I found a solution. It involves a Class and a module and uses the American Encryption Standard (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. The class was written in 2001 by Phil Fresle and works flawlessly. I don't understand how it works nor would I even attempt to change it. The original code was written in C. The Class was written for VB6 but works in VBA without modifications. Fresle is from the UK. his website is: www.frez.co.uk/ On his website is the latest version of the Class. But, I found the best solution which incorporates Mr. Fresle's class on an Excel Website by Dermot Balson from Australia. His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml Mr. Balson by his own admission is "an actuary who loves working in Excel." The class on Mr. Balson's site needs to be updated with the latest version from Mr. Fresle's site. What I like about Mr. Balson's solution is that the module contains two functions. One to encrypt the field and the other to decrypt the data. Also, changing from 128 bit to 192 or to 256 bit encryption is simply changing a public KeyLength. The results are stored in a table in pure ASCII so it's easy to use the ASCII key if needed. What I didn't like was the PassPhrase (password) was required for each function and the decryption of the data left blank spaces at the end. So I modified the module by creating a function for the password. of course it's hidden in the module and password protected through Access' encryption. Now I can change the PassPhrase in one place and change the encryption key size at anytime. And if needed, I can use the password field as text. Life if good! HTH Jim -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Chester_Kaup at kindermorgan.com Thu Apr 28 14:38:26 2011 From: Chester_Kaup at kindermorgan.com (Kaup, Chester) Date: Thu, 28 Apr 2011 14:38:26 -0500 Subject: [AccessD] Acrobat question Message-ID: <0B2BF8524B73A248A2F1B81BA751ED3C197DA20572@houex1.kindermorgan.com> Will this code work with Acrobat reader or is a full version necessary? Dim AcroXApp As Object Dim AcroXAVDoc As Object Dim AcroXPDDoc As Object Set AcroXApp = CreateObject("AcroExch.App") AcroXApp.Hide Set AcroXAVDoc = CreateObject("AcroExch.AVDoc") AcroXAVDoc.Open PDF_PATH & filename, "Acrobat" AcroXAVDoc.BringToFront Set AcroXPDDoc = AcroXAVDoc.GetPDDoc Dim jsObj As Object Set jsObj = AcroXPDDoc.GetJSObject jsObj.SaveAs OUTPUT_PATH & OutputFile, "com.adobe.acrobat.plain-text" AcroXAVDoc.Close False AcroXApp.Hide AcroXApp.Exit Chester Kaup Engineering Technician Kinder Morgan CO2 Company, LLP Office (432) 688-3797 FAX (432) 688-3799 No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. From newsgrps at dalyn.co.nz Thu Apr 28 15:09:14 2011 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 29 Apr 2011 08:09:14 +1200 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) >DoEvents >conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Apr 28 15:10:20 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Apr 2011 16:10:20 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> Message-ID: <4DB9C9AC.9060400@colbyconsulting.com> Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > From ab-mi at post3.tele.dk Thu Apr 28 16:21:16 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Thu, 28 Apr 2011 23:21:16 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DB9C9AC.9060400@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: How do you create the hash - any generator to recommend? Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 28. april 2011 22:10 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN entered and compare to the hash you stored. You never have the ssn stored at all and the hash is one way so it can't be deduced. John W. Colby www.ColbyConsulting.com On 4/28/2011 1:00 PM, jm.hwsn wrote: > I thought I would send this information to this group, especially since > Philippe Pons asked the question about hiding information. > > I had a requirement to encrypt a single field within a database. This field > contains the Social Security Number (SSN) of the users of the database. The > SSN is used as an individual's password and by government standards MUST be > encrypted. > > After much searching and testing different suggestions, I found a solution. > It involves a Class and a module and uses the American Encryption Standard > (AES) developed by Joan Daemen and Vincent Rijmen hence call Rijndael. > > The class was written in 2001 by Phil Fresle and works flawlessly. I don't > understand how it works nor would I even attempt to change it. > The original code was written in C. The Class was written for VB6 but works > in VBA without modifications. Fresle is from the UK. his website is: > www.frez.co.uk/ On his website is the latest version of the Class. > > But, I found the best solution which incorporates Mr. Fresle's class on an > Excel Website by Dermot Balson from Australia. > His website is: http://www.westnet.net.au/balson/ModellingExcel/VBA.shtml > Mr. Balson by his own admission is "an actuary who loves working in Excel." > The class on Mr. Balson's site needs to be updated with the latest version > from Mr. Fresle's site. > > What I like about Mr. Balson's solution is that the module contains two > functions. One to encrypt the field and the other to decrypt the data. > Also, changing from 128 bit to 192 or to 256 bit encryption is simply > changing a public KeyLength. The results are stored in a table in pure > ASCII so it's easy to use the ASCII key if needed. > What I didn't like was the PassPhrase (password) was required for each > function and the decryption of the data left blank spaces at the end. > > So I modified the module by creating a function for the password. of course > it's hidden in the module and password protected through Access' encryption. > > Now I can change the PassPhrase in one place and change the encryption key > size at anytime. And if needed, I can use the password field as text. > > Life if good! > HTH > Jim > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:00:07 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:00:07 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBAD277.8080507@colbyconsulting.com> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 ' Can be used freely even for commercial applications ' ' MS Access 97 version by ' Gustav Brock, Cactus Data ApS ' gustav at cactus.dk ' ' 2002-03-09. V1.0 ' Initial port from Visual Basic. ' 2002-06-23. V1.1 ' Code clean up and constants added. ' Redundant code removed. ' Modified to fully comply with VB datatypes. ' Modified to not crash for certain passwords. ' Modified for high speed conversion of long strings ( > 32K). ' 2002-06-24. V1.2 ' Functions added for en/decrypting to/from binary strings. ' Usage: ' SetPassword(password) sets password prior to en/decryption. ' GetPassword() retrieves current password. ' StrEncrypt(DecryptedString) returns encrypted ascii string. ' StrDecrypt(EncryptedString_ascii) returns decrypted string. ' StrEncryptBin(DecryptedString) returns encrypted binary string. ' StrDecryptBin(EncryptedString_binary) returns decrypted string. ' ' Encrypted ascii string is twice the length of the decrypted string. ' Encrypted ascii string contains low ascii chars from a to p only. ' Encrypted binary string is same length as the decrypted string. ' Encrypted binary string may contain any char including Chr(0). ' Password may contain any ascii char including Chr(0). ' Password is maintained in global variable strPC1Password16. Private Const clngHexMax As Long = &H10 Private Const clngBytMax As Long = &H100 ' Maximum value of unsigned Integer. Private Const clngIntMax As Long = &H10000 ' clngAscMin defines beginning of a 16 letter range from a to p. Private Const clngAscMin As Long = &H61 Private strPC1Password16 As String * clngHexMax Private x1a0(9) As Long Private cle(17) As Long Private x1a2 As Long Private lngInt As Long Private lngRes As Long Private lngTmp As Long Private ax As Long Private bx As Long Private cx As Long Private dx As Long Private si As Long Private i As Long Private c As Long Private d As Long Private e As Long Private strEncrypted As String Private strDecrypted As String Public Function SetPassword(ByRef strPassword As String) As Integer Dim intPasswordLength As Integer ' Remove leading and trailing spaces from password. strPassword = Trim(strPassword) ' Set global variable and limit password to fixed length of 16 characters. strPC1Password16 = strPassword ' Find and return net length of password. intPasswordLength = Len(strPassword) SetPassword = intPasswordLength End Function Public Function GetPassword() As String ' Get global variable strPC1Password16. GetPassword = RTrim(strPC1Password16) End Function Public Function StrEncrypt(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(False) StrEncrypt = strEncrypted End Function Public Function StrDecrypt(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(False) StrDecrypt = strDecrypted End Function Public Function StrEncryptBin(ByVal strInput As String) As String strDecrypted = strInput Call Encrypt(True) StrEncryptBin = strEncrypted End Function Public Function StrDecryptBin(ByVal strInput As String) As String strEncrypted = strInput Call Decrypt(True) StrDecryptBin = strDecrypted End Function Private Sub Encrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strDecrypted lngX = Len(strX) strEncrypted = Space(lngX * (2 - Abs(booBinary))) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX c = Asc(mID(strX, lngN, 1)) ' Calculate lngInt. Call Assemble lngC = lngInt \ clngBytMax lngD = lngInt Mod clngBytMax For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM c = c Xor (lngC Xor lngD) If booBinary = False Then ' Build ascii string. d = (c \ clngHexMax) Mod clngHexMax e = c Mod clngHexMax ' clngAscMin + d gives one letter range from a to p for the 4 high bits of c. ' clngAscMin + e gives one letter range from a to p for the 4 low bits of c. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, (lngN * 2) - 1, 1) = Chr(clngAscMin + d) Mid(strEncrypted, (lngN * 2) - 0, 1) = Chr(clngAscMin + e) Else ' Build binary string. ' Perform high speed insertion of encrypted character. Mid(strEncrypted, lngN, 1) = Chr(c) End If Next lngN End Sub Private Sub Decrypt(ByVal booBinary As Boolean) Dim strX As String Dim lngC As Long Dim lngD As Long Dim lngM As Long Dim lngN As Long Dim lngX As Long si = 0 x1a2 = 0 i = 0 strX = strEncrypted lngX = Len(strX) \ (2 - Abs(booBinary)) strDecrypted = Space(lngX) For lngN = 1 To clngHexMax cle(lngN) = Asc(mID(strPC1Password16, lngN, 1)) Next lngN For lngN = 1 To lngX If booBinary = False Then d = Asc(mID(strX, (lngN * 2) - 1, 1)) If d >= clngAscMin Then ' Transform the letter to the 4 high bits of c. d = d - clngAscMin If d < clngHexMax Then d = d * clngHexMax End If End If e = Asc(mID(strX, (lngN * 2) - 0, 1)) If e >= clngAscMin Then ' Transform the letter to the 4 low bits of c. e = e - clngAscMin If e < clngHexMax Then c = d + e End If End If Else c = Asc(mID(strX, lngN, 1)) End If ' Calculate lngInt. Call Assemble lngC = (lngInt \ clngBytMax) Mod clngBytMax lngD = lngInt Mod clngBytMax c = c Xor (lngC Xor lngD) For lngM = 1 To clngHexMax cle(lngM) = cle(lngM) Xor c Next lngM ' Perform high speed insertion of decrypted character. Mid(strDecrypted, lngN, 1) = Chr(c) Next lngN End Sub Private Sub Assemble() Dim lngM As Long Dim lngN As Long x1a0(0) = ((cle(1) * clngBytMax) + cle(2)) Mod clngIntMax Call Code lngInt = lngRes For lngM = 1 To (clngHexMax / 2) - 1 lngN = lngM * 2 x1a0(lngM) = x1a0(lngM - 1) Xor ((cle(lngN + 1) * clngBytMax) + cle(lngN + 2)) Call Code lngInt = lngInt Xor lngRes Next lngM i = 0 End Sub Private Sub Code() Const clngKeyB As Long = &H4E35 Const clngKeyC As Long = &H15A dx = (x1a2 + i) Mod clngIntMax ax = x1a0(i) cx = clngKeyC bx = clngKeyB lngTmp = ax ax = si si = lngTmp lngTmp = ax ax = dx dx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax End If lngTmp = ax ax = cx cx = lngTmp If (ax <> 0) Then ax = ((ax Mod clngIntMax) * (si Mod clngIntMax)) Mod clngIntMax cx = (ax + cx) Mod clngIntMax End If lngTmp = ax ax = si si = lngTmp ax = ((ax Mod clngIntMax) * (bx Mod clngIntMax)) Mod clngIntMax dx = (cx + dx) Mod clngIntMax ax = ax + 1 x1a2 = dx x1a0(i) = ax lngRes = ax Xor dx i = i + 1 End Sub John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger From Gustav at cactus.dk Fri Apr 29 10:07:53 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:07:53 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 From jm.hwsn at gmail.com Fri Apr 29 10:14:26 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 10:14:26 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Which is the similar to using the strConv function in Access to store the data in Unicode. It's unreadable but not really secure. Thanks, Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2011 10:08 AM To: accessd at databaseadvisors.com Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Oops John, you missed my follow-up message: --- Hi all I was told by one who knows more about encryption than me, Dave Howe, that: PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. --- /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:00 >>> Thanks to Gustav. this is encryption, not hashing. Option Compare Database Option Explicit ' PC1 Cipher 128-bit key ' (c) Alexander Pukall 1991 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 10:30:05 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:30:05 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> References: <4dbad5d4.8d05ec0a.77ab.7366@mx.google.com> Message-ID: <4DBAD97D.3030905@colbyconsulting.com> Well... I am thinking it is waaaaay more secure than that. John W. Colby www.ColbyConsulting.com On 4/29/2011 11:14 AM, jm.hwsn wrote: > Which is the similar to using the strConv function in Access to store the > data in Unicode. > It's unreadable but not really secure. > Thanks, > Jim > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2011 10:08 AM > To: accessd at databaseadvisors.com > Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit > ordering on the key (and remove the parity bits) before starting the first > round of the non-invertible s-boxes. These are also left-rotated between > each round (by 1 or 2 bits, in a non-regular pattern) to form what is > commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a > code Alexander Pukall designed himself - and which is widely regarded as > insecure. Pukall shouldn't really have chosen the same name as the DES key > schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text > non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From jwcolby at colbyconsulting.com Fri Apr 29 10:36:16 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 11:36:16 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBADAF0.7060304@colbyconsulting.com> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 > > > From Gustav at cactus.dk Fri Apr 29 10:46:08 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 17:46:08 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi John Yes, here: http://www.frez.co.uk/vb6.aspx /gustav >>> jwcolby at colbyconsulting.com 29-04-2011 17:36 >>> Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? John W. Colby www.ColbyConsulting.com On 4/29/2011 11:07 AM, Gustav Brock wrote: > Oops John, you missed my follow-up message: > > --- > Hi all > > I was told by one who knows more about encryption than me, Dave Howe, that: > > > PC-1 is an important part of the DES algorithm, used to prescramble the bit ordering on the key (and remove the parity bits) before starting the first round of the non-invertible s-boxes. These are also left-rotated between each round (by 1 or 2 bits, in a non-regular pattern) to form what is commonly called a "key schedule" or "subkey array". > > However your module is not using DES/PC-1, but "Pukall Code #1" which is a code Alexander Pukall designed himself - and which is widely regarded as insecure. Pukall shouldn't really have chosen the same name as the DES key schedule, as it does tend to cause confusion. > > > So, as a general warning, the code is fine for making clear text non-readable but should not be used for true encryption. > --- > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:00>>> > Thanks to Gustav. this is encryption, not hashing. > > Option Compare Database > Option Explicit > > ' PC1 Cipher 128-bit key > ' (c) Alexander Pukall 1991 From jwcolby at colbyconsulting.com Fri Apr 29 11:41:59 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 12:41:59 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: References: Message-ID: <4DBAEA57.60602@colbyconsulting.com> Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From jm.hwsn at gmail.com Fri Apr 29 11:48:27 2011 From: jm.hwsn at gmail.com (jm.hwsn) Date: Fri, 29 Apr 2011 11:48:27 -0500 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4DBAEA57.60602@colbyconsulting.com> References: <4DBAEA57.60602@colbyconsulting.com> Message-ID: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From Gustav at cactus.dk Fri Apr 29 11:53:28 2011 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2011 18:53:28 +0200 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Message-ID: Hi Jim Sorry, missed that, I have followed this thread with half an eye only. Anyway, the circle is closed! /gustav >>> jm.hwsn at gmail.com 29-04-2011 18:48 >>> That's the site I emailed earlier. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, April 29, 2011 11:42 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption Wow is that awesome! Thanks! John W. Colby www.ColbyConsulting.com On 4/29/2011 11:46 AM, Gustav Brock wrote: > Hi John > > Yes, here: > > http://www.frez.co.uk/vb6.aspx > > /gustav > > >>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> > Thanks for the heads up on that. Have you by any chance found an opensource for this that is considered secure? > > John W. Colby > www.ColbyConsulting.com From df.waters at comcast.net Fri Apr 29 11:57:50 2011 From: df.waters at comcast.net (Dan Waters) Date: Fri, 29 Apr 2011 11:57:50 -0500 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <4DB7868C.4080705@colbyconsulting.com> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> Message-ID: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> John - how did it go? Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 26, 2011 9:59 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Access 2003 - 50 meg FE sure. John W. Colby www.ColbyConsulting.com On 4/26/2011 1:53 PM, Dan Waters wrote: > John, > > I made and have been testing an essentially one-click access utility > which will do export to text and import from text of all the objects > except tables. Do you want to try it? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 11:08 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > >>> First thing that comes to mind is an ole object - image or > whatever in one of the forms or report. > > Hmm... I do have an activeX control for the IE object. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 10:41 AM, John Bartow wrote: >> First thing that comes to mind is an ole object - image or whatever >> in one of the forms or report. Even jpegs seem to increase the size >> far too much if one would accidently or otherwise paste a exe, dll, >> wmv or something into a form I'd imagine it would get huge. Check the >> forms and reports over and remove any ole objects or embedded images. >> Then decompile, compact, compile, compact. >> >> If that accomplishes nothing then I'd import it into a new db. >> >> Best of luck, >> John B >> >> BTW have you tried running Eatbloat on it? >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 7:47 AM >> To: Access Developers discussion and problem solving >> Subject: [AccessD] Access 2003 - 50 meg FE >> >> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >> 1 report, a handful of classes and modules. >> >> The bugger is 50 megs and won't shrink down when I compact / repair. >> It should probably be a couple of megs. >> >> Has anyone run across anything I should be looking at? >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Apr 29 12:16:47 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:16:47 -0400 Subject: [AccessD] RC1 encryption - was Re: Field Level AES Encryption In-Reply-To: <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> References: <4DBAEA57.60602@colbyconsulting.com> <4dbaebdc.0888ec0a.452f.75f9@mx.google.com> Message-ID: <4DBAF27F.9030303@colbyconsulting.com> LOL, I wasn't following this thread closely. In fact I only spoke up to recommend the hash method. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:48 PM, jm.hwsn wrote: > That's the site I emailed earlier. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Friday, April 29, 2011 11:42 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] RC1 encryption - was Re: Field Level AES Encryption > > Wow is that awesome! > > Thanks! > > John W. Colby > www.ColbyConsulting.com > > On 4/29/2011 11:46 AM, Gustav Brock wrote: >> Hi John >> >> Yes, here: >> >> http://www.frez.co.uk/vb6.aspx >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 29-04-2011 17:36>>> >> Thanks for the heads up on that. Have you by any chance found an > opensource for this that is considered secure? >> >> John W. Colby >> www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Apr 29 12:17:53 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 29 Apr 2011 13:17:53 -0400 Subject: [AccessD] Access 2003 - 50 meg FE In-Reply-To: <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> References: <4DB6BEAD.1000507@colbyconsulting.com> <004001cc0420$16bfe0c0$443fa240$@winhaven.net> <4DB6EDCB.1090202@colbyconsulting.com> <004101cc043a$e428dfc0$ac7a9f40$@comcast.net> <4DB7868C.4080705@colbyconsulting.com> <002c01cc068e$935f49c0$ba1ddd40$@comcast.net> Message-ID: <4DBAF2C1.5020007@colbyconsulting.com> Well... I haven't managed to address this yet. The last few days were pure overload. John W. Colby www.ColbyConsulting.com On 4/29/2011 12:57 PM, Dan Waters wrote: > John - how did it go? > > Dan > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 26, 2011 9:59 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Access 2003 - 50 meg FE > > sure. > > > John W. Colby > www.ColbyConsulting.com > > On 4/26/2011 1:53 PM, Dan Waters wrote: >> John, >> >> I made and have been testing an essentially one-click access utility >> which will do export to text and import from text of all the objects >> except tables. Do you want to try it? >> >> Dan >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >> Sent: Tuesday, April 26, 2011 11:08 AM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Access 2003 - 50 meg FE >> >> >>> First thing that comes to mind is an ole object - image or >> whatever in one of the forms or report. >> >> Hmm... I do have an activeX control for the IE object. >> >> >> John W. Colby >> www.ColbyConsulting.com >> >> On 4/26/2011 10:41 AM, John Bartow wrote: >>> First thing that comes to mind is an ole object - image or whatever >>> in one of the forms or report. Even jpegs seem to increase the size >>> far too much if one would accidently or otherwise paste a exe, dll, >>> wmv or something into a form I'd imagine it would get huge. Check the >>> forms and reports over and remove any ole objects or embedded images. >>> Then decompile, compact, compile, compact. >>> >>> If that accomplishes nothing then I'd import it into a new db. >>> >>> Best of luck, >>> John B >>> >>> BTW have you tried running Eatbloat on it? >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby >>> Sent: Tuesday, April 26, 2011 7:47 AM >>> To: Access Developers discussion and problem solving >>> Subject: [AccessD] Access 2003 - 50 meg FE >>> >>> I have a very simple FE, 20 linked tables (to SQL Server), 10 forms, >>> 1 report, a handful of classes and modules. >>> >>> The bugger is 50 megs and won't shrink down when I compact / repair. >>> It should probably be a couple of megs. >>> >>> Has anyone run across anything I should be looking at? >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Sat Apr 30 09:40:18 2011 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 30 Apr 2011 10:40:18 -0400 Subject: [AccessD] Field Level AES Encryption In-Reply-To: References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> Message-ID: <4DBC1F52.3070807@colbyconsulting.com> I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com From ab-mi at post3.tele.dk Sat Apr 30 12:37:44 2011 From: ab-mi at post3.tele.dk (Asger Blond) Date: Sat, 30 Apr 2011 19:37:44 +0200 Subject: [AccessD] Field Level AES Encryption In-Reply-To: <4DBC1F52.3070807@colbyconsulting.com> References: <4db99d17.4bb7ec0a.0ee4.5074@mx.google.com> <4DB9C9AC.9060400@colbyconsulting.com> <4DBC1F52.3070807@colbyconsulting.com> Message-ID: <670A825F36374733BC58BE25C5DFA4F3@abpc> Thanks for the explanation, John. Could you perhaps send me your hash generator offline - I would appreciate much. Asger -----Oprindelig meddelelse----- Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 30. april 2011 16:40 Til: Access Developers discussion and problem solving Emne: Re: [AccessD] Field Level AES Encryption I tried to send through my hash generator but AccessD rejected it for length. Basically pick a hash and go. A hash generator takes an input, hashes it, and delivers an output. The output string is a fixed length string that "represents" the input, but you cannot take the output and get back to the input. This really only works if you do not actually need the input for any reason. Let's say that you are storing records where one way you want to look it up is by the SSN. Actually storing the SSN is risky buy by hashing it, the SSN is never stored but you can still get at it by storing the hash, and then looking up the hash. I also use a hash to allow me to compare records. I hash the address information and store the hash. I can then compare the address hash of one record with the address hash of another record. If the hashes are equal, then you have a match. John W. Colby www.ColbyConsulting.com On 4/28/2011 5:21 PM, Asger Blond wrote: > How do you create the hash - any generator to recommend? > Asger > -----Oprindelig meddelelse----- > Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 28. april 2011 22:10 > Til: Access Developers discussion and problem solving > Emne: Re: [AccessD] Field Level AES Encryption > > Unless you actually need the ssn, I recommend storing a HASH of the ssn. Then you when you need to > see if the SSN entered in a form somewhere is equal to the SSN you "stored", you hash the SSN > entered and compare to the hash you stored. You never have the ssn stored at all and the hash is > one way so it can't be deduced. > > John W. Colby > www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:03:53 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:03:53 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> Message-ID: <9FE47E35DFB047C28D1FD535A4A2FE1B@Seven> thx for responding. I could not get that code to work. been a long time since A97 anyone else? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David McAfee Sent: Thursday, April 28, 2011 9:04 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A97 SQL Server It's been a while since I've used A97 Can you do it, via a query by first modifying the querydef? Dim qdfCurr As QueryDef Dim strSQL as String strSQL = "EXEC sp_Add_FutureServicesOrders_byRoute @Parm1=" & RTE Set qdfCurr = CurrentDb().QueryDefs("MyQueryNameHere") qdfCurr.SQL = strSQL On Thu, Apr 28, 2011 at 8:18 AM, b heygood wrote: > having a "ODBC - Call failed" message from A97 when running the code below. > RTE is a long var. > code generates no errors up to the last line. > I can link to tables using the log on info and password successfully. > > any ideas?? > > > > 'populate the object variables > Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) > Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, > True, > CONNECT_STR) > conTest.QueryTimeout = 0 > > 'Execute the stored procedure (SQL Server 7.0) DoEvents > conTest.Execute "EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com From bheygood at abestsystems.com Sat Apr 30 14:04:39 2011 From: bheygood at abestsystems.com (b heygood) Date: Sat, 30 Apr 2011 12:04:39 -0700 Subject: [AccessD] A97 SQL Server In-Reply-To: <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> References: <0B2BF8524B73A248A2F1B81BA751ED3C197D693FFB@houex1.kindermorgan.com> <20110428200959.ZPQC26379.mta01.xtra.co.nz@David-PC.dalyn.co.nz> Message-ID: <356F885A526D46519BE17F64C1E07317@Seven> thanks, but no, that did not help. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Thursday, April 28, 2011 1:09 PM To: Access Developers discussion and problem solving; 'Access Developers discussion and problem solving' Subject: Re: [AccessD] A97 SQL Server Try adding a space after _byRoute and before the closing quote. Regards David Dalyn Software Ltd New Zealand At 29/04/2011, b heygood wrote: >having a "ODBC - Call failed" message from A97 when running the code below. >RTE is a long var. >code generates no errors up to the last line. >I can link to tables using the log on info and password successfully. > >any ideas?? > > > >'populate the object variables >Set wkTest = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC) >Set conTest = wkTest.OpenConnection("CONNECTION", dbDriverNoPrompt, >True, >CONNECT_STR) >conTest.QueryTimeout = 0 > >'Execute the stored procedure (SQL Server 7.0) DoEvents conTest.Execute >"EXEC sp_Add_FutureServicesOrders_byRoute" & RTE > >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com